在新项目的Andr​​oid使用prebuilt共享库(的.so) [英] Using prebuilt shared library (.so) in new project Android

查看:120
本文介绍了在新项目的Andr​​oid使用prebuilt共享库(的.so)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能做到这一点无需重新编译本地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.

这篇关于在新项目的Andr​​oid使用prebuilt共享库(的.so)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆