Many Android Devices will be using Atom processor in future. This means that when creating an app that could be deployed to on an Atom processor device, it will be necessary to include a native library for atom as well as x86 processor. So my question is how can one detect which processor is on the device before deciding which native library to load? What is the best way to select which library to load?
Many Android Devices will be using Atom processor in future. This means that when
Share
You don’t need to dected anything manually. Just build your library targeted x86 by specifiying correct APP_ABI in Application.mk file (read the docs\Application-mk.html file from ndk distribution):
Using that you will get three libraries under libs folder. Android will automatically pick correct one during runtime.
If you need to detect at runtime, you can use cpufeatures library that is distributed with NDK. It provides following function:
If you need to perform same functionality in Java side you should read /proc/cpuinfo file and analyze its contents.