B4A Library QR Code Library

DonManfred

Expert
Licensed User
Longtime User
Could you tell me please, is this the wrong version of Java or something else going wrong?
Based on the error you got your try-catch-block is too big
shell\src\QRCP\V4\qrcode_subs_0.java:4105: error: code too large for try statement

Use smaller try-catch-blocks
 

Boen TP

New Member
Licensed User
Hi Everyone,
I am not sure whether I am posting to the right thread, but it seems that I can't find any thread mentioning QRCode in B4i forums.
Are there any libraries similar to this one for B4i ?

Thanks.
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Johan,

B4X:
 QRcode.Draw_QR_Code(StringToDisplay,err,mask_pattern,back_color,fore_color,shape)

The above code generates an exception for Android 8+ unless, unless we ask for permission for write to external storage.
Is there a way to use the above code with: GetSafeDirDefaultExternal

Thanks
iCAB
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User

Johan Schoeman

Expert
Licensed User
Longtime User

 

carlos7000

Well-Known Member
Licensed User
Longtime User
Hi Johan Shoeman

I already tried both suggestions.

The first suggestion works, but if the data is more than 78 bytes long, it fails.

B4X:
    Dim Bytes() As Byte = Text.GetBytes("utf8") 'non-standard but still recommended
    If Bytes.Length > 78 Then
        Log("Too long!")
        Return Null
    End If

the second option has not worked for me. install all the libraries, I move one or another thing. it just gives me errors. every time the compiler always says something is missing. I am looking for something simple as the first suggestion.
 

Johan Schoeman

Expert
Licensed User
Longtime User
What is the error that you get with option 2? Can you post the error?
 

carlos7000

Well-Known Member
Licensed User
Longtime User
What is the error that you get with option 2? Can you post the error?

Download the project again, I compiled it, and only a couple of little bugs appeared.

Change the targetSdkVersion to 28, and delete the line:

B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")

Compiled well.

I'm going to see if I can integrate the qrcode in my application.

Thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…