1. JDK1.6, go to the project's Bin directory under the classes directory:
Use command: Javah packagename.classname
A header file is generated in the current directory, and the JNI protocol method is found from the scratch file
The following example shows:
(1) Enter the "02_ two numbers added" project, as follows:
(2) Enter into the bin/classes directory, as follows:
(3) Type cmd directly in the path bar, then enter as follows:
Enter the bin/classes/directory below the project as follows:
(4) Use command: Javah packagename.classname (CAN), here My computer does not, there is an error, no solution.
2. JDK1.7 (hereafter), enter the project SRC directory:
Use command: Javah packagename.classname
The header file is generated in the current directory, and the JNI protocol method is found from the scratch file
(1) Enter the "02_ two numbers added" project, as follows:
(2) Enter the src/directory, as follows:
(3) use command: Javah packagename.classname
(4) Open this file Com_himi_add_mainacitivity.h, as follows:
Android (Java) Learning Note 260:jni Native method header file generation