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:

LucaMs

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

(3 years later :()

Sure, it works. (using QuickMark)

And now, reading this thread for the first time (maybe) i have a doubt (almost a certainty).

This is the first library that I used at the very beginning with B4A. Just because it worked for me with QuickMark, I did not spot the problem: if the user does not have Zxing nor QuickMark? May he use any scanner that has the same data return (Result Intent, it seems to me they are called so in Android), but I can not be certain that they still exist.

Since I have the apk of QuickMark (downloaded from a different site, not from Google Play, so it should not have security keys, is there a way to attach it, when (finally) I will publish my app on Google?
 

Richard Goh

Active Member
Licensed User
Longtime User
Hi,

I downloaded the library and do a test on the program but I got null value return from myABBarcode_BarcodeFound(barCode As String, formatName As String) function. There is a successful scans barcode and barcode added indicator in the scanning screen. But I got null value returned from BarcodeFound function when I click on "Done" button. How can I get the scanned barcode list in my program?
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Ho cercato di usare la biblioteca e l'esempio di leggere il codice a barre, ma non funziona! qualcuno può aiutarmi?
Allego foto della prova.

grazie mille
 

Attachments

  • barcode.png
    barcode.png
    381.7 KB · Views: 261

Roberto P.

Well-Known Member
Licensed User
Longtime User
maybe I do not understand something!? I downloaded the libraries, the demo program and installed the program in my barcode scanner device.
I have to do?
thank you very much
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hello Lucas,
As soon as I launched the demo program, asked me to download the ZXing to read the bar code. the program is launched and the mask appears to read the bar code, but can not read. if I cancel the operation, the message canceled, then it means that the sample program is able to communicate with the reading program.
What's wrong?

thank you very much
 

Mark Thorndyke

Member
Licensed User
Longtime User
Quick hello from a newbie.
Finding this and the article and others linked to QR Code and will be embedding in some more tests in the coming days.
Question though, which has been the best out of Zxing, QuickMark and Google Goggles as the scanner (and embedding).
It quick tests, all seem to work good for me, maybe prefer the scanning of Zxing with line/dots but landscape, hmmm. QuickMark feels more something I like and Google Goggles to me seems maybe the more likely for the end user to have ready on their phone (known product)
 

LucaMs

Expert
Licensed User
Longtime User
QuickMark è praticamente perfetta, ma è un'app vera e propria che va installata sul dispositivo (quando usi ABZxing la cosa è automatica).
Con ZXing devi fare qualche tentativo in più, ma in compenso non necessita di altro.


QuickMark is almost perfect but it should be installed (it is an app; using ABZxing the procedure is automatic).
With ZXing sometimes you need to retry the scanning, but it does not need other.
 

Christopher Brown

Member
Licensed User
Longtime User
ABGetBarCode (as shown below Function) or ABBarcodeGet as listed in example?

(This is the first library I've looked at downloading since registering, so be gentle with me!)
 

Christopher Brown

Member
Licensed User
Longtime User
After a lot of messing around, I've got a rectangle on screen. Has the barcode got to be aligned to that rectangle every single time? Is there no scanner that will pick up any angle to camera?

I can't get my device to do anything. One red line, and an occassional yellow dot and that's it. What happens if it makes a successful scan? (I can't find anything to adjust camera settings to allow autofocus / close setting - but that's probably my PIPO device)
 
Top