B4A Library AwesomeQRCode

A (partly) wrap for this Github project.

Sure you will know what to do with the attached files (eg jar's and xml's). Also posting the Java code for whoever wants to do anything else with it.

screen.png


screen1.png



screen2.png


Sample Code:
B4X:
#Region  Project Attributes
    #ApplicationLabel: b4aAwesomeQRCode_1
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

'#AdditionalRes: ..\DemoRes
#AdditionalRes: ..\LibRes
#AdditionalRes: ..\resource

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
   
    Dim aqrc As AwesomeQRCode_1
    Dim bm, bm1 As Bitmap

    Private ImageView1 As ImageView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
   
    bm.Initialize(File.DirAssets, "1.jpg")
    bm1.Initialize(File.DirAssets, "b4a.png")
   
    aqrc.Initialize("")
    aqrc.autoColor(False)
    aqrc.contents("https://www.b4x.com/android/forum/")
   
    aqrc.background(bm)
   
    aqrc.dotScale(0.8)
   

    aqrc.logoScale(0.35)
    aqrc.logoMargin(20)
    aqrc.logoRadius(10)
'    aqrc.logo(bm1)
   
    aqrc.binarizeThreshold(128)
    aqrc.binarize(False)
   
    aqrc.colorDark(Colors.Black)
    aqrc.colorLight(Colors.Transparent)
   
    aqrc.margin(30)
   
    aqrc.roundedDots(False)
   
    aqrc.whiteMargin(True)

    ImageView1.Bitmap = aqrc.render
   

End Sub

Sub Activity_Resume
   

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

Attachments

  • JavaCode.zip
    7.8 KB · Views: 406
  • b4aLibFiles.zip
    10.7 KB · Views: 510
  • b4aAwesomeQRCode_1.zip
    15.1 KB · Views: 456
  • core-3.2.1.zip
    483.9 KB · Views: 469

Johan Schoeman

Expert
Licensed User
Longtime User
You are impressive ...
No, the persons that wrote the original code is the impressive one. I have only done a small wrapper for that person's code....
 

DeviousD

Member
Licensed User
Longtime User
HI Johan,
is there anything I'm missing, used your standard project and tried to scan the default QRcode and its not working. I mean it displays on the APP, taking another phone with a hires camera does not recognise it.
otherwise Lekker contribution
dankie vir die hulp.
 

Johan Schoeman

Expert
Licensed User
Longtime User
HI Johan,
is there anything I'm missing, used your standard project and tried to scan the default QRcode and its not working. I mean it displays on the APP, taking another phone with a hires camera does not recognise it.
otherwise Lekker contribution
dankie vir die hulp.
My device scan all 3 of the QR codes in post #1.....
The scan result is:
 
Top