简体   繁体   English

我们可以从一个android ndk应用程序使用.so文件到另一个android ndk应用程序吗?

[英]Can we use .so file from one android ndk app to another android ndk app?

My question is that have created one android ndk project which is having its respective .so file.I want to know that can we use same .so file in another android ndk application without copying as it is from one project to another? 我的问题是已经创建了一个具有相应.so文件的android ndk项目。我想知道我们可以在另一个android ndk应用程序中使用相同的.so文件而不将其从一个项目复制到另一个项目吗? If yes how can we implement that? 如果是,我们如何实施?

是的,如果您在相同程序包的相同类中定义了相同的“本地”调用,则可以。

Native libraries are installed in lib directory for an application, which is readable for anyone. 本机库安装在应用程序的lib目录中,任何人都可以读取。 Therefore, appB can use 因此,appB可以使用

System.Load("/data/data/com.appA/lib/libnativeA.so")

But the guess of the full path to other package's libraries is not based on documented interfaces, and there is no guarantee this will work in future versions. 但是,对于其他软件包库的完整路径的猜测并不基于已记录的接口,因此不能保证此方法将在将来的版本中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM