Qr : Read and Create Qr/Bar Code offline

Maybe becuause of android version.

This .aia is created in Kodular and is not compatible with AI2.

Ahh, please don't use that URL.

1 Like

Here are the blocks:
Generate Bar Code
Decode Bar Code

I made a test app:
QR.aia (15.0 KB)

Problem 1 - Created PNG file is empty.
Problem 2 - When I use ImagePicker to get a QR code from my phone, I get an error: com.google.zxing.NotFoundException.
Problem 3 - App crashes on startup after compiling, with companion works fine.

Probably given logo does not exist.

Have you asked for WRITE_EXTERNAL_STORAGE permission?
Also I suggest you to not use ImagePicker.Selection block because it creates unnecessary temp files.You should use Activity Starter along with FileTools or TaifunFile extension.
See here how:

You have not put a barcode scanner component.

This should work fine:
Qr.aia (33.2 KB)

Yeah. I don't have a logo. I thought that made the logo :). What is a qr code logo?

Yes permission granted. ImagePicker returns the path to the created temporary file. The temporary file exists, so it should decode qr correctly. I work with ActivitiStarter later.

I did not know that a scanner is needed. I thought it was an independent extension

Sometimes we want to decorate qr code with watermarks.That is it.

From where have you downloaded bar/qr code?

No, it needs some deps which are only available in Barcode Scanner component.

1 Like

What is the maximum length of the text that you can encode in QRCODE? With short text, the extension generate and decodes well. When the text is a long, QR code is generated correctly, while when decoding there is a COM.GOGLE.ZXING.NOTFOUNDEXCEPTION error. I will add that the scanner correctly decodes the QR code.

QrScan800.aia (54.5 KB)



Another thing is whether I can save the logo in the APP resources? I tried to give the path to the logo "http://localhost/logo.png" but it does not work.

It means either:

  • dimensions are larger than expected
  • orientation has been changed
  • some pixels have been lost

Usually extensions don't use that path.So // will work for assets.

The dimensions are the same as in the coding block, i.e. 800x800. What size does the decoder expect, because I can't see the information about it. I'll try on smaller sizes. Unless the more text the bigger the QR has to be?

Usually QR codes have a size of 150*150 or 200*200

Okay, experimenting with the size is successful.
The last problem with getting the logo from the asset path. I tried:

  • logo.png
  • /logo.png
  • //logo.png
  • ///logo.png
  • file: ///android_assets/logo.png

QrScan (1).aia (57.5 KB)

Yeah,found the issue.

ChangeLog Version 5

New blocks
Normally should not be used


  • Removed redundant barFormat param from DecodeBarCode method
  • Added barFormat param in BarCodeDecoded event

Bug Fixes

  • Fixed assets logo issue in GenerateBarCode method
    Thanks to @Patryk_F for reporting bug

Download Link: com.sunny.qr.aix (15.1 KB)

1 Like

Hi. Could you inform what level of error correction this extension uses? Maybe this value can also be added to the QR generation block?

Ok, According to the information found, I decoded the correction value. It is L.

The extension does not use hints while generating bar so it means L is the default value of error correction level.

Sure, I shall check.

I think this is necessary because it is impossible to decode QR with little text and logo. There is not enough recovery data to rebuild some of the code obscured by the logo.

a procedure that will automatically determine the size of the QR code depending on the data, so that the QR code always fills the entire image. This will work with "Numbers and Capital Letters" 0-9 and A-Z data. For other types, you need to change the CSV text.

It would be a good idea to automate this in the extension and only specify the size of one module in pixels.

Hi vknow360,
Thank you for the extension, it seems very nice.
I'm trying to add it to an app I'm doing but I'm not sure if it's possible.
Basically what I want to do is that the user has the possibility to be normal or VIP member. And to be VIP they have to enter a password in the app. Then, I want the app to generate a QR that, when scanned, tells if the user is member or VIP.
Do you think this is possible with this extension or with another extension you know?