The JNI related NDK Builder environment configuration for Android
NDK Builder: http://pan.baidu.com/s/1o6462gi
Run->external tools->external Tools configurations ...
Double-click Program to add a tool
Name: Ndk_builder (You can write anything you want)
Location : D:\adt-bundle-windows-x86-20130917\android-ndk-r7b\ndk-build.cmd (This is the path of my ndk-build.cmd)
working Directory: ${project_loc}
Refresh this configuration:
use:
Javah Configuration
This tool is primarily responsible for the creation of. h header files, reducing the likelihood of our writing errors.
Run->external tools->external Tools configurations ...
Double-click Program to add a tool
Name: javah (whatever you write)
Location : D:\Program Files (x86) \java\jdk1.7.0_45\bin\javah.exe (this is the path of my Javah.exe)
working Directory: ${project_loc}
Arguments:
"${project_loc}/bin/classes""${project_loc}/jni" -jni ${java_type_name}
Android.mk
#当前文件的路径LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)#对应打包成函数库的名字LOCAL_MODULE:=myclass#对应C语言代码文件LOCAL_SRC_FILES:=JavaToC.c Operate.h Operate.c#表示允许打印LogLOCAL_LDLIBS += -llog#指明NDK编译时将生成一些共享库include $(BUILD_SHARED_LIBRARY)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The JNI correlation of Android