Hello All,
I also have a problem with displaying QR code. I get message that “barcode generated successfully” but it does not display the code. I am a noob to app making so maybe there is some logical issue in my block design; was wondering if you could help me out. Here with block design.
Prefix file://
to file path while setting Image.Picture().
Thanks for quick response but I already tried that before.
Did it again and still not showing up the QR
Print value of filePath
on a label. Lets see what it gives.
Changed it and what I get is three different messages, each time I press button1 message is changing to accordingly:
- “Attempt to invoke virtual method ‘int android.graphics.Bitmap.getWidth()’ on a null object reference”
- “/storage/emulated/0/Android/data/io.makeroid.companion/files/qr.png”
- “SAMSUNG_SM-G988B_108GB”
Still no QR is shown.
You are calling DecodeBarCode
method just after generating bar code. Sometimes it is called in-between of bar code generation so you get message 1.
If it is called after generation then you get message 3.
This confirms that bar code is generated indeed. You can verify it from File Manager.
Why Image component can’t show this image should not be concern of this extension.
Maybe try to replicate same in AI2 and find what happens.
That’s it from my end.
I changed file path to /storage/self/primary/Pictures/qr.png and I can find the .png file with QR correctly generated in file manager. Still can’t understand why it does not display on screen.
Tried different approach too as below but that doesn’t work either:
That’s a strange path… try
/storage/emulated/0/Pictures/qr.png
Taifun
hi Taifun,
Thanks for checking it, but also not a solution.
I tried your extension too but still the QR code .png file is not displayed:
I can successfully browse for the file using ADB File explorer (it shows different location though):
after building the app obviously the path to the ASD is different
use the BarCodeGenerated event to check the response and file Path there
Taifun
So changed it again to BarCodeGenerated event :
In Label4.Text file path is : /storage/emulated/0/Android/data/io.kodular/files/qr.png
But still no QR being displayed
This is not even a valid path.
Why don’t you just put /storage/emulated/0/Pictures/qr.png
?
Seems like there is a problem when I run the app on Samsung phones but when I run it on Google Pixel than all works correctly. Don’t know why is this an issue but at least the QR’s are working (sort of) on some devices.