Extracts native methods from a Java file and generates the JNI bindings via python script. You should follow rule to generate corresponding jni interface.
-
Java call Native:the method should starts with native, such as
public static native boolean nativeLogin(String username, String password, String server, String roomEmail, String requestID); -
Native call Java: you should add the annotation @CalledByNative, such as
@CalledByNative
public static void sinkResponse(String response) {
}
- Add the files under base folder to you project.
- Run python jni_generator.py <java_file_path> <jni_header_file_output_path>
- You will get the JNI binding file
- Implementation the JNI interface and them to you project.
- python 2.x