Building Android NDK applications for different CPU features
Many projects use native code to improve performance. One advantage of developing in NDK over SDK is that we can build different packages for different CPUs, which is the topic of this recipe.
Getting ready
Please read the Building Android NDK application for different ABIs recipe before going through this one.
How to do it…
The following steps build Android NDK applications for different CPU features.
At Eclipse, click on File | New | Other. Select Android Project from Existing Code under Android as shown in the following screenshot. Then click on Next:
Browse to the
samples/hello-neon
folder of the Android NDK folder. Then click on Finish.Start a terminal, then go to the
samples/hello-neon/jni
folder. Type the command "ndk-build
" to build the binaries.Run the Android project on different devices and emulators. Based on your device/emulator ABI and availability of the NEON feature, you should be able to see the results as follows...