1.命令行编译
cd <project>
$ <ndk>/ndk-build
- ant编译
Call ndk-build from your -pre-build target, like this:
<target name="-pre-build">
<exec executable="${ndk.dir}/ndk-build" failonerror="true"/>
</target>
<target name="clean" depends="android_rules.clean">
<exec executable="${ndk.dir}/ndk-build" failonerror="true">
<arg value="clean"/>
</exec>
</target>
Then you can set ndk.dir to point at the NDK directory from your local.properties file, or set it on the command line. I do this:
ant -Dsdk.dir=/home/dg/apps/android-sdk-linux_x86-r11/ -Dndk.dir=/home/dg/apps/android-ndk-r6b release
Now running ant will build your native code automatically. Plus, running ‘ant clean’ will clean your native code.
3.eclipse编译
http://mobilepearls.com/labs/ndk-builder-in-eclipse/
http://blog.csdn.net/zgzhaobo/article/details/39373043
http://www.cnblogs.com/chenjiajin/archive/2012/04/12/2444188.html
4.android studio编译