小贴士组织大型的Andr​​oid项目? [英] Tips on organizing larger Android projects?

查看:208
本文介绍了小贴士组织大型的Andr​​oid项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前的项目变得越来越大不亦乐乎。我有几十个活动,适配器,碎片,布局XMLS和其他资源。

My current project is getting awfully large. I have dozens of activities, adapters, fragments, layout xmls, and other resources.

在我的(小)previous项目,我组织了东西,有1包/ 1类风格。所以我不得不com.stuff.xy.adapter,com.stuff.xy.activity,等等。现在,这些包包含了太多的项目,我发现自己浪费大量的时间寻找在包层次结构中的特定类。

In my (smaller) previous projects I organized stuff with a 1 package / 1 category style. So I had com.stuff.xy.adapter, com.stuff.xy.activity, and so on. Now these packages contain too many items, and I find myself wasting considerable amounts of time searching for a specific class in the package hierarchy.

我使用Eclipse,还有一些快捷键可以使用(去上课的定义,例如),但这些往往是情境(我不能用它来快速跳转到布局definiton XML)。

I use Eclipse, and there are some shortcuts one can use (go to class definition e.g.), but those tend to be situational (I can't use that to quickly jump to a layout definiton xml).

你能不能分享关于有效组织的大型项目有哪些技巧?或者一些插件这也许? (它可能会帮助,例如,如果我能集团是处理特定应用程序的屏幕一起源文件 - 适配器,布局,活动和片断code - 这样我就可以快速打开它们)

Could you share some tips on organizing large scale projects efficiently? Or some plugins for this perhaps? (It might help for example if I could group together source files that deal with a specific application screen - adapters, layouts, activity and fragment code - so I can quickly open them)

编辑:经过数月开发大型项目

After many months developing large projects

首先,我试图去工作集的Eclipse。它并没有真正削减对我来说,我的问题是,我们唯一的Andr​​oid项目简直太大了,包含许多资源类,接口等,在单个项目的环境中工作组瞎搞只是把太多的时间,我认为他们主要是用组织工程在单一工作空间。

First I tried to go with working sets with Eclipse. It didn't really cut it for me, my problem was that our single Android project was simply too big, containing many resources, classes, interfaces, etc. Messing around with working sets in the context of a single project just took too much time, I think that they're mainly useful to organize projects in a single workspace.

在从长远来看,我们分开了庞大的一个项目分成许多小的Andr​​oid库项目和一个单一的主要应用项目,取决于所有这些较小的。通过这种方式,我们可以这些库项目中拆分资源(有许多布局,价值观,风格,只用于某些部件的应用程序)和$ C $,当然℃。我还创建了一个基本库,所有其他库依赖于,并包含资源和(基)类,每一部分所需要的应用程序。

On the long run we separated our huge single project into many smaller android-library projects and a single "main application" project that depended on all these smaller ones. This way we could split the resources among these library projects (there were many layouts, values, styles that were only used in certain parts in the application) and code of course. I also created a Base library, that all other libraries depended upon, and contained resources and (base)classes that every part of the application needed.

推荐答案

在Eclipse中,你可以使用<一个href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/cworkset.htm">Working集的过滤在Project Explorer视图源/布局/资源文件。这是更强大的比包了一下,因为它运行在所有文件,包括布局和图像资源,而不仅仅是Java源文件。

In Eclipse, you can use Working Sets to filter your source/layout/resource files in the Project Explorer view. This is a bit more powerful than packages, since it operates on all files including layout and image assets, not just java source files.

例如,您可以创建一个包含HomeActivity.java,HomeAdapter.java,RES /布局/ home.xml,RES /绘制/ home_icon.png等一家庭工作组。

For example, you could create a Home working set which contains HomeActivity.java, HomeAdapter.java, res/layout/home.xml, res/drawable/home_icon.png, etc.

这篇关于小贴士组织大型的Andr​​oid项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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