我有想要在 Android 应用程序中使用的C 代码 ( testFile .c),使用 JNI。这段代码包含纯C代码,里面有很多方法。此外,它还调用了一些 C 头文件(file1 .h、file2 .h)。
例如: testFile .c
#include "file1.h"
#include "file2.h"
void myMethod1()
{
...
...
}
void myMethod2()
{
...
...
}
void myMethod3()
{
...
...
}
我是否必须将整个testFile .c 转换为 JNI 代码,或者只是转换一些我稍后将使用的方法(不是全部)?我还应该在头文件(file1.h 和 file2.h)中转换 c 代码,还是只在 testFile.c 中转换 c 代码?