Android Question Native libraries folder

apty

Active Member
Licensed User
Longtime User
Where can I put the libs folder in B4A (to add a native executable)? I have tried to set
B4X:
android:extractNativeLibs="true"
so that the native library is automatically extracted during runtime but I don't know where the libs folder is, so that I can put the library there. Please assist
 

apty

Active Member
Licensed User
Longtime User
One of my apps was executing a native C file using exec command which is no longer supported (in Android Q or above) if executed from within the application home directory as shown in the post below:

The suggestion is to put the file in libs folder so that Android extracts during runtime then I can run the command from the directory:
B4X:
context.getApplicationInfo().nativeLibraryDir + "/" + NativeFileName;

I wanted to know how I can put the file in libs folder
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

apty

Active Member
Licensed User
Longtime User
ok. I had tried that but the file was still not found during runtime. The code
B4X:
File libDirectory = new File(context.getApplicationInfo().nativeLibraryDir);
String files[] = libDirectory.list();
always returns an empty list during runtime, though i thought the libraries will be in nativeLibraryDir
 
Upvote 0

apty

Active Member
Licensed User
Longtime User
The generated jar from SLC has below structure

generatedjar.png
 
Upvote 0
Top