在Eclipse中创建Android应用程序共享公共库 [英] Create Android apps in Eclipse sharing common library

查看:164
本文介绍了在Eclipse中创建Android应用程序共享公共库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是有可能创造Java库的应用程序可以使用共享?

is it possible to create java libraries the apps can use shared?

这是完全清楚,我如何创建一个库项目以及如何使用它,而另几个项目之间共享,编译每个项目分成不同的应用程序。
但是,在这种情况下,库被编译成分隔每个应用程序。

It is totally clear to me how to create a library project and how to use it while shared between several another projects, compile each project into different apps. But in this case the library gets compiled into each app separated.

我要的是建立一个图书馆,编译它,将它安装到设备(或仿真器)和几个应用程序调用到这个库。

What I want is to create a library, compile it, install it into the device (or emulator) and several apps calling into this library.

和需要改变某些事情的应用程序中使用这个库碎片的时候,我只是重新工作的库,重新编译它,取代它的设备(或仿真器),以及应用程序使用的新库,所有的应用程序使用新的功能。

And when it is needed to change something the apps use shard in this library, I just re-work the library, re-compile it, replace it on device (or emulator), and the apps use the new library, all apps use the new functions.

这可能吗?

我GOOGLE了它,但我无法找到解决方案。

I googled it, but I couldn't find the solution.

我使用WIN + Eclipse的,我不能使用native code(因为我只知道的Java)。

I am using Win + Eclipse, I can't use native code (since I know only Java).

感谢

更新:谢谢你的建议,我知道如何使用服务和活动,以分享功能显式启动。
我问了一下图书​​馆,因为我调查possibilites。如果没有办法使用公共库,是什么用途库的目的...在应用清单?

UPDATE: Thank you for your suggestions, I know about using Services and Activities started explicitly in order to share functionality. I asked about libraries because I am investigating the possibilites. If there is no way to use common library, what is the purpose of uses-library... in the app manifest?

感谢您

推荐答案

这更可能是你需要一个服务作为图书馆。你有没有考虑过这种可能性?您可以创建它作为一个单独的应用程序,定义一个接口为您服务,并在其他应用程序中使用它。因此,作为接口不改变这不会对其他应用的影响依赖于该服务。

It's more likely that you need a service as a library. Have you considered this possibility? You can create it as a separate application, define an interface for your service and use it in other apps. So as the interface does not change this will not influence on other apps that depends on this service.

这篇关于在Eclipse中创建Android应用程序共享公共库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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