如何使用其他应用程序我的自定义库apk文件 [英] How to use my custom library apk file in other applications

查看:105
本文介绍了如何使用其他应用程序我的自定义库apk文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有自己的定制库apk文件(比如lib.apk)及我想使它 可用于其他的应用程序。 如何提供应用库在Android manifest.xml文件中 其他应用程序,以便使用我的自定义库。

I have my own custom library apk file (say lib.apk) & i want make it available to other applications. How to provide the uses-library in the android manifest.xml file in other apps so as to use my custom library.

推荐答案

<使用库> 元素是提供作为扩展固件加载项。 AFAIK,它不会对您的方案中使用。

The <uses-library> element is for add-ons supplied as extensions to the firmware. AFAIK, it will not be usable for your scenario.

最有可能的,你将需要实现暴露通过AIDL的API,或者使用一组记录意图的行动交换与其他应用程序,或者将数据公开服务一个的ContentProvider

Most likely, you will need to implement a service that exposes an API via AIDL, or uses a set of documented Intent actions to exchange data with other applications, or exposes a ContentProvider.

另外,打包code作为JAR,而不是一个APK。你可以看到许多这样的例子在我的GitHub库(所有cwac-那些遵循这个模式)。

Otherwise, package your code as a JAR, not an APK. You can see many examples of this in my github repositories (all of the cwac- ones follow this pattern).

这篇关于如何使用其他应用程序我的自定义库apk文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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