ArticleDirectory
- Cygwin Installation
- Development
- Document
- Debugging
You can use this SDK for C/C ++ development.CodeIs a key part.
The android ndk is a complement to the android SDK that helps you:
-Generate JNI-compatible shared libraries that can run on the android
1.5 platform (and later) running on arm CPUs.
-Copy the generated shared libraries to a proper location of your
Application Project path, so they will be automatically added to your
Final (and signed). apks
Cygwin Installation
Http://www.cygwin.com/download and installProgram
You can download the package first and then install it. download all the 1.7 GB packages. The size after installation is 5.6 GB.
Development
Command Line Compilation
Note that environment variables are set according to the "prerequisites (JDK and environment variables)" to find the cygwin and ndk directories.
Compile the ndk sample file under the cygwin command line.
IDECompiling
ADT
Http://dl-ssl.google.com/android/eclipse/
CDT
Http://download.eclipse.org/tools/cdt/releases/helios
Use the above address to install ADT and CDT online for compilation.
Note:
The following is the configuration of a specific ndk Project (hello-JNI). You need to place the builder created by ndk in the first one (the newly added builder is set to ndk_builder)
In this way, the IDE will first compile the ndk file when compiling this project.
Hello-JNI example
Compile ndkLibrary files
In eclipseOpen project [Because ndkIDEThe function is not very powerful, and CDT can be disabled., Use the above command line to compile the library]
At this time, you can integrate the tracking with the interface
Document
Android-ndk-r5 \ docs can see the document, including make file format, file structure and so on can see
Debugging
Ndk debugging is currently weak. You can use the CDT or Visual Studio debugging library file.
Reference: http://zhoujianghai.javaeye.com/blog/897212