原文地址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:

使用eclipse进行android C/C++ 开发环境搭建_第1张图片

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

使用eclipse进行android C/C++ 开发环境搭建_第2张图片

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:

使用eclipse进行android C/C++ 开发环境搭建_第3张图片

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:

使用eclipse进行android C/C++ 开发环境搭建_第4张图片

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:

使用eclipse进行android C/C++ 开发环境搭建_第5张图片

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

使用eclipse进行android C/C++ 开发环境搭建_第6张图片

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

使用eclipse进行android C/C++ 开发环境搭建_第7张图片

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:

使用eclipse进行android C/C++ 开发环境搭建_第8张图片



更多相关文章

  1. Android图片旋转,缩放,移位,倾斜,对称
  2. Android Imageview图片旋转和大小变化
  3. Android环境搭建问题的解决:Failed to fetch URL http://dl-ssl.g
  4. Android NDK开发(一)环境搭建及运行示例
  5. android高效读取大图片 防止OOM
  6. App自动化测试--Android环境搭建
  7. android 根据Bitmap bitmap 保存图片到手机上

随机推荐

  1. Android(安卓)Intent (2) Serializable v
  2. push研究——Apache Mina探索初步
  3. Could not find *****/adb.exe!的解决方
  4. Android介绍
  5. Android中UI设计的一些技巧!!!
  6. Android布局 android:gravity 和 android
  7. Android模拟器学framework和driver之batt
  8. init进程【1】——init启动过程
  9. Android(安卓)UI开发专题(一) 之界面设计
  10. 关于android组播DatagramPacket不能正常