I have a C ++ library and I made some JNI code to export to the Android world. I also created an Android app that uses my JNI interface.
To use the library, I imported all the * .java and * .h / *. Cpp files into the Eclipse App project (in the right folder), then I created the * .mk files for the NDK. I compiled the library using ndk-build and downloaded it to the target device using Eclipse. The application is working fine.
Now I would like to separate the application from the library. So, I compiled the name .jar, which contains the JNI Java interface files, then I compiled libname.so with ndk-build for C ++ stuff. Then I put name.jar in newproject / libs and libname.so in newproject / libs / armeabi. Consider the "newproject" application that I created without the source code of the library (I do not want to release the source code, only .jar and .so).
The result is a crashing application with a memory dump in LogCat. I used System.loadLibrary ("name") in a static context.
Can anybody help me?
source share