B4A Library CRZXing v2 - encode/decode barcodes using a bitmap

CRZXing is a Java library for decoding barcodes from a bitmap image rather than from an image taken with the camera.

This library is based on the ZXing library from Google.

The attached zip file includes a B4A test app (built with B4A version 3.82) and the wrapper XML, jar, and source code. The wrapper was built using the Simple Library Compiler from Anywhere Software.

I have used a specific version of the ZXing library, 3.1.0. You need to download two ZXing jar files, core-3.1.0.jar and javase-3.1.0.jar.

These two jar files can be found at the ZXing website at: http://repo1.maven.org/maven2/com/google/zxing/

B4A Test App:



The test app shows three types of barcodes, a UPC/EAN barcode, a Code39 text barcode (notice the "!" is encoded as "/A" by ZXing), and a Darth Vader barcode that returns null to indicate decode failure.

I haven't tested, but I would guess that this library also works with B4J since it is pure Java. Also not tested is decoding QR codes, but I would expect it to work.

Barry.
 

Attachments

  • CRZXing.zip
    52.7 KB · Views: 668

canalrun

Well-Known Member
Licensed User
Longtime User
CRZXing is a Java library for decoding barcodes from a bitmap image rather than from an image taken with the camera.
CRZXing2 adds barcode encoding, returning a bitmap.

This library is based on the ZXing library from Google.

The attached zip file includes a B4A test app (built with B4A version 3.82) and the wrapper XML, jar, and source code. The wrapper was built using the Simple Library Compiler from Anywhere Software.

I have used a specific version of the ZXing library, 3.1.0. You need to download two ZXing jar files, core-3.1.0.jar and javase-3.1.0.jar.

These two jar files can be found at the ZXing website at: http://repo1.maven.org/maven2/com/google/zxing/

B4A Test App:



The test app shows examples of encoding UPC_A, QR Code, and a nonsense barcode format to demonstrate how errors can be detected.

The B4A code completion function shows the available barcode formats for encoding.

Barry.
 

Attachments

  • CRZXing2.zip
    77.9 KB · Views: 615
Last edited:

OMS

Member
Hi,
I seems great!
how can we use it with Camera2 library? would you please give a short sample code snippet that show how to send pre-view panel background to crzx.decodeBitmap function?

Or more, can we make some changes in java code to accept byte array from : Camera1_Preview (Data() As Byte) ?
 
Last edited:

OMS

Member
Hello,
This looks great!
I wish I know java.
May I ask you please supply an snippet code to show how can I use camera2 library to send a rectangle of preview byte data() to the barcode decoder function?
 

Johan Schoeman

Expert
Licensed User
Longtime User
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…