NDK Environment Build + HELLOJNI_NDK Environment

Source: Internet
Author: User
It's not a success to follow the official documents, and then the long set of families will build the environment, and the following steps will be made if your eclipse can already compile and run the Android application. If your eclipse is not able to run the Android program, take this one step further and look at the article.
1. To download the latest NDK to the official website, the current ndk are integrated Cygwin, do not have to install another Cygwin. Current Latest Version Android-ndk-r12b-windows-x86_64.zip official download address (before the ladder to access) Https://developer.android.com/ndk/downloads/index.html#rel
2. Extract android-ndk-r12b-windows-x86_64.zip to get directory D:\android_SDK\android-ndk-r12b-windows-x86_64\android-ndk-r12b


3. Specify the NDK path to open eclipse--->windwos---->preference--->android---->ndk, D:\android_SDK\ android-ndk-r12b-windows-x86_64\android-ndk-r12b \build Note that you don't miss the build, or you'll find Eclipse prompts invalid path for NDK. This is very strange, the official website is said to extract the directory path, but the actual need to enter the build directory to do.
4. Configure system environment variables this is the decompression path, without a build. D:\android_SDK\android-ndk-r12b-windows-x86_64\android-ndk-r12b;
5. Test NDK The success of the environment in the command line to enter a random directory Ndk-build, prompted the following to indicate success


6. Download a JNI instance from GitHub to run down to try downloading the address Https://github.com/han1202012/NDKHelloworld.git unzip the file and import the project to eclipse, right key engineering---> Android Tools--->add Native Support---> Finish


7. Compile the C file into the. so file (dynamic link library) from the command line into the Hello JNI project directory, execute ndk-build the following prompts to indicate success. (c file to recompile the dynamic link library every time it changes)


8. Run the project and fix it.

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.