Reputation:
According to my Application.mk
, I am compiling both a armeabi-v7a AND a armeabi version of a C++ shared library. How do I know which version is being loaded at runtime? Is there a similar setting for the Java code, or is that an ill-formed question?
Upvotes: 0
Views: 1310
Reputation: 2167
if you want to know it in native code, than try doing like in hello-jni ndk sample android-ndk\samples\hello-jni\jni\hello-jni.c
#if defined(__arm__)
#if defined(__ARM_ARCH_7A__)
#if defined(__ARM_NEON__)
#if defined(__ARM_PCS_VFP)
#define ABI "armeabi-v7a/NEON (hard-float)"
#else
#define ABI "armeabi-v7a/NEON"
#endif
#else
#if defined(__ARM_PCS_VFP)
#define ABI "armeabi-v7a (hard-float)"
#else
#define ABI "armeabi-v7a"
#endif
#endif
#else
#define ABI "armeabi"
#endif
#elif defined(__i386__)
#define ABI "x86"
#elif defined(__x86_64__)
#define ABI "x86_64"
#elif defined(__mips64) /* mips64el-* toolchain defines __mips__ too */
#define ABI "mips64"
#elif defined(__mips__)
#define ABI "mips"
#elif defined(__aarch64__)
#define ABI "arm64-v8a"
#else
#define ABI "unknown"
#endif
return (*env)->NewStringUTF(env, "Hello from JNI ! Compiled with ABI " ABI ".");
Upvotes: 3
Reputation: 415
Check your Processor Architecture using android framework api. According to that particular .so loaded.
Upvotes: 0