Android ndk Installation

Source: Internet
Author: User

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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.