问题描述
我怎么能做到这一点无需重新编译本地code和所有的东西吗?
How I can do this without compile again the native code and all stuff?
推荐答案
好像你可能做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.
这篇关于在新项目的Android使用prebuilt共享库(的.so)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!