AndroidStudio create JNI method

New Native C ++ project
Here Insert Picture Description

Add test01 method in the MainActivity.java
Here Insert Picture Description

Create a method 1 jni old ways

Select the java directory, right click -> Open in Terminal
Here Insert Picture Description
Enter the following statement at the command line:

javah com.hongx.jni.MainActivity

View generate the following files:
Here Insert Picture Description

Method 2 new ways to create jni

Select test01 method name, and then use the code hints option + enter (mac computer) button,
Here Insert Picture Description
automatically created jni method, as follows:
Here Insert Picture Description

Published 446 original articles · won praise 67 · views 240 000 +

Guess you like

Origin blog.csdn.net/hongxue8888/article/details/105088690