1D and 2D Barcode Scanner with ZXING - another Barcode Scanner that is 100% embedded in B4A
The attached project wraps the ZXING part of this Github project. I have not tested all the barcode formats but it should scan the following types: BarcodeFormat.UPC_A BarcodeFormat.UPC_E BarcodeFormat.EAN_13 BarcodeFormat.EAN_8 BarcodeFormat.RSS_14 BarcodeFormat.CODE_39 BarcodeFormat.CODE_93...
www.b4x.com
HI, Johan Schoeman, I can perfectly run your example code, but when I change it to B4XMainPage, in the zxBarcodeScanner_scan_result() function, when running the sound effect, i.e., nativeMe.RunMethod("playTone", Null) and nativeMe.RunMethod("vibrateOnce", Array(tim)), I get the following error (when I comment them out, it runs normally). I have been looking for a long time but have not been able to solve it, so I can only seek your help. Please assist me. Thank you.
Error occurred on line: 151 (B4XMainPage) java.lang.RuntimeException: Object should first be initialized (JavaObject). at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67) at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:259) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:119) at b4a.example.b4xmainpage._zxbarcodescanner_scan_result(b4xmainpage.java:473) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157) at anywheresoftware.b4a.BA$2.run(BA.java:395) at android.os.Handler.handleCallback(Handler.java:971) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loopOnce(Looper.java:206) at android.os.Looper.loop(Looper.java:296) at android.app.ActivityThread.main(ActivityThread.java:9205) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)