B4A Library ABZxing Barcode reader

This is a library to read barcodes. It uses the Zxing app to do the scanning. If the Zxing app is not installed, the user is redirected to the Android market to download the app.

Functions:

ABGetBarcode (eventName as String, mode as String)

Starts the barcode scanner. The barcode is returned in the BarcodeFound event or the Canceled event

Params:
eventName (String): name of the ABBarcode object (lowercase!)
mode (String):
"" for everything
"QR_CODE_TYPES" for QR codes
"PRODUCT_CODE_TYPES" for UPC_A,UPC_E,EAN_8,EAN_13
"ONE_D_CODE_TYPES" for UPC_A,UPC_E,EAN_8,EAN_13,CODE_39,CODE_93,CODE_128

Example:

B4X:
Sub Button1_Click
    myABBarcode.ABBarcodeGet("myABBarcode", "QR_CODE_TYPES")
End Sub

Sub myABBarcode_BarcodeFound(barCode as String, formatName as String)
    msgbox(barCode, "")
End Sub

Sub myABBarcode_Canceled
    msgbox("Canceled","")
End Sub
 

Attachments

  • ABZxing.zip
    6 KB · Views: 5,809
  • ABBarcodeTest.zip
    5.7 KB · Views: 4,917
Last edited:

RichyK68

Active Member
Licensed User
Longtime User
I've found that this scanner doesn't work on Lollipop. The first time you call it, it behaves fine, the second time that ABGetBarcode is called B4A just drops out. I've try-catched it but it makes no difference, my app just dies a death without any error messages. Any chance of a fix? Or an alternative solution?

Richard
 

Alex_197

Well-Known Member
Licensed User
Longtime User
This is a library to read barcodes. It uses the Zxing app to do the scanning. If the Zxing app is not installed, the user is redirected to the Android market to download the app.

Functions:

ABGetBarcode (eventName as String, mode as String)

Starts the barcode scanner. The barcode is returned in the BarcodeFound event or the Canceled event

Params:
eventName (String): name of the ABBarcode object (lowercase!)
mode (String):
"" for everything
"QR_CODE_TYPES" for QR codes
"PRODUCT_CODE_TYPES" for UPC_A,UPC_E,EAN_8,EAN_13
"ONE_D_CODE_TYPES" for UPC_A,UPC_E,EAN_8,EAN_13,CODE_39,CODE_93,CODE_128

Example:

B4X:
Sub Button1_Click
    myABBarcode.ABBarcodeGet("myABBarcode", "QR_CODE_TYPES")
End Sub

Sub myABBarcode_BarcodeFound(barCode as String, formatName as String)
    msgbox(barCode, "")
End Sub

Sub myABBarcode_Canceled
    msgbox("Canceled","")
End Sub


It works nice.

Thank you:)
 

MarkusR

Well-Known Member
Licensed User
Longtime User
thank you alwaysbusy
i tested it today and it still works :)
its a good way to use this installed ZXing app as barcode reader because its a very big project.
a short while ago i saw someone use it that way at QPython3 at android phone with minimal amount of rows :)
 
Top