Android Question To use SDK in .jar file that is dependent with .so files.

locxtronic

Member
Licensed User
Longtime User
Hello everyone,

I have been provided with an SDK that has been compiled into a .jar file. I have added the .jar file to the additional library folder and included it using #AdditionalJar in the B4A code. I am able to access the functions in the .jar file; however, after executing the code, it failed to load the .so library file.

What I have done so far is add a libs folder that contains arm64-v8a and armeabi-v7a directories and place all .so files in their respective locations. But it still failed to find the .so file.

So, how can I solve this? I don’t have the source code of the .jar to recompile it.

The SDK has been structured as follows:

1732113170256.png


here is my "additional lib" folder:

1732113556674.png
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
here is my "additional lib" folder
that´s wrong. The .so must be placed inside the JAR and the folder (libs or just lib) need to be present in the JAR already. together with all subdirectories containing the .so-File(s).
 
Upvote 0

locxtronic

Member
Licensed User
Longtime User
that´s wrong. The .so must be placed inside the JAR and the folder (libs or just lib) need to be present in the JAR already. together with all subdirectories containing the .so-File(s).

Can you suggest me how to do it?

I have try once using command

1. Decompile original jar using, jar -xf thefile.jar.
2. Then create a folder "libs" at the same root
3. Copy the arm64-v8a, armeabi-v7a (which contain the .so files) into libs folder.
4. Repack using command jar -cf thenew.jar .
5. Import to b4a code

But still same error occur, maybe i do wrong somewhere?

After decompile, it make 4 other folder that contain alot of .class file, should i put the libs folder and the .so file in those folder?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
So there is no way for me to recompile the .jar and the .so files together without library source code?
Not that i know of. I never tried to recompile anything though.

I always use the sources to Build a jar with .so-Files.

What is FDX SDK about? What feature are you trying to implement?

Post a link to all you got provided... Hard to help not knowing what exactly you got. The Screenshot above is not telling much about.
 
Upvote 0

locxtronic

Member
Licensed User
Longtime User
Not that i know of. I never tried to recompile anything though.

I always use the sources to Build a jar with .so-Files.

What is FDX SDK about? What feature are you trying to implement?

Post a link to all you got provided... Hard to help not knowing what exactly you got. The Screenshot above is not telling much about.
The SDK is for fingerprint reader, i attached the whole sdk folder i get from the manufacturer. It is intended to be use in android studio, but due to my limitation capabilities in java programming i want to use it in B4A.

 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
but due to my limitation capabilities in java programming i want to use it in B4A
You may hire someone to write a wrapper for this SDK (with JAVA).
You can put a offer in https://www.b4x.com/android/forum/forums/job-offers.39/

I´ve downloaded the SDK and had a small look at it.

The SDK is a complex one.
It is surely possible to interact with it with JavaObject but this require a good java-knowledge though.
 
Upvote 0
Top