Java Question when wrap a library,can i put .so in another folder.

hears

Active Member
Licensed User
Longtime User
when wrap a library,can i put .so in another folder?
because i need 2 type .so file,they cannot working together.the app always crash.
 

sfsameer

Well-Known Member
Licensed User
Longtime User
when wrap a library,can i put .so in another folder?
because i need 2 type .so file,they cannot working together.the app always crash.
Hello,

If you are using SLC then :
1-Rename First .so file for example : libfirstlib.so
2-Rename Second .so file for example : libsecondlib.so
3-Put the Jni (.SO) libraries in additional folder
4-When you are loading the native libraries in the java :

First library :
B4X:
 System.loadLibrary("firstlib");

Second Library :
B4X:
 System.loadLibrary("secondlib");

5- Click on "Compile" in SLC and it should work without any problems.

-----
The resulted jar from SLC structure will be :
1629471498807.png



Thank you,
Saif
 
Top