Reputation: 11
Is it possible to call jni method of 1 library from another method of different jni library ? for eg: I have 2 libraries lib_1.so and lib_2.so.
I want to call a method get_interface() of lib_1.so from lib_2.so.
Is this possible? If yes, please share the example of how this can be done.
Upvotes: 1
Views: 768
Reputation: 1765
When calling from one shared library to another, its really no longer jni, its just native code(c->c or c++ -> c++). Include the .h and invoke the function as you would normally, passing whatever parameters the function requires.
Upvotes: 2
Reputation: 48272
I think you can do dlopen("lib2.so")
from lib1.so
so you have a handle to your lib2.so
library and then using that handle you can call the methods.
Upvotes: 0