Android JNI NDK Eclipse 设定(避免出现重复build的设定方法)
2011-09-06 14:28
453 查看
When editing native JNI code in an Android project using the
Android NDK you may configure Eclipse to automatically rebuild your project when editing native code, just as it does for java. The below steps shows how to perform the necessary configuration (note that this requires revision 4 or later of the NDK - previous
revisions does not contain the necessary
Start by right clicking on your android project (named hello-neon in the below screenshots) with JNI resources, and select
A new dialog will open presenting a list of builder types. Select the
In the
Name: NDK Builder Location: /opt/android-ndk/ndk-build (or wherever your ndk-build binary is). You may use a variable as in ${system_property:user.home}/lib/android-ndk/ndk-build
Working Directory: ${workspace_loc:/hello-neon} (replace hello-neon with your project name. Press the
The result should look something like the below:
Now continue with the refresh tab. Make sure the two checkboxes
Since the ndk-build process will generate files in the lib folder, we want Eclipse to discover changes made there without having to refresh manually. So select the lib folder in the project (create one if necessary) and press the
Now skip the
Since the NDK build only needs to happen when editing files in the
Now finally press
http://mobilepearls.com/labs/ndk-builder-in-eclipse/
Android NDK you may configure Eclipse to automatically rebuild your project when editing native code, just as it does for java. The below steps shows how to perform the necessary configuration (note that this requires revision 4 or later of the NDK - previous
revisions does not contain the necessary
ndk-buildbinary):
Start by right clicking on your android project (named hello-neon in the below screenshots) with JNI resources, and select
Properties. In the resulting dialog, choose the
Buildersentry in the list to the left and press the
New...button:
A new dialog will open presenting a list of builder types. Select the
Programtype and press the
OKbutton:
In the
Maintab, fill in the following:
Name: NDK Builder Location: /opt/android-ndk/ndk-build (or wherever your ndk-build binary is). You may use a variable as in ${system_property:user.home}/lib/android-ndk/ndk-build
Working Directory: ${workspace_loc:/hello-neon} (replace hello-neon with your project name. Press the
Browse Workspace...button to select it graphically)
The result should look something like the below:
Now continue with the refresh tab. Make sure the two checkboxes
Refresh resources upon completion.and
Recursively include sub-foldersare checked. Choose the
Specific resourcesradio button and press the
Specify Resources...button:
Since the ndk-build process will generate files in the lib folder, we want Eclipse to discover changes made there without having to refresh manually. So select the lib folder in the project (create one if necessary) and press the
Finishbutton:
Now skip the
Environmenttab and go to the final
Build Optionstab. Make sure the
Run the builder: During auto buildscheckbox is checked.
Since the NDK build only needs to happen when editing files in the
jnifolder, check that folder and press the
Finishbutton.
Now finally press
OKin the builder configuration dialog - the new NDK builder should now be up and running. Try editing any file in the
jnifolder and check that the
Consoleview produces output from the build process:
http://mobilepearls.com/labs/ndk-builder-in-eclipse/
相关文章推荐
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自己主动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- android Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 将应用代码由eclipse导入Android studio的方法NDK-Build和Cmake两种方法(以android_serialport_api为例)
- NDK导入Eclipse CDT出现jni.h找不到解决方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- 【Android】Eclipse自动编译NDK/JNI的三种方法
- NDK导入Eclipse CDT出现jni.h找不到解决方法
- 【Android】Eclipse自动编译NDK/JNI的方法
- eclipse中导入android ADT-20.0.3出现的一个错误及解决方法
- 解决NDK开发中Eclipse报错“Unresolved inclusion jni.h”的最终方法