Savail Savail - 5 months ago 20
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:

Application.mk

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


Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on

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

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

include $(BUILD_SHARED_LIBRARY)


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
armeabi-v7a
, or actually every device will be able to run it? Maybe I should insert
APP_ABI := all
as mentioned here? http://developer.android.com/intl/ja/ndk/guides/application_mk.html

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

Answer

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.

Comments