Jul 21, 2020 Replies: 22 B4A + B4i barcode reader. Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Depends on BCToast: https://www.b4x.com/android/forum/t...platform-custom-toast-message.111046/#content (BCToast will be an internal library in the near future) While the camera related code is platform specific, the main program logic can still be shared. In this case there isn't too much logic but in real usage the benefit of implementing it like this will be higher. Requires Android 5+. Supported formats: B4A - https://developers.google.com/andro...d/gms/vision/barcode/Barcode#constant-summary B4i - TYPE_QR, TYPE_UPCE, TYPE_39, TYPE_39Mod43, TYPE_EAN13, TYPE_EAN8, TYPE_93, TYPE_128, TYPE_PDF417 Updates: B4i iBarcode v1.21 - Adds support for setting the scan window: https://www.b4x.com/android/forum/threads/ibarcode-library.47354/post-836360 Attachments BarcodeReader.zip BarcodeReader.zip 183.5 KB · Views: 26 Last edited: Jul 12, 2021 Click to expand...
B4A + B4i barcode reader. Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Depends on BCToast: https://www.b4x.com/android/forum/t...platform-custom-toast-message.111046/#content (BCToast will be an internal library in the near future) While the camera related code is platform specific, the main program logic can still be shared. In this case there isn't too much logic but in real usage the benefit of implementing it like this will be higher. Requires Android 5+. Supported formats: B4A - https://developers.google.com/andro...d/gms/vision/barcode/Barcode#constant-summary B4i - TYPE_QR, TYPE_UPCE, TYPE_39, TYPE_39Mod43, TYPE_EAN13, TYPE_EAN8, TYPE_93, TYPE_128, TYPE_PDF417 Updates: B4i iBarcode v1.21 - Adds support for setting the scan window: https://www.b4x.com/android/forum/threads/ibarcode-library.47354/post-836360
Mark Thorndyke Member Licensed User Longtime User Aug 11, 2020 #2 Liking this and quick change getting all bar-codes required. Surprised you've not used the new Toast in the CameraExClass class
Liking this and quick change getting all bar-codes required. Surprised you've not used the new Toast in the CameraExClass class
imbault Well-Known Member Licensed User Longtime User Sep 4, 2020 #3 Thanks you @Erel for this very interesting project : I'd like to add to switch button to disable/enable barecode capture while continuing previewing but how to stop BC capturing and resuming BC capturing in the code ? Thanks a lot Patrick
Thanks you @Erel for this very interesting project : I'd like to add to switch button to disable/enable barecode capture while continuing previewing but how to stop BC capturing and resuming BC capturing in the code ? Thanks a lot Patrick
Erel B4X founder Staff member Licensed User Longtime User Sep 6, 2020 #4 Add a flag variable and use it to ignore the Preview event. Code: 'I don't remember the event signature ( ) If DontCapture Then Return
Add a flag variable and use it to ignore the Preview event. Code: 'I don't remember the event signature ( ) If DontCapture Then Return
D dws Member Licensed User Longtime User Sep 22, 2020 #5 After version 10.2 Error when press then start button. What is wrong ? In version 9.80 working fine. b4xmainpage$ResumableSub_StartCameraresume (java line: 258) java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/content/ContextCompat; at anywheresoftware.b4a.objects.RuntimePermissions.Check(RuntimePermissions.java:73) at anywheresoftware.b4a.objects.RuntimePermissions.CheckAndRequest(RuntimePermissions.java:97) at b4a.cambarcodereader.b4xmainpage$ResumableSub_StartCamera.resume(b4xmainpage.java:258) at b4a.cambarcodereader.b4xmainpage._startcamera(b4xmainpage.java:235) at b4a.cambarcodereader.b4xmainpage._btnstartstop_click(b4xmainpage.java:76) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213) at anywheresoftware.b4a.BA.raiseEvent(BA.java:193) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80) at android.view.View.performClick(View.java:7161) at android.view.View.performClickInternal(View.java:7138) at android.view.View.access$3500(View.java:811) at android.view.View$PerformClick.run(View.java:27419) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7548) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.ClassNotFoundException: androidx.core.content.ContextCompat ... 20 more *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume **
After version 10.2 Error when press then start button. What is wrong ? In version 9.80 working fine. b4xmainpage$ResumableSub_StartCameraresume (java line: 258) java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/content/ContextCompat; at anywheresoftware.b4a.objects.RuntimePermissions.Check(RuntimePermissions.java:73) at anywheresoftware.b4a.objects.RuntimePermissions.CheckAndRequest(RuntimePermissions.java:97) at b4a.cambarcodereader.b4xmainpage$ResumableSub_StartCamera.resume(b4xmainpage.java:258) at b4a.cambarcodereader.b4xmainpage._startcamera(b4xmainpage.java:235) at b4a.cambarcodereader.b4xmainpage._btnstartstop_click(b4xmainpage.java:76) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213) at anywheresoftware.b4a.BA.raiseEvent(BA.java:193) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80) at android.view.View.performClick(View.java:7161) at android.view.View.performClickInternal(View.java:7138) at android.view.View.access$3500(View.java:811) at android.view.View$PerformClick.run(View.java:27419) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7548) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.ClassNotFoundException: androidx.core.content.ContextCompat ... 20 more *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume **
josejad Expert Licensed User Longtime User Sep 22, 2020 #6 Have you just installed 10.2? Or have you followed the instructions? Have you updated the SDK as described?
Have you just installed 10.2? Or have you followed the instructions? Have you updated the SDK as described?
Erel B4X founder Staff member Licensed User Longtime User Sep 23, 2020 #7 José J. Aguilar said: Or have you followed the instructions? Have you updated the SDK as described? Click to expand... No. The error happens because AndroidX sdk is missing. Carefully follow these instructions: https://www.b4x.com/b4a.html
José J. Aguilar said: Or have you followed the instructions? Have you updated the SDK as described? Click to expand... No. The error happens because AndroidX sdk is missing. Carefully follow these instructions: https://www.b4x.com/b4a.html
LucaMs Expert Licensed User Longtime User Oct 3, 2020 #8 I tried it on some barcodes without success. I had to replace: B4X: CreateDetector (Array("CODE_128", "CODE_93", "QR_CODE")) with: B4X: CreateDetector (Array("AZTEC", "CODE_128", "CODE_39", "CODE_93", "CODABAR", "DATA_MATRIX", "EAN_13", "EAN_8", "ITF", "PDF417", "QR_CODE", "UPC_A", "UPC_E")) I don't know if it actually recognizes all those types but the ones I tried previously are now recognized. B4A ONLY Last edited: Oct 3, 2020
I tried it on some barcodes without success. I had to replace: B4X: CreateDetector (Array("CODE_128", "CODE_93", "QR_CODE")) with: B4X: CreateDetector (Array("AZTEC", "CODE_128", "CODE_39", "CODE_93", "CODABAR", "DATA_MATRIX", "EAN_13", "EAN_8", "ITF", "PDF417", "QR_CODE", "UPC_A", "UPC_E")) I don't know if it actually recognizes all those types but the ones I tried previously are now recognized. B4A ONLY
Xfood Expert Licensed User Longtime User Oct 3, 2020 #9 is there any way to enable pointer while reading code? Attachments lettore-codici-a-barre.jpg 18.8 KB · Views: 1,211
amorosik Expert Licensed User Longtime User Oct 3, 2020 #10 In one-dimensional codes, it only reads them if they are arranged horizontally or vertically It is a limit to know otherwise you risk not being able to read even the barcodes that the program would be able to decode This seems a bit strange to me because, graphically speaking, even the two-dimensional ones are actually sequences of one-dimensional codes placed one on top of the other. And if he reads the qr-code at 45 degrees with respect to the lens, it means that he has the ability to read diagonally.
In one-dimensional codes, it only reads them if they are arranged horizontally or vertically It is a limit to know otherwise you risk not being able to read even the barcodes that the program would be able to decode This seems a bit strange to me because, graphically speaking, even the two-dimensional ones are actually sequences of one-dimensional codes placed one on top of the other. And if he reads the qr-code at 45 degrees with respect to the lens, it means that he has the ability to read diagonally.
P pacpinto Member Licensed User Oct 8, 2020 #11 amorosik said: In one-dimensional codes, it only reads them if they are arranged horizontally or vertically It is a limit to know otherwise you risk not being able to read even the barcodes that the program would be able to decode This seems a bit strange to me because, graphically speaking, even the two-dimensional ones are actually sequences of one-dimensional codes placed one on top of the other. And if he reads the qr-code at 45 degrees with respect to the lens, it means that he has the ability to read diagonally. Click to expand... Hi, I have exactly the same issue. Any ideas would be very welcome. I have a use case where this makes a difference. Thank you in advance.
amorosik said: In one-dimensional codes, it only reads them if they are arranged horizontally or vertically It is a limit to know otherwise you risk not being able to read even the barcodes that the program would be able to decode This seems a bit strange to me because, graphically speaking, even the two-dimensional ones are actually sequences of one-dimensional codes placed one on top of the other. And if he reads the qr-code at 45 degrees with respect to the lens, it means that he has the ability to read diagonally. Click to expand... Hi, I have exactly the same issue. Any ideas would be very welcome. I have a use case where this makes a difference. Thank you in advance.
Erel B4X founder Staff member Licensed User Longtime User Oct 8, 2020 #12 The actual reading is done by Google SDK. Narrowing down the list of detectors might improve its performance.
The actual reading is done by Google SDK. Narrowing down the list of detectors might improve its performance.
P Pepebis Member Licensed User Longtime User Oct 11, 2020 #13 Hello. An example is working. But when I'm trying to use it my B4x pages I have a problem. B4X: java.lang.reflect.InvocationTargetException pointing on line with line B4X: builder.InitializeNewInstance("com/google/android/gms/vision/barcode/BarcodeDetector.Builder".Replace("/", "."), Array(ctxt)) I have change manifest, i don't understand if I'm doing it correctly because after changes and trying to open the app manifest going back to previous state. I'm adding this line inside manifest. B4X: <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,face" /> Also as per instruction can't find jar file . Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Click to expand...
Hello. An example is working. But when I'm trying to use it my B4x pages I have a problem. B4X: java.lang.reflect.InvocationTargetException pointing on line with line B4X: builder.InitializeNewInstance("com/google/android/gms/vision/barcode/BarcodeDetector.Builder".Replace("/", "."), Array(ctxt)) I have change manifest, i don't understand if I'm doing it correctly because after changes and trying to open the app manifest going back to previous state. I'm adding this line inside manifest. B4X: <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,face" /> Also as per instruction can't find jar file . Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Click to expand...
DonManfred Expert Licensed User Longtime User Oct 11, 2020 #14 Pepebis said: <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,face" /> Click to expand... Use two comma <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,,face" /> Click to expand...
Pepebis said: <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,face" /> Click to expand... Use two comma <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,,face" /> Click to expand...
P Pepebis Member Licensed User Longtime User Oct 11, 2020 #15 something is wrong. before opening b4a I'm changing this line adding that line with meta ( I'm using notepad to modify this file ) then after running app manifest removing that line which i added before. The manifest file which I'm changing is in b4->objects->AndroidManifest
something is wrong. before opening b4a I'm changing this line adding that line with meta ( I'm using notepad to modify this file ) then after running app manifest removing that line which i added before. The manifest file which I'm changing is in b4->objects->AndroidManifest
DonManfred Expert Licensed User Longtime User Oct 11, 2020 #16 Pepebis said: I'm using notepad to modify this file Click to expand... ??? WHAT? The correct place to edit the content of the Manifest is to use the Manifesteditor.
Pepebis said: I'm using notepad to modify this file Click to expand... ??? WHAT? The correct place to edit the content of the Manifest is to use the Manifesteditor.
vmag Active Member Oct 11, 2020 #17 This is probably the best example for scanning barcodes! A minimum of code, and if you have the latest version of b4a, then no dancing with a tambourine is required. Thank you to the developers!
This is probably the best example for scanning barcodes! A minimum of code, and if you have the latest version of b4a, then no dancing with a tambourine is required. Thank you to the developers!
P Pepebis Member Licensed User Longtime User Oct 11, 2020 #18 OK. I have change it , but still . I think I'm missing that jar file .
DonManfred Expert Licensed User Longtime User Oct 11, 2020 #19 Pepebis said: OK. I have change it , but still . I think I'm missing that jar file . Click to expand... Go agaiun over the Tutorial, edit your project as needed. Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Click to expand...
Pepebis said: OK. I have change it , but still . I think I'm missing that jar file . Click to expand... Go agaiun over the Tutorial, edit your project as needed. Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Click to expand...
P Pepebis Member Licensed User Longtime User Oct 11, 2020 #20 I'm sorry i don't understand what does it mean ? #AdditionalJar in B4A Click to expand...