• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How we use SO library files with NDK?

xhuutrix

Lurker
May 9, 2011
1
0
Hi All,
I am beginer to learn NDK to support C code to Android,
Can anybody help to explain how to fix the problem below:

1. I am implemented 2 shared library and use these to JNI code to let android can call, i am using NDK to build, it succeed.

2. I run the android app, it failed to load library, the problem seems it can not find other library that linked at build time. I have copied these library to same folder with main lib (JNI implement lib /data/data/com.learn/lib/*.so) but it still fail, and i am trying to copy to /system/lib but it can not since i see all others .so are placed at this folder.

So my question is that:
1. where to put so files to let app can load by using System.load or System.loadLibrary

2. If i use static lib then it is OK, but based on two-libs example i don't see how we load from an built static lib as .a so can you tell me how to link to file .a (static lib) from config make file?

3. Can android work with other so file that built from linux OS with gcc or other compiler? or it should just work so, or .a file that built from NDK?

Thank in advance!
 
actually it will work with arm libraries.

these libraries can be generated by the arm-gp2x-linux-gcc command.


i m placing the so files in the jni same as jni.c file folder.
and it is loading from there. but i m having the problem of unsatisfied linker error. when i restart eclipse and run again .
can you help me in this problem..


i m attaching my sample project
thanks
 

Attachments

  • manish.zip
    58.8 KB · Views: 71
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones