Part 8: Advanced Android App Development
Architect a real, production-style Android app. The chapters build up a single example app feature by feature.
What You’ll Learn
- Modern app architecture: MVVM + unidirectional data flow / Clean Architecture
- Advanced Jetpack Compose: state hoisting, navigation, side effects, theming
- State management with
ViewModelandStateFlow - Local persistence with Room
- Networking with Retrofit/Ktor and
kotlinx.serialization - Dependency injection with Hilt
- Background work with WorkManager
- Multi-module structure, build variants, performance, and testing
Chapters
| Chapter | Description |
|---|---|
| App Architecture | MVVM + UDF / Clean Architecture layers |
| Advanced Compose | State hoisting, side effects, Material 3 |
| Navigation | Compose Navigation, multi-screen flows |
| ViewModel & State Management | ViewModel + StateFlow, immutable UI state |
| Local Persistence with Room | Entities, DAOs, migrations, queries as Flow |
| Networking | Retrofit + kotlinx.serialization, DTO mapping |
| Dependency Injection with Hilt | Modules, scopes, injecting ViewModels |
| Background Work with WorkManager | CoroutineWorker, constraints, scheduling |
| Modularization & Build Variants | Gradle modules, build variants, version catalog |
| Testing | Unit, coroutine, and Compose UI tests |
| Performance & Best Practices | Recomposition, leaks, best-practices checklist |
This part requires Android Studio. Instrumented (emulator) tests are documented as run-locally; unit and Compose UI tests run in CI.
About the worked example
The example in examples/android/ integrates the architecture core that
builds and is unit-tested in CI: an ArticlesViewModel exposing an immutable
StateFlow UI state, an ArticleRepository behind an interface (constructor
DI), Navigation Compose (list → detail), and JSON parsing with
kotlinx.serialization.
Room, Hilt, Retrofit, and WorkManager are presented as complete, idiomatic code in their chapters. They rely on annotation processing and/or the Android runtime, so to keep the single CI module fast and buildable without an emulator they are documented as drop-in code rather than wired into that module. This is a deliberate, disclosed boundary — not a gap in coverage.