There are two ways to do this. One of them is outdated, but it still works, while the other requires that Android 5.0 or higher work on the phone.
Outdated way
If you want to support all current phones, you can use:
import android.os.Build; String ABI = Build.CPU_ABI;
New way
The newer method will actually provide a list of all supported ABIs, with the first index being the most preferred ABI to use ( API Link ):
import android.os.Build; String ABI = Build.SUPPORTED_ABIS[0];
Both methods have been tested to work on Android 5.1.1, they will return one of the following:
- armeabi
- armeabi-v7a
- armeabi-v7a-hard
- arm64-V8A
- x86
- x86_64
- MIPS
- MIPS64
Future ABIs should be listed here: https://developer.android.com/ndk/guides/abis.html#sa
source share