There are only three simple steps. The official website is very concise, comprehensive, and admired.
【
Preparation]
1. Eclipse (Indigo)
2. ADT:This is nothing more than adding an android installation source to eclipse. If NDK Plugin is selected here, CDT will be automatically installed;
3. NDKAndroid-ndk-r9d-windows-x86_64)
Address: http://developer.android.com/tools/sdk/ndk/index.html#Installing select your desired version;
Below are a few simple configurations:
[Configuration A] After NDK and CDT are installed, You can see similar pages in project properties,
Once and for all, you can add the NDKROOT path to the NDK path you decompress in the system environment variable,
Configure B and add the header file for compiling c/c ++]
At this time, the compilation will prompt std unresolved or something. Add the header file containing path. You can check apply to all configuration;
Open Project Properties-> C/C ++ General-> Paths and Symbols and add the followingIncludePathsC ++:
# for NDK r8 and prior:${NDKROOT}/platforms/android-9/arch-arm/usr/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include${ProjDirPath}/../../sdk/native/jni/include
# for NDK r8b and later:${NDKROOT}/platforms/android-9/arch-arm/usr/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include${ProjDirPath}/../../sdk/native/jni/include
Test]
In this way, the sample of the import OpenCV-2.4.6-android-sdk comes in for testing, note that if you selectCopyTo workspace (it is best not to copy, because many codes in the sample use the sdk and take relative paths ), you need to add the include path to the sdk's jni/include path, that is, the relative path in the green background above, because your removal has no effect.
So now, there is no shortage of apk, and no three steps are required;
EnjoyIT,
[Non-Editor ]:
Http://developer.android.com/tools/sdk/ndk/index.html#Installing not only has a variety of ndk versions, the use of ndk in this address is also concise.
For example, there are two methods to use NativeCode: 1 ). the well-known JNI. The disadvantage of this method is that different libraries need to be compiled for different platforms (. so), such as common arm-eabi, armv7, and arm-eabi-withNeon versions; 2 ). nativeActivity is similar to the Java activity lifecycle callback function in the Android mechanism.