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

Gerrard

Member
Licensed User
Longtime User
Johan, you will be please to know that the problem has been solved. You can see it in the thread "Problem with ADB" started by lucarr67 on 2016/06/27.
The solution is in post #5 by Rick Harris, which I followed and now all is well after loading the earlier version of the Platform-Tools.
Regards Gerrard
 

pcicom

Member
Licensed User
Longtime User
Hi. excelent work..

I need read barcode inside a panel, or how read in other layout..

layoutMain = Menu, in menu 1 botton to loadLayour reder
LayoutReaded = button for read or capture codebar.

this a simple, but cant solved

Tanks..
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi. excelent work..

I need read barcode inside a panel, or how read in other layout..

layoutMain = Menu, in menu 1 botton to loadLayour reder
LayoutReaded = button for read or capture codebar.

this a simple, but cant solved

Tanks..
If it does not work for you making use of a panel then consider making use of 2 activities. One for you main layout and another one where the scanner can be started from.
 

pcicom

Member
Licensed User
Longtime User
If it does not work for you making use of a panel then consider making use of 2 activities. One for you main layout and another one where the scanner can be started from.


Tanks.. I resolved this problem, THANKS for you help tip..
 

klaus

Expert
Licensed User
Longtime User
I have tryed this library with problems.
Trying to use it in another project the camera doesn't display.
Whith the original code I got it working, but just changing the Package name the camera doesn't display anymore.
For another test, I used the original code and added new code, it worked on my phone.
Compiling it on my tablet, exactly the same code, the camera doesn't display.
And now, even with the original code, on the phone, the camera doesn't display anymore, I removed all old apps on the device.
So I am really confused on what happens and what I am doing wrong ?
That's what I get.



I use B4A version 6.30 and my devices have Android 6.0.1 on both.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Klaus, can you upload your project with the changed package name?
 

klaus

Expert
Licensed User
Longtime User
It was your original code and I just added "1" at the end.
I tested it now again, reinstalling it and removing all old stuff, and it works again, even changing the Package name.
I did the whole process for the other project once again, and now it works !!!
Probably I left some old stuff on the devices.
Sorry for having bothered you.

There is another problem with the Sub zxslv_scanner_stopped event routine when running the original code the first time.
It throws this error:
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
Unexpected event (missing RaiseSynchronousEvents): zxslv_scanner_stopped
Check the unfiltered logs for the full stack trace.
Error occurred on line: 91 (Main)
java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.BA JHS.zxScannerLiveView.main.activityBA' on a null object reference
at JHS.zxScannerLiveView.main._zxslv_scanner_stopped(main.java:487)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at anywheresoftware.b4a.shell.Shell$2.run(Shell.java:311)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
** Activity (main) Resume **

It seems yoou are missing a RaiseSynchronousEvents in the code when you compile it to a library.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Thanks Klaus - will look into it. Does it only happen on the first run after the initial first time installation?
 

Johan Schoeman

Expert
Licensed User
Longtime User
Klaus, please try with the attached lib files and see if the error still occurs (Version 1.01)
 

Attachments

  • zxScannerLiveViewLibFiles_V1_01.zip
    49.6 KB · Views: 606

xpectmore

Member
Licensed User
Longtime User
nice stuff !!!
cool job !

to avoid Unfortunately zxScannerLiveView was stopped .... and then crash after that 5 secconds(cause i press start twice)
put in Activity_create
B4X:
b2.Visible=False

then

B4X:
Sub b1_Click

   zxslv.Visible = True
   zxslv.startScanner
   b1.Visible=False
   b2.Visible=True
End Sub
Sub b2_Click

   zxslv.Visible = False
   zxslv.stopScanner
   l1.Text = ""
   b1.Visible=True
   b2.Visible=False
End Sub

great job !!!!


.. anyway i found it much sexy like this :
 

Attachments

  • aaaaa2.zip
    21.2 KB · Views: 319
  • test54126758d83d112b5297263d86b3f185.png
    538 bytes · Views: 321
  • muchsexy2.zip
    20.3 KB · Views: 325
  • 3.png
    230.1 KB · Views: 345
  • MASTERPIECE.zip
    20.3 KB · Views: 327
Last edited:

fabton1963

Member
Licensed User
Longtime User
Is the zxScannerLiveView library compatible with B4A 7.1 and android 5.1 ?
If I run Johan sample it works,
if I replicate a new app using cut and paste of code and manifest, my new app crash when I try to execute zxslv.Initialize("zxslv") instruction.
Any ideas ?
Fabrizio.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Please post the error in the B4A log that you are getting. I guess you have not copied the required resourse files
 

fabton1963

Member
Licensed User
Longtime User
Please post the error in the B4A log that you are getting. I guess you have not copied the required resourse files

Thank you solved, i just copy the missing resource files from your demo app as you suggest.
I whoul'd like to see my B4A logs but log window just show a white window with message "Logger connected to: HUAWEI HUAWEI VNS-L31".
Now I'll try to uninstall and install again B4A.

Thank you for your good works with barcode library.
Fabrizio
 

MarcoRome

Expert
Licensed User
Longtime User
Hi Johan.
Is it possible that take also "picture" when raise zxslv_scanresult ?
Thank you
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan.
Is it possible that take also "picture" when raise zxslv_scanresult ?
Thank you
Hi Marco

Do you want the bitmap returned of the barcode that was scanned in the B4A event?
 

MarcoRome

Expert
Licensed User
Longtime User
Hi dear.
i will want the picture when scan code... if possible. Example i Have a box with this label barcode... Now i Have result this barcode i will want Also picture with box
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi dear.
i will want the picture when scan code... if possible. Example i Have a box with this label barcode... Now i Have result this barcode i will want Also picture with box
Hi Marco

Will see if I can bring back the bitmap.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Marco

Will see if I can bring back the bitmap.
See PM that I have sent you with new lib files. Thanks for the donation. Much appreciated!

Rgds

JS
 

rkmoray

Active Member
Licensed User
Longtime User
I love this lib, but I have 1 issue.
While I have a button for the flash (on/off), the flash also turns on/off if the scanner area is touched while scanning.
I do not want the user to turn on the torch, unless the "torch"button is selected.
How do I do that
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…