This article only introduces how to configure the compiling environment of android ndk in windows.
I,
1. Download the Android NDK package from the google official website. Download the package http://developer.android.com/tools/sdk/ndk/index.html#to decompress it to e:#android=android-ndk.
2. Download and install Cygwin. For windows systems, cross-Compiling is required. Therefore, a Linux simulator Cygwin must be installed. Download To http://www.cygwin.com.
3. Configure the development environment of Cygwinde NDK. By default, Cygwin is installed in the root directory of drive c and changed to c: // cygwin/home/username. The username in the bash_profile file varies according to the user name. Add the following code at the end of the. bash_profile file:
ANDROID_NDK_ROOT =/cygdrive/e/android-ndk
Export ANDROID_NDK_ROOT
The code above illustrates the directory where android ndk is located
The last step is to test whether the development environment works normally. First start Cygwin, then switch to the/build directory and run the host-setup.sh file. If
Till now, the compilation and configuration of huaning has been completed.
The android ndk installation directory contains five subdirectories.
+ Apps is the directory for saving android projects. Hello-jin and tow-libs are two examples directories that come with NDK.
+ Build saves the cross-compilation tools, compilation scripts, and configuration files.
+ Docs is the directory for saving help documents.
+ Out is a cross-compiled output directory that stores the output so files.
+ Sources is the directory for saving C/C ++ source code files. The following are the hello-jin and tow-libs subdirectories, the C/C ++ source code files required for the NDK built-in examples are respectively saved. The GNUmakfile and README. TXT files are the configuration files of the make tool and the description files of the NDK.
II,
The following steps are required for android ndk development:
1. Create an Application. mk file.
2. Create an Android Project
3. Home Android. mk File
4. Create a c source code file
5. Compile the shared library module
6. Run the Android program.