If you already correctly put your .so
file into jniLibs
folder, the next step is to load ilinrary into memory and call methods from it. You can load library statically:
// Load that <your_lib_name>.so file
static {
System.loadLibrary("<your_lib_name>");
}
Then you need to declare the function according <your_lib_name>.so
exported functions, e.g.:
private static final native <type_of_result> <function_name>(<type_of_param1> param1, <type_of_param2> param2);
and then you need to call the declared native function from Java:
(param1, param2);
Or you can load library dynamically via dlopen()
like in this answer:
void *handle;
handle = dlopen("<your_lib_name>.so", RTLD_NOW);
...
// when you need old .so e.g. in onCreate()
OldSoHelper.loadOldSo();
...
// when you no need to call function from old .so
<TYPE_OF_RESULT> result = OldSoHelper.runFunFromOldSo(<PARAMETERS>);
...
// when you no need old .so e.g. in onDestroy()
OldSoHelper.unloadOldSo();
...