QR Code Generator
Overview
QR codes are a popular type of two-dimensional barcode.They can store up to 4,296 alphanumeric characters of arbitrary text. This text can be numerical, alphanumerical or binary, for example URL, contact information, a telephone number.
QR codes can be read by an optical device with the appropriate software like a totalcross application or even your phone's camera. To see how to make a qrcode reader click here.
Usage
To generate the QR Code just instantiate a QRCode Image and call the method generate(ecc,str)
passing as parameters the ECC, which is the quality of the generated code (better in the next topic) and the text of QRCode.
See the example below:
It is noteworthy that, depending on the type and complexity of the text entered, the version of QRCode generated changes. The choice of the appropriate version for the past text happens internally. To see which version was chosen, simply pass true in the QRCode Debug attribute(QRCode.DEBUG = true;
),as in line 16 of the code above.
Error Correction Level
The ECC, as commented above, ECC corresponds to Error Correction Level and they are:
Error Correction Level
Description
ECC_LOW
Allows recovery of up to 7% data loss
ECC_MEDIUM
Allows recovery of up to 15% data loss
ECC_QUARTILE
Allows recovery of up to 25% data loss
ECC_HIGH
Allows recovery of up to 30% data loss
By default, totalcross uses ECC_QUARTILE
References
See more in https://www.qrcode.com/en
Download the full QRCode generator example here
Last updated