follow the steps in http://developer.android.com/tools/sdk/ndk/index.html. I got dynamic-library ,for example:libhello-jni.so under folder like "armeabi"( ABI corresponds to an ARMv5TE ) .

my question is : If I use an ARMv5TE based CPU. My dynamic-library libhello-jni.so will use THE EABI. And the JVM that runs on this CPU will also use THE EABI, because they use the same ABI so they can interact with each other. Is this right?


Please refer to the Android NDK documentation for more details (see documentation.html at the root of the NDK folder).

If you refer to the CPU Arch ABIs part, the section III.3 explains the mechanisms that are used to select the proper machine code:

When installing an application, the package manager service will scan the .apk and look for any shared library of the form lib/<primary-abi>/lib<name>.so [...] [it] ensures that the best machine code for the target device is automatically extracted from the package at installation time.

In other words the system automatically takes care to pick the right library.

Your Answer

