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-jni
Directory.
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.