Android ndk is the abbreviation of Native Development Kit running on the Android platform. Android app developers can call C or C ++ local code through ndk.
Functions of ndk:
1. Code protection, because the Java-Layer Code of APK is easily decompiled, it is difficult to reverse the C/C ++ library.
2. Call a third-party C/C ++ library in ndk, because most open-source libraries are written in C/C ++ code.
3. Ease of transplantation. The C/C ++ library can be used again on other embedded platforms.
The following describes how to install and configure ndk.
Environment: ubuntu10.10 (ndk can only be installed in Linux) has been installed in the android Development Environment
1. Download
You cannot access the Google pages in China, but you can download them directly from the address below.
Http://dl.google.com/android/ndk/android-ndk-r8b-linux-x86.tar.bz2
2. Extract
I am used to placing things in the/usr/local/lib folder.
Command to be used:
// Copy the file CP android-ndk-r8b-linux-x86.tar.bz2/usr/local/lib // extract the file tar jxvf android-ndk-r8b-linux-x86.tar.bz2 // modify the permission chmod 777 android-ndk-r8b-R
3. Modify Environment Variables
Terminal running: gedit ~ /. Bashrc
Add the following statement
#NDK settingNDK_ROOT=/usr/local/lib/android-ndk-r8bexport NDK_ROOT
Save, terminal run: Source ~ /. Bashrc
Make it take effect immediately.
Run echo $ ndk_root on the terminal
If the ndk path is printed correctly, the environment variable is modified successfully.
4. Test
CD enters the android-ndk-r8b/samples/Hello-JNI and then runs the ndk compilation script on the terminal:
sudo /usr/local/lib/android-ndk-r8b/ndk-build
If the result is as follows, the ndk is successfully installed.
Reference
Install Ubuntu ndk-http://blog.csdn.net/hdhd588/article/details/6688228