1

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.

4

2 回答 2

2

当从一个共享库调用另一个共享库时,它实际上不再是 jni,它只是本机代码(c->c 或 c++ -> c++)。包括 .h 并像往常一样调用函数,传递函数所需的任何参数。

于 2013-10-03T19:21:53.553 回答
0

我认为您可以这样做dlopen("lib2.so")lib1.so这样您就有了lib2.so库的句柄,然后使用该句柄可以调用方法。

于 2013-10-03T19:14:39.270 回答