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: 6,236
  • ABBarcodeTest.zip
    5.7 KB · Views: 5,270
Last edited:

mistermentality

Active 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.

Brilliant, thank you! I have an app from app inventor I want to rewrite in B4A and wondered how I would achieve the bar code scanning part of it and you've solved that issue before I even begin working on the rewrite :)

Dave
 

Pfriemler

Member
Licensed User
Longtime User
Read barcodes "modal"?

Great Job! Very simple to use.

Did anyone thought about turning this into some modal dialog? Handling the results in a different sub is not so convenient. I would prefer something modal SUB (like Andrew Grahams DialogInput), which should return a barcode instead of a keyboard entry, enabling the program to wait at a specific point for the input.

I use "Barcode Keyboard Demo" from the AnroidMarket. It includes a button to call then ZXing barcode scanner, the result comes as if it was typed on the keyboard. Great, but I don't like the rest of the keyboard :(

My next job is: collecting barcodes from an external (bluetooth) device. Easy to achieve with the serials lib, but the same: better modal.

Any hints are welcome!
 

manios

Active Member
Licensed User
Longtime User
Works great!
Does even read very small barcodes very fast.
 

scoty6v

New Member
Licensed User
Longtime User
Problems with using the lib

Hello,
I've registerd me today to download and install this LIB. I copy it in the standard-dictionary but always have the same errormessage:

Compiling code. Error
Error parsing program.
Error description: Unknown type: abzxing
Are you missing a library reference?
Occurred on line: 14
Dim myABBarcode As ABZxing


Is there anything to do more? I've tried to compile the Example.
 

netchicken

Active Member
Licensed User
Longtime User
Thanks for the barcode scanner, it works great.

It returns the bar code number, how can you get it to return the product? I see that I can stick the number into google and it will access online db's of codes, is there a procedure to do this automatically?
 

hdtvirl

Active Member
Licensed User
Longtime User
Problem with AZXING Libraries.

I too have tried it out and it works to a point, when I scan for the first time everything is perfect and it returns the scanned data and the barcode format the next time I run it, it brings up the zxing scanner but the images appears to be split diagonally and bot halves move out of phase with each other so it is very difficult to line them up and get a scan. I get the same results (Split Image) using both the QuickMarks and the ZXING scanners

I was wondering if the jar and xml files are compatible with Android 3.2 running on a Acer Iconia or are there newer libraries and if so where can I get them ?.

Also is there any way of just getting the scanner rectangle rather than the complete screen being filled with the camera image (this is just a small thing).

Thanks for the libraries.

Regards

BOB
 

magarcan

Active Member
Licensed User
Longtime User
I wrote a QuickMark library for Basic4ppc and looked at both Zxing and QuickMark for Basic4android and noticed they both accept the same Intents so I tried it, and sure enough it worked.
Does Google Google is also supported??

Are there any way to avoid having to install any external software like Zxing or QuickMark??
 
Top