1. Cross-compiling files under Linux are mainly in. elf format files executed under window are. EXE JNI is the link between the two Google offers a tool-ndk
2. Step: 1. In Java, define the method public native String SayHello (); &NBSP;2. Create a JNI folder in your project and create a hello.c file where you write C code; 3. First declaration #include <stdio.h> #include < stdlib.h> #include <jni.h>//jobject jobj who called the This method refers to who is currently mainactivity.this jstring Java_com_andson_jnihellodemo_mainactivity_sayhello (jnienv* env,jobject jobj) {} 4. Create and write Android.mk (create associated file) (labeled C file and library file) file in ADT file 5. Run cmd ndk-build (compile) &NBSP;6 in the project file. Load the dynamic-link library system.loadlibrary ("Andson") before calling the method in Java; Note: 3. As long as the C code changes need to be recompiled; 4. If there is an underscore in the Java method You need to add 1 in C code; You can also use the Javah method to generate the header file 5. What is supported to run the system is to see if at the time of compiling the Application.mk file to choose whether the relevant system 6. Android tool Add native surpport change file to C
Simple steps for Android to invoke JNI