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

Sannie72

Member
Licensed User
Longtime User
J

...and would it be possible to allow another property zx.thePromptTextStyle? So I can change the text style from always italic to something else...
Would be nice
 

Johan Schoeman

Expert
Licensed User
Longtime User
J
...and would it be possible to allow another property zx.thePromptTextStyle? So I can change the text style from always italic to something else...
Would be nice
See new lib files and project posted here. Copy/replace them in your additional libraries folder. It will allow you to set the "Italic skewness" of the top and bottom text messages individually. A value of zero will apply no skewness to the text. A (+) value = text slants to the left. A (-) value = text slants to the right.
See code below.
B4X:
    zx.textSkewnessTop = 0.25
zx.textSkewnessBottom = 0.0

 

Attachments

  • JhsIceZxing1.zip
    413.7 KB · Views: 484
  • b4aTextSkewness.zip
    430.4 KB · Views: 469
Last edited:

John Decowski

Member
Licensed User
Longtime User
This is great exactly what I was looking for! In the next week or two I am going to post my code for QR code generating.
 

Johan Schoeman

Expert
Licensed User
Longtime User

joilts

Member
Licensed User
Longtime User
Johan, see if you can help me on this. I´m using your lib to read QRCodes and it works fine. I´m also using in the same app, cameraExClass to take pictures. After open the camera for pictures, the first time I call ZXingLib, it opens but the camera gets no image. After timeout, if I open it again, everything works right. Any idea why this happens?

Thanks in advance,
Jorge

UPDATE: Thanks for your time and attention. I found that calling CAMEX.CloseNow immediately release the camera and I was able to use ZXingLib correct.
 
Last edited:

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Johan

First let me thank you for the great work you have done in here.
As I read through this forum there are many releases, can you please post the latest version of the library to POST#1, so it will be easier to find

Thank you
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan

First let me thank you for the great work you have done in here.
As I read through this forum there are many releases, can you please post the latest version of the library to POST#1, so it will be easier to find

Thank you
The library files in post #62 above
 

Fernando Melo

Member
Licensed User
Longtime User
Hi Johan,

congratulations for your great job. I am testing your library, but sometimes, can be a little slow to recognize the bar code. Its possible to choose the format we want? This will improve somehow the recognition?

Thanks.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan,

congratulations for your great job. I am testing your library, but sometimes, can be a little slow to recognize the bar code. Its possible to choose the format we want? This will improve somehow the recognition?

Thanks.
It think it can be done. I will try to amend the code sometime this coming weekend and then post the new library files if the change is successful.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan,

congratulations for your great job. I am testing your library, but sometimes, can be a little slow to recognize the bar code. Its possible to choose the format we want? This will improve somehow the recognition?

Thanks.
Not too sure if this is going to improve the speed of recognition (test and let me know) but it allows you to pass in the categories of barcodes to scan that are supported by class DecodeFormatManager in the ZXING project that have been wrapped:

B4X:
'START OF ADDED 7 NOVEMBER 2015:
'   Specify the bar code formats to scan
'   If not specified then all code formats will be scanned
'   Specify one of the following: PRODUCT_FORMATS, ONE_D_FORMATS, QR_CODE_FORMATS, DATA_MATRIX_FORMATS, AZTEC_FORMATS, PDF_417_FORMATS, TWO_D_FORMATS
'   PRODUCT_FORMATS are the following: UPC A, UPC E, EAN 13, EAN 8, RSS 14
'   ONE_D_FORMATS are all the PRODUCT FORMATS plus the following: CODE 39, CODE 93, CODE 128, ITF
'   TWO_D_FORMATS are the following: QR CODE, DATA MATRIX, AZTEC CODE, PDF 417

    'COMMENT THE BELOW LINE OR USE zx.ScanMode = "" to scan all the 1D and 2D type barcodes that this version of the ZXING library supports
    zx.ScanMode = "ONE_D_FORMATS"   
            
    'END OF ADDED 7 NOVEMBER 2015
   
    zx.BeginScan("myzx")

Attached the new library files and the B4A project.
 

Attachments

  • b4aZXING.zip
    11.9 KB · Views: 350
  • JhsIceZxing1LibFiles.zip
    414.3 KB · Views: 361

Johan Schoeman

Expert
Licensed User
Longtime User
The attached library files should (theoretically) speed up the process but I am of the opinion that speed of recognition has a lot to do with the autofocus capability of a device so that the code can recognise the barcode being scanned. Use the attached library files with the project in Post #74 above (replace your library files with the attached library files).

There is a slight change in the B4A code. Sure you will figure it out...

B4X:
    zx.ScanMode = zx.FORMATS_ONE_D

Also posting the Java Code.
 

Attachments

  • JhsIceZxing1LibFilesNew.zip
    414.8 KB · Views: 386
  • src9.zip
    472.3 KB · Views: 362
Last edited:

Fernando Melo

Member
Licensed User
Longtime User
thanks for your effort but you are right. It has to do with autofocus capability.
 

corradotisi

Member
Licensed User
Longtime User
Hi Johan,
the B4aZing example, after 2 or 3 serial barcode reading, crash main module without any messages. I'm on a Samsung android 5
thanks
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan,
the B4aZing example, after 2 or 3 serial barcode reading, crash main module without any messages. I'm on a Samsung android 5
thanks
I don't have an Android 5 device so cannot debug it at present. See if the one at the below link will work better on Android 5. As far as I understand it already makes provision for at least Android 5. Work through the thread to get the latest version of this posting

https://www.b4x.com/android/forum/t...ew-lib-files-in-post-26-for-datamatrix.60155/

Please try QRCP4 too and let me know if it behaves the same. You can find it here

https://www.b4x.com/android/forum/threads/qr-code-library.41408/#post-259448
 
Last edited:

Kurt McCullum

Member
Licensed User
I've found what I think may be a bug with this library. I'm using a Nexus 7 tablet which doesn't have a torch. When scanning a barcode, if I tap anywhere on the screen the application fails. The error message seems indicate that the error due to myTorchParametersOn. Is there anyway to disable this feature for those phones or tables that don't have a torch?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…