Savail Savail - 1 year ago 69
Android Question

Android NDK build to support all available devices

I am using in my project both java files and native c++ code. I would like to make the app available for all devices and hardware (API lvl >= 15). I am also using OpenCV4Android both in java and my native c++ if that matters. I'm not quite sure if my current configuration is sufficient to support all available hardware:

APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-9

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)


include C:/OpenCV4Android/OpenCV-android-sdk/sdk/native/jni/

LOCAL_MODULE := myNativeLib
LOCAL_SRC_FILES := myNativeLib.cpp
LOCAL_LDLIBS += -llog -ldl


I have tested this configuration on a few devices and it seems to work but doesn't
APP_ABI := armeabi-v7a
narrow down the supported devices to only those with
, or actually every device will be able to run it? Maybe I should insert
APP_ABI := all
as mentioned here?

It is very important to me to make the app responding and working for all devices possible.


To support all platforms you should use APP_ABI := all . For API 15 use APP_PLATFORM := android-15. Pay attention that the more platforms you will support the larger your apk file will be, since it will create a binary for each supported platform in your APK.