techrankers
Best architecture for a production Android app in 2026?
I’m working on a production Android application and I’m trying to settle on an architecture that will remain maintainable as the project grows.
For a new Android project in 2026, would you recommend a fairly standard approach such as:
- Kotlin
- Jetpack Compose
- MVVM
- ViewModel
- Repository pattern
- Coroutines / Flow
- Room for local data
- Retrofit or another API client
- Hilt for dependency injection
Or are there situations where you’d use a different architecture, particularly for larger applications with multiple modules and a fairly complex backend?
I’m especially interested in how people are handling:
- Modularization
- Offline-first functionality
- State management with Compose
- API and repository layers
- Testing ViewModels and business logic
- Keeping the codebase manageable as the number of features increases
For those who have maintained production Android applications for a few years, what architectural decisions turned out to be worthwhile, and what would you avoid if starting the project again?
First Post!
premsinghsodha7
Your stack is a reasonable starting point. I would make the data flow and dependency boundaries explicit before adding more layers.
For the areas you listed:
- Compose state: expose an immutable screen state from the ViewModel, usually through StateFlow. Collect it with collectAsStateWithLifecycle(), and send user actions back through ViewModel methods. Keep state such as an expanded menu local to the composable when no business logic needs it.
- Offline-first: have the UI read from a local source through the repository. A refresh fetches remote data and updates the local database, which then emits the new state. Decide separately how queued writes, retries, and conflicts work; caching reads alone does not solve those problems.
- Repositories: organize them around data responsibilities rather than creating one per endpoint. Keep Retrofit and Room details behind that boundary. Add use cases when they simplify reused or complex business logic.
- Modules: split around cohesive features and genuinely shared capabilities. A larger backend does not automatically require more Android modules. Consider ownership, dependency direction, and build impact when deciding where a boundary helps.
- Tests: test ViewModels with fake repositories and controlled coroutine dispatchers. Check loading, success, failure, and retry behavior. Test database queries and migrations separately; reserve UI tests for important user journeys.
A useful first slice is one screen that loads cached data, refreshes it, handles a network failure, and is covered by tests. That gives you evidence about the architecture before you repeat it across every feature.
Google’s architecture recommendations and offline-first guide cover these boundaries and trade-offs.
Popular Android topics
Other popular topics
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /python
- /js
- /rails
- /security
- /go
- /swift
- /vim
- /java
- /clojure
- /typescript
- /emacs
- /haskell
- /svelte
- /onivim
- /kotlin
- /react
- /c-plus-plus
- /crystal
- /tailwind
- /gleam
- /ocaml
- /elm
- /vscode
- /flutter
- /html
- /ash
- /deepseek
- /zig
- /opensuse
- /php
- /centos
- /react-native
- /scala
- /lisp
- /textmate
- /sublime-text
- /nixos
- /debian
- /deno
- /agda
- /django
- /kubuntu
- /nodejs
- /arch-linux
- /ubuntu
- /spring
- /revery
- /manjaro
- /julia
- /diversity
- /quarkus
- /lua
- /laravel









