Description: New, not familiar with Java, forgive me.
1. New project, add good native support, write the corresponding file (including CPP file, so file and corresponding Java file, this is called the corresponding Java file is Sojar.java,).
2. Right-click the Sojar.java file, select Export, and select Jar file in Java.
Then set the path, all the way to finish. The corresponding jar file can be generated.
3. Put the generated Sojar.jar file into the new project's Libs directory (the old version of the possible steps is more complex, I use the Eclipse 23, do not need any other settings, directly into the line), put the libsojar.so file into the libs\ Armeabi directory (or the corresponding directory).
4. Write the code normally.
Sojar.somecode ();
Problem: One problem is that if you use the original so, you need 2s; if you use a jar package, you need 8s. For the time being, it is unclear why the speed gap is so large.
Main references:
Http://stackoverflow.com/questions/24773153/the-library-javacv-android-arm-jar-contains-native-libraries-that-will-not-run
Steps to package JNI-generated so into jars in eclipse