I have a so file named libJSA.so
in memory card in android and wanna load it in my application.
How can i load this file using System.loadLibrary("libname");
?
Things i have tried:-
- t开发者_开发知识库ry to copy it to
/system/lib
. ---- Not worked System.loadlibrary("/mnt/sdcard/folder/libJSA.so");
-------- Not worked
AFAIK, unless it's a system library or you are on a rooted device, you can't load any libraries that are outside your signed APK bundle, meaning what you want to do can't be done.
Simply:
System.load("/mnt/sdcard/folder/libJSA.so");
System.loadlibrary("/mnt/sdcard/folder/libJSA.so"); // Not working
try:
System.loadLibrary ("JSA.so");
not (java is ase sensitive):
System.loadlibrary("JSA.so")
or instead try
Static{
System.load("/sdcard/folder/libJSA.so");
}
put this inside the class and outside onCreate
.
Try removing "lib" prefix.
If your library name is "libJSA.so", try to use System.loadLibrary ("JSA");
精彩评论