Architecture for Android Developers
Android architecture is the way an app's code is divided so it stays testable and maintainable. The common approach is MVVM with unidirectional data flow: the UI shows state from a ViewModel and sends events back. Dependency injection, with Hilt for example, and modularisation keep layers independent and builds fast.
Stage: App Architecture · Part of the Android Developer roadmap · Last reviewed 19 November 2026
What to learn in Architecture
- Separate UI, domain and data layers with clear responsibilities
- Expose screen state from a ViewModel using StateFlow
- Send user events up and state down in a single direction
- Provide dependencies with Hilt modules and constructor injection
- Split an app into feature modules with controlled dependencies
Architecture interview questions
What does unidirectional data flow mean in Android?
State flows down from the ViewModel to the UI, and events flow up from the UI to the ViewModel. The UI never edits state directly. This gives one source of truth, makes each screen state easy to reproduce and test, and avoids bugs where two parts of the UI disagree.
Why use dependency injection instead of creating objects directly?
Injection lets a class receive its collaborators instead of constructing them, so you can swap real implementations for fakes in tests and change them in one place. Hilt generates the wiring at compile time. It also manages object lifetimes, such as one instance per app or per screen.
Where Architecture fits in the Android Developer roadmap
Architecture belongs to the App Architecture stage (beginner level), which takes about 4 hours. Maintainable structure.
Back to the full Android Developer roadmap