B4A Library ZXingLib by icefairy333 - modified by Johan Schoeman (Scan QR Codes and other 1D/2D Barcodes)

DonManfred

Expert
Licensed User
Longtime User
Can you guide me to add those permissions?
 

joe.dai

Member

Erel :
thank you ! runtime-permissions add is ok , Worked
but scan qrcode chinese result is garbled ,
how to fix mistakes ? Thanks for your help.

 

hatzisn

Expert
Licensed User
Longtime User
Maybe it is UTF-8 codes read wrong so you could write something like the following code:

B4X:
    Dim s As String
    's = QRCodeResult
    Dim b() As Byte
    b = s.GetBytes("ASCII")
    s = BytesToString(b,0,b.Length, "UTF8")
 

joe.dai

Member

hi hatzisn

not work !! thanks
 

ivan.tellez

Active Member
Licensed User
Longtime User
how to fix mistakes ?

No QR sample, No actual content of the scan result. no comparison with what is scanned with another app... It is a guessing contest?

You can try to debug and see what is the binary content of the result and work from there.
 

joe.dai

Member
No QR sample, No actual content of the scan result. no comparison with what is scanned with another app... It is a guessing contest?

You can try to debug and see what is the binary content of the result and work from there.

i change new library is ok !!

thanks all
 

loonet

Member
Licensed User
Thanks Johan Schoeman for yoyr great job.
Using the libraries 1.05 and 1.06 I obtain the following exception when scanning a Qr code or every normal barcode.
How can I solve it ?

Is it possible to send the scan result to a EditText positioned on the same activity of the scan button ?

 

DonManfred

Expert
Licensed User
Longtime User
How can I solve it ?
1. You should NEVER post to existing threads. Always create a new thread in the questionsforum for any question/issue you have.
2. You should post errors as TEXT (right click to copy)
3. You need to provide more informations. As the error is telling about a wrong event_signature. But you are giving ZERO Info how your code looks like. Especially the Event_signature
 
Hello Johan


First, I apologize for my English. I just signed up for the B4X Programming Forum and I don't know if I'm contacting you correctly (I couldn't find your email address).


I did tests with your example of QrCode detection and liked the result. I made a donation through PayPal (Transaction ID: 7SR3134370589415D) and would like to know how to remove protection to use it in a personal use application.


Congratulations for your work and for the interaction with the other members.


Thanks.
 

OMS

Member
Hi Johan,

First of all thank you so much for your excellent ZXing library — it’s one of the most popular and reliable barcode scanners in the B4A community for years.

I’m working on a project where I need to scan multiple barcodes from a static image (gallery/file) in addition to live camera scanning.
I’ve already managed to add this feature to an older/forked version, but I would really prefer to keep using your latest official version and just add this small enhancement myself.

Would you be kind enough to share the latest source code of jhsicezxing1 (or point me to the GitHub repo if it exists)?

I will only use it to:
• add the image-scanning feature​
• keep all your credits and authorship unchanged​
• publish the modified version here in the forum (as a free updated version for the whole community, with your full name and credit of course)​

Thank you in advance for your time and for all the great work you’ve done for the B4A community!

Best regards,
 

Johan Schoeman

Expert
Licensed User
Longtime User
Will post the source later today. Just past midnight here and now going be be horizontal for a few hours
 

OMS

Member
Hi Johan,

Just a gentle reminder about the source code you kindly offered to post.
No rush at all – just checking if you’ve had a chance yet.
Really appreciate your help and all the great work you’ve done for the community!

Thanks again,
Oliver Mallowes (oms336)
 

Johan Schoeman

Expert
Licensed User
Longtime User
Attached the last version as what I have it...
 

Attachments

  • src.zip
    479.8 KB · Views: 95

Mark Stuart

Well-Known Member
Licensed User
Longtime User
I notice there are a couple of barcode scanning/reading libraries that Johan has published.

I'm wondering which one is a better choice for an app I'm re-building that does an inventory scan count?

The scan must have a very quick scan response of the barcode as there are many items that need to be scanned and counted.
The barcode is a Code 128. It looks like Johans library already reads that type.

When the app is running and using the scanning, will the keyboard still be available to the user?

I probably have more questions, but my requirements are for a very responsive barcode read. Currently, the scanning process in the existing app I built uses an attached HP scanner. It works great but I would like an all-in-one solution that allows the user to have a free hand.

So which library is a better fit?

Regards,
Mark Stuart
 

OMS

Member
Hi Mark,
This library launches a separate activity (opening/closing camera each time), it might not be ideal for fast continuous Code 128 scanning in inventory apps.
Better options for embedded, continuous scanning (camera stays open, keyboard/input fields remain accessible):

1. **Embedded ZXing-based scanners** (like Johan's older ones):
- https://www.b4x.com/android/forum/threads/codescanner-100-embedded-in-b4a.90176/
- Or: https://www.b4x.com/android/forum/t...de-scanner-that-is-100-embedded-in-b4a.63764/
These run in a view/panel, support continuous mode, and you can restrict to 1D formats (including Code 128) for maximum speed.

2. **Google ML Kit / Code Scanner** (often the fastest on modern devices):
- https://www.b4x.com/android/forum/t...n-very-simple-to-use-barcode-scanning.160725/
It's very quick for Code 128 and supports continuous scanning well.
Note: It sometimes has issues on older devices or where Google Play Services aren't fully up-to-date (e.g., regional restrictions), so test it on your target devices.

If you need hands-free scanning while entering other data, the embedded options above are usually the way to go.

Good luck!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…