B4J Library B4JServer QRCode Generator

QRCode Generator using ZXing Library
Can be use for B4JServer, Web API Server and Non-UI app (does not depend on XUI or jFX)



B4X:
Dim img As String = File.Combine(Main.AssetFolder, "img")
Dim generate As ZXing
generate.Initialize
generate.QrCode(value, 400, File.Combine(img, "image.png"), "png")

Additional Libraries:
core-3.5.1.jar
javase-3.5.1.jar
jZXing.jar (attached)



jZXing
Author:
Aeric Poon
Version: 1.00
 

Attachments

  • jZXing.zip
    3 KB · Views: 311
  • QRCodeServer.zip
    1.8 KB · Views: 261
Last edited:

aeric

Expert
Licensed User
Longtime User
I just found there is a similar library (which is more faster since it is based on nayuki)
 

hatzisn

Expert
Licensed User
Longtime User

Nevertheless your perseverence in your project worked for all of us. Congratulations.
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello,

Great library! , but i would recommend using the client side QR Code creations :

HTML:
<div id="qrresult"></div>
<script src="https://cdn.jsdelivr.net/gh/davidshimjs/qrcodejs/qrcode.min.js"></script>

JServer:
Dim strQR As String
    strQR = $"const qrcode = new QRCode(document.getElementById('qrresult'), {
  text: '${strShortURL}',
  width: 120,
  height: 120,
  colorDark : '#000',
  colorLight : '#fff',
  correctLevel : QRCode.CorrectLevel.H
});"$
    
        ws.Eval(strQR,Null)
        ws.Flush

*You can replace the strShortURL with a URL or text.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…