Android ndk (1) hello-JNI

Source: Internet
Author: User

1. download the ndk-r7b, because R7 and later versions inherit cygwin, (make GCC), so after downloading and unzipping, even if the environment is configured, it is best to restart the installation of the next CDT, to facilitate the compilation of C code in eclipse

2. Get started with importing hello-JNI. I am too lazy to copy the official website. I believe I can understand it.

ClickFile> new Android project...

SelectCreate project from existing sourceRadio button.

Select any API level above Android 1.5.

InLocationField, clickBrowse...And select<ndk-root>/samples/hello-jniDirectory.

ClickFinish.

3. Compile Builder

The documents provided on the official website are not understood. Other methods are used here.

(1) Right-click the project and choose Properties> builders> New low.oin.
Configure the path to the ndk-build.cmd, and working directory selects the project to compile

(2) Refresh resources upon completion


(3) Check build
Options during auto builds and specify working set of relevant resources


(4) Click specify.
Resources hooks the JNI folder. This check box tells the builder to compile only the files in this folder. If the entire project is compiled, the computer will scream.


(5) console print information, the project has libs/armeabi/libhello-jni.so and OBJ folder


4. Run the program and the result is displayed. You can have a silver heron to celebrate.


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.