I have an Android application that loads libraries for armv6 and armv7a. When I run application in a Samsung SII it loads libraries for armv6.
Samsung SII has a armv7 neon processor, it should load armv7a libraries.
I have tested same application in Samsung SIII and it loads armv7a libraries.
any idea?
Thank you.
I suspect this comes from the System.loadLibrary() bug described here.
To sum it up, on some versions of the Android SDK from Ice Cream Sandwich, this function (which is supposed to find all the libraries with the right name and choose the one compiled for the right architecture) is messed up, and can choose the wrong architecture. I suspect that is what’s happening to you here.
The solution we found is to give different names to the libraries according to their architecture, and choose yourself which one you want to choose. This way, the system won’t have to disambiguate between several libs with the same name.
For this, you’ll first have to detect which architecture you are running on: this can be done either in native code using
cpu-features.hcontained in the NDK, or you can parse/proc/cpuinfoin Java. Once you have found the architecture of your device, load the right library. In pseudo-code, that would become:Hope this helps!