Qr : Read and Create Qr/Bar Code offline


Recently there were some topics(on Kodular Community) about generating qr code offline and storing on device and I got inspiration/idea to create Qr extension.
Don’t go on name…it is not only related to Qr Code but also to Bar Code.It can generate and read Qr Code and Bar Code when you are offline besides when you are online.
Latest Version: 5.1
Last Updated: 2021-06-23T18:30:00Z




Just 3 method and 2 event blocks


A short documentation for the extension-

Creates BarCode and raises event 'BarCodeGenerated' with response and filepath
Note: File Path should be absolute like /storage/sdcard/qr.png


Decodes BarCode and raises event 'BarCodeDecoded' with result


Returns a list of supported Bar code formats which can be either decoded or encoded


Aix can be found here:

Thank you :heart:


Thank you. However:

unlisted until corrected…


Hi! I've almost got this working I think. The block of code below prints a "file not found" error into the text box. Do you know what I'm missing?

use Do it to debug your blocks, see also tip 4 here https://puravidaapps.com/learn.php
see also Live Development, Testing, and Debugging Tools

Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

Hi @ZonaKyle Welcome
Probably because file you want to decode does not exists.
Be sure to check if it exists or not before decoding.
Also you can find latest version here:

ChangeLog Version 4


  • Added logoPath parameter in GenerateBarCode method
  • Changed package name to com.sunny.qr from com.sunny.Qr
  • The extension does not ask for any permission and uses absolute file paths

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

Note: Still you will have to additionally use a BarcodeScanner component

Credits: I am thankful to @Ayoub_Dev for the source of QrLogo extension.

1 Like

Testing this in companion, I get a list of formats:

["AZTEC", "CODABAR", "CODE_39", "CODE_93", 
"CODE_128", "DATA_MATRIX", "EAN_8", "EAN_13", 
"ITF", "MAXICODE", "PDF_417", "QR_CODE", 
"RSS_14", "RSS_EXPANDED", "UPC_A", "UPC_E", 

However, only QR_CODE and PDF_417 generate an image/code.

Is there are reason for this?

(tested on Android 10 and Android 11 devices)

That's a list of formats which can be either encoded or decoded (some formats support both).

CODE_39 should also work.

Unfortunately Code_39 does not work either

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.