且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在新项目的Andr​​oid使用prebuilt共享库(的.so)

更新时间:2023-11-16 10:56:16

好像你可能做JNI来此库。如果是这样的话,Java包和类名必须在恩的JNI函数的名称codeD,所以你必须做一些事情,如:

It seems like you are probably doing jni to this library. If that is the case, the java package and class name needs to be encoded in the names of the jni functions, so you would have to do something such as:


  • 始终保持相同的名称Java包和类文件实际上接口的机库。这的的需要为APK匹配主包名称。您可能希望使这一类包装器的机库。

  • Always keep the same name for the java package and class file which actually interfaces to the native library. This does not need to match the main package name for the APK. You may want to make this a sort of wrapper for the native library.

或者你可以使用它只是一个包装调用原来的库由它的原始函数名新包的名字创建一个新的机库。这将是一个比较复杂设置比previous想法。

Or you could create a new native library using the new package name which is just a wrapper calling the original library by it's original function names. This will be a bit more complicated to set up than the previous idea.