Building a C ++ static library for use with Java on Android
Use Android NDK
They have a sample
$ make APP = hello-jni - compiles hello-jni.c and outputs the shared library to / apps / hello-jni / project / libs / armeabi / libhello-jni.so
a source to share
You can scroll down the Google NDK page to get some information. You can also check OVERVIEW.TXT in the NDK folder after downloading it to see how to get started.
Generally speaking, you need to build your shared library using the NDK and then import the shared library (like libExample.so) into your Android Java project. Native functions must be declared in a Java project using the native keyword. You need to explicitly load your library by adding (following my example):
static
{
System.loadLibrary("Example");
}
When you create a Java application, it must make its way into your own library code when you call your own functions.
a source to share