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,847
  • ABBarcodeTest.zip
    5.7 KB · Views: 4,947
Last edited:

zsezo

Member
Licensed User
Longtime User
Hello, I just wanna to ask somebody the Cancelled event when will be fired? I created an app, with continuous barcode reading. I'd like to terminate with the Cancelled event, but the cancelled event never fired for me. What can I miss or how can I catch the back button.
ABZxing (version 1.00)

Tested on: Galaxy Y (2.2), Galaxy S3 (4.2.2), Galaxy S4 (4.2.2)

o_O:mad::confused: Any idea? o_O:mad::confused:

TIA!

UPDATE! Oh my bad! I wrote Cancelled instead of Canceled... :)
 
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?
 

NJDude

Expert
Licensed User
Longtime User
This library can be used to read PDF417 barcodes, you have to check them in the ZXing app, under settings (assuming you have the latest version)
 

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: 170

LucaMs

Expert
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


ABZxing requires that the users has Zxing OR QuickMark app installed on their device.

You could try ZXingLib
 

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
 

LucaMs

Expert
Licensed User
Longtime User
Install QuickMark or Zxing from Google Play.

But using ZXingLib you would not need it.
 

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
 

LucaMs

Expert
Licensed User
Longtime User
I don't know, sorry.

I would uninstall ZXing and would install QuickMark. If this does not work, I would use ZXingLib, which can scare less the user, since it does not require additional installations and permissions.
 

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