You need to link your final shared library created by Android NDK with ndk-build in the shared PDF library that you said that you already compiled for the ARM architecture . ( Make sure this is the case, otherwise the library will not work on Android! )
For this, if, for example, you have the following directory structure:
jni βββ libs βββββββ my_shared_lib.so βββ Android.mk βββ Application.mk
In the Android.mk file, you must have the following content:
LOCAL_PATH := $(call my-dir)
and the contents of the Application.mk file (to use the standard C ++ library and create the final shared library for two different versions of the ARM architecture):
APP_OPTIM := debug APP_PLATFORM := android-14 APP_STL := gnustl_static APP_ABI := armeabi armeabi-v7a
Then, after compiling the code from Eclipse or from the command line using ndk-build script, it will compile your final shared library and link it to your pre-created shared library (i.e. in the shared PDF library that you said you are trying to use) .
For shared libraries, the apk generated and hosted on the device / emulator contains the final shared library, as well as any ready-made shared libraries that you link to , as opposed to links to static libraries that are not linked inside the apk.
In your use case, you should have two shared libraries in the lib directory of your Android application after unpacking the apk on the device. You can verify this by running the following command from the terminal:
adb shell ls -l /data/data/com.company.myapp/lib
Replace com.company.myapp with your application package name.
Also, be sure to include inside the static context of the Java class:
class MyClass { static { try { System.loadLibrary("mynativelib"); } catch (UnsatisfiedLinkError ule) { Log.e(TAG, "WARNING: Could not load native library: " + ule.getMessage()); } }
Note the use of the same name inside the System.loadLibrary method call as the final name of the shared library.