Android NDK supports different CPU architectures such as ARMv5TE and ARMv7-based devices, x86, and MIPS (big-endian architecture). We can create fat binaries that can run on any of the supported platforms.
Find out the architecture of your Android-based device. You can do it using the adb
command as follows:
>adb shell cat /proc/cpuinfo
The following are the two approaches to pick an appropriate set of CPU architectures:
By default, the NDK will generate the code for ARMv5TE-based CPUs. Use the parameter
APP_ABI
inApplication.mk
to select a different architecture, for example (use only one line from the following list):APP_ABI := armeabi-v7a APP_ABI := x86 APP_ABI := mips
We can specify multiple architectures to create a fat binary that will run on any of them through the following command:
APP_ABI := armeabi armeabi-v7a x86 mips