5

Im going to develop a very large scale android project, which has thousands of classes and resources. Im planning to separate application in to modules and develop them separately as library projects. Later combine them together. (Application may contain 5 - 6 modules, so planning to create 5 - 6 library projects and combine them)

Is this approach ok? or android experts, please suggest a way to maintain and develop such a big project?


Edit:

Libraries hold shared code for multiple applications -> Yes agreed 100% true

But this project is like combination of several projects. Its like this:

Home Screen Dashboard has 8 buttons which represents 8 modules you click on one button - > it opens up an activity and it has its own thousands of fragments, layouts, drawables etc, which is independent from other modules

so likewise i have non interdependent use cases which can be separated easily, and 4 - 5 developers are going to be involved this project, so if I can separate in to several library projects, i can simply allocate developers easily based on modules(library projects)

So one approach is to create one project and create package structure by modules com.name.something.Module1

under this package i have

com.name.something.Module1.activity
com.name.something.Module1.util
com.name.something.Module1.widget
com.name.something.Module1.data
com.name.something.Module1.dao

and module 2

com.name.something.Module2

com.name.something.Module2.activity
com.name.something.Module2.util
com.name.something.Module2.widget

etc.

so this is first approach but each module has thousands of classes and resources, layout xml files etc.

The other approach is to separate modules as library projects. I dont know how large scale projects maintain their codebase, like facebook, twitter etc.

Please advise.

4

2 に答える 2

1

ライブラリは複数のアプリケーションの共有コードを保持します...完全に単一のアプリケーションに集中している場合は、コードを5〜6個のライブラリプロジェクトに分割しても意味がありません。

Android開発者がプロ​​ジェクトを分離する一般的な方法の1つは、さまざまなコンポーネントのサブパッケージを作成することです。たとえば、カスタムViewとアダプタが入りcom.package.name.ui、ユーティリティパッケージが入りますcom.package.name.util。それ以外は、賢くなければなりません...「数千のクラス」を持つアプリを最初から開始することはかなり野心的であり、本当にあなたの人生を楽にするアドバイスの1つです。

于 2012-07-12T03:55:28.920 に答える
1

各モジュールは互いに分離されていますか、それともデータを共有していますか (同じデータベースなど)? それらが分離されている場合は、8 つの個別のアプリを作成することをお勧めします。これにより、アプリのメモリ フットプリントが削減され、起動時間が改善されます。

一部またはすべてが同じデータベースを使用している場合、SD カードにデータベースを作成し、それぞれの個別のアプリから使用できる場合があります。

于 2012-07-12T12:28:34.073 に答える