Mobile Development 11 min read

Designing a Scalable Android Architecture: Lessons from Top Apps

This article reviews the architecture of several popular Android apps, extracts their strengths, and proposes a unified, modular project template that balances clarity and flexibility for multi‑app development, covering package layers, common modules, configuration, and best‑practice guidelines.

21CTO
21CTO
21CTO
Designing a Scalable Android Architecture: Lessons from Top Apps

1. VDisk

VDisk has a simple architecture. The top package is com.sina.VDisk (company domain + app name). Below are modules: main module VDiskClient and entity module entities, then sub‑packages with implementation classes.

First layer: com.sina.VDisk. Second layer: module names (VDiskClient, entities). Third layer: concrete sub‑packages with implementation classes.

Typically, global classes like BaseActivity are placed in the main module. If only one main module, the module layer can be omitted.

Entity module should contain only entity classes. In VDisk most entities are named xxxInfo; the author prefers xxxModel for readability. Public fields are used instead of getters/setters to improve performance, though getters/setters can be used when needed.

VDisk architecture diagram
VDisk architecture diagram

2. JiuYi Diary

The structure is slightly more complex. The first layer is the same as VDisk. The second layer does not separate modules; all implementation classes, especially diary‑related Activities, are placed directly.

The entity package is named model and contains not only entity classes (xxx.java) but also higher‑level classes such as xxxManager and xxxFactory, similar to Android’s Activity/ActivityManager pattern.

Additional packages include config (system constants, static variables), constant (public static final values, avoiding enums for performance), and common (shared utilities). These packages are discussed further after comparing multiple apps.

JiuYi Diary architecture diagram
JiuYi Diary architecture diagram

3. NetEase News

NetEase News organizes code by component type rather than by module. The first layer uses a common library named with the company domain. The third layer contains activity and service packages that hold all Activities and Services, often with inner classes or anonymous classes to keep the packages tidy.

This approach is common in Android projects and provides useful reference.

NetEase News architecture diagram
NetEase News architecture diagram

4. Xiaomi Apps

Three Xiaomi apps (Share, Reader, Tag) appear to be developed by different teams. Their architecture includes special modules such as widget and provider. Each app has a common package at both application‑level and project‑level, allowing shared utilities and code.

Whether to further subdivide the common package depends on project size; large projects may benefit from finer granularity, while small projects keep it simple.

Xiaomi apps architecture diagram 1
Xiaomi apps architecture diagram 1
Xiaomi apps architecture diagram 2
Xiaomi apps architecture diagram 2

5. Consolidated Architecture

Based on the analysis, a generic Android project structure is proposed for a company (e.g., tianxia) developing multiple apps (reader, friend, life). The top‑level contains a base library with common initialization, a common jar for shared code, optional config and oauth packages, and a view package for reusable custom views.

Each app module includes its own config (AppConfig.java), feature modules (blog, bbs, person, widget), and a common package for utilities and custom views. The base library can be an Android library project, while common can be a jar or library.

Additional optional packages such as ad (soft ads), feedback, and upgrade can be added as needed.

Overall company architecture diagram
Overall company architecture diagram
Reader app detailed architecture diagram
Reader app detailed architecture diagram
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

modularizationProject StructureAndroid architecture
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.