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

hdtvirl

Active Member
Licensed User
Longtime User
Google Googles

I have just tried with this too and it also works. It is very fast and works with both standard bardcodes and QR Codes. I have not tried it with any pictures.

Regards

BOB
 

domv

Member
Licensed User
Longtime User
ABZxing barcode example error (Noob Warning)

I dl'ed the example ABBarcodeTest and when trying to run am getting the error:

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

Sorry in advance if this is a stupid question.

Thanks
 

NJDude

Expert
Licensed User
Longtime User
I dl'ed the example ABBarcodeTest and when trying to run am getting the error:

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

Sorry in advance if this is a stupid question.

Thanks

Did you install the ABZxing library?
 

domv

Member
Licensed User
Longtime User
Install Library -- can't find it

Sorry but I looked for the library in the IDE and couldn't find it.

thanks
 

gehrlekrona

Member
Licensed User
Longtime User
ShopSavvy

I have ShopSavvy Installed so whenever I try to scan something, ShopSavvy starts and I don't want that. What can I do? I have tried to uninstall ShopSavvy but it's like a virus. Won't uninstall.
 

gehrlekrona

Member
Licensed User
Longtime User
ZXing

Hi, finally got rid of ShopSavvy and now I just have Zxing.
Anybody know of some FREE TTF for creating bar codes?
 

afagcaoili

Member
Licensed User
Longtime User
Option to use QuickMark as default instead of ZXing

This library is awesome!

Just a request. When a barcode scanner is not available it automatically points you to download ZXing barcode scanner. Is there any way I can select QuickMark as the default barcode scanner to download instead? Quickmark is better for my purposes.

Thanks.

Arnold
 

gianfranco

Member
Licensed User
Longtime User
ABZxing library problem

I'm using ABZxing library.
When i receive the code(RQ), I receive olso special caracter.
It seem be CRLF, but with replace method it not clear.

C
How can i replace this character?

Regards
Gian
 

tcpip

Member
Licensed User
Longtime User
scan question

Hello,

i added this to a program i`m making and when you push scan button goes to scanner. When you scan something it says Found Product and then the screen close and goes back to my program. But it seems that its going to Sub Activity_Create and the activity loaded again from the beginning and not resume from there it was...

Is there any way that i can scan something and then my program resume from there it was???

thanks in advance
 

lm9999

New Member
Licensed User
Longtime User
Hello,

i added this to a program i`m making and when you push scan button goes to scanner. When you scan something it says Found Product and then the screen close and goes back to my program. But it seems that its going to Sub Activity_Create and the activity loaded again from the beginning and not resume from there it was...

Is there any way that i can scan something and then my program resume from there it was???

thanks in advance

I sporadically have the same problem with Activity_Create being called when returning from the Scan call. I would say it does this 10% of the time. I thought at first it was related to the amount of time it took to scan, but I can set it down for 5 minutes and come back and scan and it will return to my app with no activity_create being called, other times it will occur even if I scan immediately ... not sure why.

For now, I use File to create a file before a scan starts and then delete that file after the scan result comes back good. I modified activity_create to check for the existence of this file and to display an error and redo the scan. It would be ideal if we could store the scan results in a file before returning, and read that if activity_create gets called (to avoid a rescan). My experience is that the scan results are lost when activity_create get called on the return, is that yours?
 

tcpip

Member
Licensed User
Longtime User
I sporadically have the same problem with Activity_Create being called when returning from the Scan call. I would say it does this 10% of the time. I thought at first it was related to the amount of time it took to scan, but I can set it down for 5 minutes and come back and scan and it will return to my app with no activity_create being called, other times it will occur even if I scan immediately ... not sure why.

For now, I use File to create a file before a scan starts and then delete that file after the scan result comes back good. I modified activity_create to check for the existence of this file and to display an error and redo the scan. It would be ideal if we could store the scan results in a file before returning, and read that if activity_create gets called (to avoid a rescan). My experience is that the scan results are lost when activity_create get called on the return, is that yours?

thanks for the answer.
Its is doing that 100% of the times i scan...
and yes, the scan results are lost when activity create called...
 

lm9999

New Member
Licensed User
Longtime User
thanks for the answer.
Its is doing that 100% of the times i scan...
and yes, the scan results are lost when activity create called...

Have you tested using other devices? Also, are you using the demo program (ABBarcodeTest.zip) to test?

I haven't done much with services, but I'm about to try making the scan intent call to zxing using that (if its possible). I believe that is frowned upon though.
 

Evadman

Member
Licensed User
Longtime User
As a note, the documentation in the first post and in the documentation here state the method is 'ABBarcodeGet', when it is actually 'ABGetBarcode'. Awesome job on the library!
 

GFx

New Member
Licensed User
Longtime User
Library Extension to create QR Code

Is it possible for the ABZxing library written by Alain Bailleul to be extended to allow for the creation of QR Codes locally? Or is there some other library/code interface that could be used with B4A to generate a QR Code in the application? The ZXing Project seems to indicate that their code has the capability. Since I don't know Java, then what may be possible is beyond my understanding.

Currently, I'm using Google charts to create a QR Code for in-app display, but when there is no data connection, then there is no QR Code.
 
Top