B4A Library 1D and 2D Barcode Scanner with ZXING - another Barcode Scanner that is 100% embedded in B4A

Johan Schoeman

Expert
Licensed User
Longtime User
This is an update for this library. It will allow you to automatically scan normal color barcodes (ie white background with black modules) or inverted color barcodes (ie black background with white modules). All done within the library so no additional code required in the B4A project.

See post #1 (point 3) of this thread for the other library files that are required.

You can download and test it but if you want to use it you need to




 

Attachments

  • b4aZxingBarcodeScanner07052016.zip
    11.3 KB · Views: 543
  • b4aZxingBarcodeScannerLibFiles.zip
    29.7 KB · Views: 616

nhz

Member
Licensed User
Longtime User
Hi, any way to trigger the sound effect for successful scan?
 

iStef

Member
Licensed User
Hi, I am having problems with this library and Android 7. Everything works fine on Android 5 and 6, but on Android 7 my app can't detect any barcode. The image looks bad (probably it's in low resolution or something similar) and barcode is not read. Any hint? Thanks in advance.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan, that library works fine on Android 7. Since I'd prefer to use this one (I mean, the one you posted in this thread), do you think we have a chance to make it working on Android 7 too? Thanks for your help.

I will look into it and try to establish how the two wraps differ in terms of setting the focus. I do know that each of them has their own CameraManager code and I will have to investigate. If I do find a solution I will post it - but will need some time. We have had a massive rainstorm in Durban earlier today and my factory is severely impacted due to wind and rain damage. So it gets highest priority at present....
 

iStef

Member
Licensed User

Take your time Johan. I hope everything will be fine in Durban soon. Please let me know when you find a solution or even if you don't/can't find it. I appreciate your help, thank you.
 

hongbii khaw

Member
Licensed User
Longtime User
Hi,
What can i do if i get this error?

B4X:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Connected
LAN
android.content.res.Resources$NotFoundException: Resource ID #0x0
    at android.content.res.Resources.getValue(Resources.java:1369)
    at android.content.res.MiuiResources.getValue(MiuiResources.java:145)
    at android.content.res.Resources.getColor(Resources.java:981)
    at android.content.res.Resources.getColor(Resources.java:954)
    at main.java.me.dm7.barcodescanner.core.ViewFinderView.<init>(ViewFinderView.java:39)
    at main.java.me.dm7.barcodescanner.core.BarcodeScannerView.createViewFinderView(BarcodeScannerView.java:57)
    at main.java.me.dm7.barcodescanner.core.BarcodeScannerView.setupLayout(BarcodeScannerView.java:40)
    at main.java.me.dm7.barcodescanner.core.BarcodeScannerView.setupCameraPreview(BarcodeScannerView.java:70)
    at main.java.me.dm7.barcodescanner.core.CameraHandlerThread$1$1.run(CameraHandlerThread.java:31)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5438)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
 

Johan Schoeman

Expert
Licensed User
Longtime User
Take note of what I have posted in post #1 of this thread....the files need to be set to READ ONLY else they will be deleted when you compile your B4A project.
Please take note of the xml files in the /Objects/res/layout and Objects/res/values folders of the B4A project should you start a new project from scratch.
 

iStef

Member
Licensed User

Hi Johan, any news about compatibility to Android 7?
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan, any news about compatibility to Android 7?
There are 5 focus modes in the library:
FOCUS_MODE_AUTO
FOCUS_MODE_CONTINUOUS_PICTURE
FOCUS_MODE_CONTINUOUS_VIDEO
FOCUS_MODE_MACRO
FOCUS_MODE_INFINITY

I have just tested it on an Android 7 device with.....
B4X:
zx1.AutoFocusInterval = 2000
zx1.FocusMode = zx1.FOCUS_MODE_AUTO
....and it seems to be working fine.
 

iStef

Member
Licensed User

Hi Johan,

I was already using FOCUS_MODE_AUTO. Now I also added AutoFocusInterval = 2000, but it still does not work (see attached image). Tested on two different Android 7 devices (Honor 8 and Huawei P9 Lite).

The same app works just fine on Android 6. Also, the other library works fine, but I don't like it very much and I'd prefer to use yours.

Do you have any other suggestion or test I could do to understand what the problem is?

Thank you for your help.
 

Attachments

  • NoFocus.jpg
    39.2 KB · Views: 266

iStef

Member
Licensed User
Hi Johan, after further investigation and tests with several devices, it turned out that the problem is not Android 7 itself, but Android 7 running on Huawei or Honor devices. We haven't tested with any possible device of course, but so far the library worked fine on any Android 7 device except for Huawei or Honor (which, as you know, share the same interface, called EMUI). Notice the library worked fine on Huawei running Android 6.

Does this help you to better understand what could be the issue? Thank you.
 

Johan Schoeman

Expert
Licensed User
Longtime User
I will have to read up (Google) on the focus issues of those devices.
 

jaraiza

Active Member
Licensed User
Longtime User
Hi,

I've downloaded the different versions published in this post, and I've an issue...

If I use version 1.00 I have an annoying default sound when the image has been successfully scanned (there's no option to turn it off)
If I user version 1.04 the sound is removed, but I lose LowerLuxLimit, UpperLuxLimit, AutoTorchMode and AmbientLightLux.

Is there any version with the latest properties available, but no sound? (Or an option to disable it)

I have problems with some images without light management properties

Thanks!
 

Johan Schoeman

Expert
Licensed User
Longtime User
Last update of the lib and sample project is in post #41.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…