B4A Library Barcode Scanner - 100% embedded within B4A (15 Feb 2016 : New library files in Post #105)

krebsi83

Member
Licensed User
Yes exactly, I want to reflect the image back. (Horizontal or vertical). The periscope lens is for better handling... because I want read a lot barcodes and do some interaction on screen after every read.... It's for an electronic ordering system without a laser or ccd barcode scanner.... sorry for my bad english
 

Johan Schoeman

Expert
Licensed User
Longtime User
Sorry, but library as it is at present does not support this option - was never intended to support such an option.
 

Johan Schoeman

Expert
Licensed User
Longtime User
I have updated the B4A library based on recent updates to the original Github project. Posting the new B4A library files. It adds no additional functionality to the B4A code - it is purely an internal library upgrade. It fixes problems that existed when using this library with API 9 devices.

You still need core-3.1.0.jar and android-support-v4.jar to be in your additional library folder. They have been zipped together - you can download them from HERE. Extract them from the zipped file and copy them to your additional library folder.
 

Attachments

  • zxScannerLiveViewB4ALibFiles.zip
    49.4 KB · Views: 688

bocker77

Active Member
Licensed User
Longtime User
Johan, I am getting this error when stopping the scan. I am using your latest and greatest. It does not cause any issues so far though. Also this is in a new project.

Code at line 231:
Sub zxslv_scanner_stopped
scanStarted = False
Log("Scanner stopped")
End Sub

** Activity (gameplay) Pause, UserClosed = false **
Error occurred on line: 231 (GamePlay)
java.lang.NullPointerException
at com.KangaRooSoftware.gameplay._zxslv_scanner_stopped(gameplay.java:764)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:702)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at anywheresoftware.b4a.shell.Shell$2.run(Shell.java:310)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5377)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
** Service (starter) Destroy **
 

Johan Schoeman

Expert
Licensed User
Longtime User
It could be that the scanner was already stopped and then asked to stop again. Can you perhaps upload your project? Will be easier to catch the bug
 
D

Deleted member 103

Guest
Hi Johan Schoeman,

I have a question specifically what the camera would have a resolution of at least?
With my Tablet Medion LifeTab 7" (camera resolution 2MB) the bar code is not clear, and therefore it is not recognized.
 

Johan Schoeman

Expert
Licensed User
Longtime User

Gerrard

Member
Licensed User
Longtime User
Hi Johan
I am trying zxScannerLiveView and get the following run time error:
B4X:
Installing file.
PackageAdded: package:JHS.zxScannerLiveView
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.RuntimeException: startPreview failed
    at android.hardware.Camera.startPreview(Native Method)
    at eu.livotov.labs.android.camview.camera.v1.DefaultCameraV1Controller.startPreview(DefaultCameraV1Controller.java:141)
    at eu.livotov.labs.android.camview.CameraLiveView.setCamera(CameraLiveView.java:188)
    at eu.livotov.labs.android.camview.CameraLiveView$1.onOperationCompleted(CameraLiveView.java:117)
    at eu.livotov.labs.android.camview.camera.v1.DefaultCameraV1Controller$5.onPostExecute(DefaultCameraV1Controller.java:328)
    at eu.livotov.labs.android.camview.camera.CAMViewAsyncTask$Handler.handleMessage(CAMViewAsyncTask.java:231)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:3687)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)

What do you suggest to fix the problem.
Regards
Gerrard
 

Johan Schoeman

Expert
Licensed User
Longtime User
Gerrard, there are numerous version of the project in this thread each with new library files that adds some additional functionality to the library in post #1. What post # is the project and library that you are trying to test? Or did you start your own project?
 

CaStar

Member
Licensed User
Longtime User
Thanks Johan!
Unfortunately it does not work, I think that the camera is simply too weak (2MB pixels), the bar code is not sharp enough.
The same problem here on my Samsung J1. Seems not to be a camera problem but a problem of focusing. ABZxing works without problems...
 

Johan Schoeman

Expert
Licensed User
Longtime User
The same problem here on my Samsung J1. Seems not to be a camera problem but a problem of focusing. ABZxing works without problems...
There are now a number of barcode scanning libraries available on the forum some of which are here (@DonManfred has also posted some):

Barcodes and Barcode Scanners
7. ZXingLib(integration version) by icefairy333 - modified by Johan Schoeman (QR Codes and Barcodes) - follow the thread
21. QR Code Library - follow the thread (it also creates other 2D and 1D barcodes - no internet connection required)
23. QRCP3 & QRCP4 - create colored QR codes and scan 1D & 2D codes
24. B4A code for creating QR Codes (version 1 to 40), Aztec Codes (layer 1 to 11), PDF417, 2 of 5 Interleaved, EAN-13, EAN-8, Code 128, Code 39, Code 93 and Code 11 - no internet connection required
51. Barcode Scanner - 100% embedded within B4A
57. QRCodeReaderView - QR Code Scanner that is also 100% embedded in B4A
78. 1D and 2D Barcode Scanner with ZXING - another Barcode Scanner that is 100% embedded in B4A
79. 1D and 2D Barcode Scanner with ZBAR - another Barcode Scanner that is 100% embedded in B4A
92. QREader - scan 1D and 2D barcodes (QR Code, PDF 417, Aztec, etc) making use of Google Mobile Vision API
93. Android Vision Barcode Reader (QR Codes and other 1D & 2D barcodes)
105. android-quick-response-code - Another 1D & 2D barcode scanner
117. ZXING - A wrap for the Zxing official project as it is on 10 July 2016

Use whatever works for you. Some are 100% embedded in B4A while others depend on starting an external activity via B4A.

And if you want, I will post the Java code as it stands at present and you can change it to do whatever you would like it to do.
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User

Gerrard

Member
Licensed User
Longtime User
Johan, In my reply #111, I used the b4aZXScannerLiveView.zip code file, and the ZXScannerLiveViewLibFiles.zip library files from your post #1.
I have now used the zxScannerLiveViewB4ALibFiles.zip from your post #105. With this I get the following compile time error:

adb.exe - Entry Point Not Found
The procedure entry point WSAPoll could not be located in the dynamic link library WS2_32.dll.

Hope you can suggest a solution. Regards Gerrard
 

Johan Schoeman

Expert
Licensed User
Longtime User
Did you download core-3.1.0.jar and android-support-v4.jar from the link provided in post #1 and copied them to your additional library folder?
 

Gerrard

Member
Licensed User
Longtime User
Yes I did download and copy core-3.1.0.jar and android-support-v4.jar to the additional libraries folder
 

Johan Schoeman

Expert
Licensed User
Longtime User
What device are you running this on? I have no idea what those errors are...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…