android ndk/jni

来源:互联网 发布:java读取相对路径文件 编辑:程序博客网 时间:2024/05/06 17:56

1.命令行编译

  cd <project>  $ <ndk>/ndk-build
  1. 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编译

0 0
原创粉丝点击