如何构建Android一个java code库? [英] How to build a java code library for Android?

查看:94
本文介绍了如何构建Android一个java code库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个机器人结构,如自定义对话框,拖和下降的实现,而且我在多个项目中使用其他的标准类。看起来既效率低下,不好的做法,把每一个结构的一个副本(每个国家都有它自己的一套资源和类保持)到每个项目。现在,如果我发现这些错误,我不得不到处改变它。

I have several android constructs like custom dialog boxes, drag-and-drop implementations, and other standard classes that I use in multiple projects. It seems both inefficient and bad practice to put a copy of each construct (each with its own set of resources and classes to maintain) into each project. Now if I find a bug in these, I have to change it everywhere.

良好做法将决定我包括作为一个单独的项目,或许是一个jar库,我的其他项目可以导入。这工作正常,是纯粹的Java类的结构,但对这些事情都与它们相关的Andr​​oid资源,我不知道是否有一种方法可以包括那些在某种程度上Android的资源编译器将识别一个罐子。

Good practice would dictate that I include that as a separate project, perhaps a jar library that my other projects can import. This works fine for constructs that are purely java classes, but some of these things have android resources associated with them and I don't know if there is a way to include those in a jar in a way the android resource compiler will recognize.

它甚至有可能建立一个罐子与Android资源包括(与自定义背景绘制或东西,即自定义对话框)?
如果可能的话,怎么样?

推荐答案

从来没有实现过这种类型的项目,但听到的 Android的库项目。也许这就是你的解决方案。

Never implemented this type of project but heard about Android library project. Maybe that's the solution for you.

这篇关于如何构建Android一个java code库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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