When using JNI one typically uses javah to generate a C header containing the constants and function declarations for classes that contain native methods.
This patch lets SBT run javah to generate the header file for a given set of classes.
Setting jniClasses in Android specifies the classes with native methods for which C headers should be generated.
jniClasses in Android
By default, javah will generate a separate C header file for each JNI class. To generate a single C header file instead, set javahOutputFile in Android.
javahOutputFile in Android
The make environment variable SBT_MANAGED_JNI_INCLUDE can be used to refer to the directory containing the generated header files.
LOCAL_C_INCLUDES += \
For more details see the settings defined in AndroidNdkKeys.
run javah to generate JNI C header files
Support javah single file output for native code
- "javah .. -o foo.h .." support by setting
javahOutputFile := "foo.h"
Merge branch 'master' of https://github.com/jberkel/android-plugin
Thanks! If you've got some time could you update the wiki?