使用eclipse进行android C/C++ 开发环境搭建
原文地址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-build
binary):
Start by right clicking on your android project (with JNI resources, and selectProperties
. In the resulting dialog, choose theBuilders
entry in the list to the left and press theNew...
button:
A new dialog will open presenting a list of builder types. Select theProgram
type and press theOK
button:
In theMain
tab, 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-folders
are checked. Choose theSpecific resources
radio 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 theFinish
button:
Now skip theEnvironment
tab and go to the finalBuild Options
tab. Make sure theRun the builder: During auto builds
checkbox is checked.
Since the NDK build only needs to happen when editing files in thejni
folder, check that folder and press theFinish
button.
Now finally pressOK
in the builder configuration dialog - the new NDK builder should now be up and running. Try editing any file in thejni
folder and check that theConsole
view produces output from the build process:
更多相关文章
- Android图片旋转,缩放,移位,倾斜,对称
- Android Imageview图片旋转和大小变化
- Android环境搭建问题的解决:Failed to fetch URL http://dl-ssl.g
- Android NDK开发(一)环境搭建及运行示例
- android高效读取大图片 防止OOM
- App自动化测试--Android环境搭建
- android 根据Bitmap bitmap 保存图片到手机上