Java Question SDK API Library works on android 4.0.4 but fails on 4.4.2

qle

Member
Licensed User
Longtime User
SDK API Library works on android 4.0.4 but fails on 4.4.2

Hi,
I use Simple Library Compiler to create an B4A library from an SDK API for a barcode scanner.
(with help last year from B4a Users, thank you)

But now the manufacture has upgraded the scanners, and gone to android 4.4.2
They gave me new libraries, and said, 'just copy into your lib folders' will work on 4.0.4 and 4.4.2
To test the new libraries they gave me, i first compiled in a test project in 'Eclipse', they work in android 4.0.4 and 4.4.2 !!!

Using Simple Library Compiler (SLC)
I copied the new files
cw-deviceapi.jar into /additional//lib
libDeviceAPI.so into /additional/lib/armeabi
seems to have recognised the new libraries, and complied without error.

The new B4A library works fine on android 4.0.4 but not on 4.4.2

Looking though the un-filtered logs, i can see where it fails, but not why!
All i can see is
1D Power up Fail.........
open() err:-1
(see below log snips)

Any help would be appreciated

Lee.

Log snips
(edited for briefety)

Works on Android 4.0.4
B4X:
** Activity (main) Resume **
DeviceControlinit: Return 1
About to Open device
Open device: Back
InitTask:doInBackground
Trying to load lib /data/data/anyname.c4000/lib/libDeviceAPI.so 0x418b0840
Added shared lib /data/data/anyname.c4000/lib/libDeviceAPI.so 0x418b0840
Flushing caches (mode 0)
No JNI_OnLoad found in /data/data/anyname.c4000/lib/libDeviceAPI.so 0x418b0840, skipping init
Barcode_1D_Open.........
Barcode_1D_Open device = C4000 path = /dev/ttyMT3 baudrate= 9600
[anyname.c4000/anyname.c4000.main(0x198c6c0)] disconnect: api=1

Fails on Android 4.4.2
B4X:
** Activity (main) Resume **
DeviceControlinit: Return 1
About to Open device
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=13: interp stack at 0x6094d000
threadid=13: created from interp
start new thread
threadid=13: notify debugger
Open device: Back
threadid=13 (AsyncTask #3): calling run()
InitTask:doInBackground
Trying to load lib /data/app-lib/anyname.c4000-1/libDeviceAPI.so 0x41f2b1d8
Flushing caches (mode 0)
Added shared lib /data/app-lib/anyname.c4000-1/libDeviceAPI.so 0x41f2b1d8
No JNI_OnLoad found in /data/app-lib/anyname.c4000-1/libDeviceAPI.so 0x41f2b1d8, skipping init
Barcode_1D_Open.........
close handle(0x6048a5b0) (w:144 h:520 f:1)
Barcode_1D_Open device = C4000 path = /dev/ttyMT3 baudrate= 9600
1D Power up Fail.........
open() err:-1
 

qle

Member
Licensed User
Longtime User
Hi Erel,

Found the issue,

i did not update the DeviceApi.jar in C:\Program Files\Anywhere Software\Basic4android\libraries
cw-deviceapi.jar
had to be renamed to deviceapi.jar and copied to C:\Program Files\Anywhere Software\Basic4android\libraries

It worked on the 4.0.4 because it found the older version DeviceApi.jar that was already there from my earlier version install.
(the newer version DeviceApi.jar is for 4.0.4 and 4.4.2)

Im am a bit uncertain as to when and why some libs get copied to
C:\Program Files\Anywhere Software\Basic4android\libraries
when its already in the SLC lib folders.


Thank you for your reply Erel.

Lee.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…