原文地址http://mobilepearls.com/labs/ndk-builder-in-eclipse/

When editing native JNI code in an Android project using theAndroid NDKyou 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 necessaryndk-buildbinary):

Start by right clicking on your android project (with JNI resources, and selectProperties. In the resulting dialog, choose theBuildersentry in the list to the left and press theNew...button:


A new dialog will open presenting a list of builder types. Select theProgramtype and press theOKbutton:


In theMaintab, 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 checkboxesRefresh resources upon completion.andRecursively include sub-foldersare checked. Choose theSpecific resourcesradio button and press theSpecify 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 theFinishbutton:


Now skip theEnvironmenttab and go to the finalBuild Optionstab. Make sure theRun the builder: During auto buildscheckbox is checked.


Since the NDK build only needs to happen when editing files in thejnifolder, check that folder and press theFinishbutton.


Now finally pressOKin the builder configuration dialog - the new NDK builder should now be up and running. Try editing any file in thejnifolder and check that theConsoleview produces output from the build process:




更多相关文章

  1. 高德地图-Android-逆地理转换:经纬度转换成地址
  2. Android(安卓)系统名字、版本、API level的对应关系
  3. Android获取手机中的所有音乐地址
  4. android 源码获取
  5. Android沉浸式通知栏的一个开源库SystemBarTint简单使用,android
  6. android 随手记 --byte String inputstream 之间的转换
  7. Android(安卓)系统名字、版本、API level的对应关系
  8. android 开源自组织网络开源包
  9. Android获取移动设备的IP地址

随机推荐

  1. Android异步操作----AsyncTask类
  2. Android(安卓)使用WebView加载含有echart
  3. Android架构分析之Android智能指针(二)
  4. Android(安卓)最火的快速开发框架XUtils
  5. Android(安卓)Project from Existing Cod
  6. Android图形显示系统(一)
  7. Ubuntu for Android:共享同一linux内核,运
  8. Android的logcat用法
  9. Android(安卓)Studio中Xml的新建及shape
  10. ant script to obfuscate android code