使用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(安卓)系统名字、版本、API level的对应关系
- Android获取手机中的所有音乐地址
- android 源码获取
- Android沉浸式通知栏的一个开源库SystemBarTint简单使用,android
- android 随手记 --byte String inputstream 之间的转换
- Android(安卓)系统名字、版本、API level的对应关系
- android 开源自组织网络开源包
- Android获取移动设备的IP地址