techrankers

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:

  1. Modularization
  2. Offline-first functionality
  3. State management with Compose
  4. API and repository layers
  5. Testing ViewModels and business logic
  6. 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

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.

Where Next?

Popular Android topics Top

Nevio
Hi, I made an android app and created a signature with keytool. I then bundled the signature in the apk. So, I was wondering if, wanting...
New
Tuk-tuk
Hello! I’m learning Android Jetpack compose development from tutorials and documentation by Android developers. And I ran into a problem…...
New
codergrid
I’m new to Android Studio, and curious about how long you’ve been using your Android Studio IDE. I read on Wikipedia that this year, Andr...
New
Sadik
I’ve been hearing a lot about AI in mobile phones lately, and I’m kind of confused about how it’s different from the usual smart features...
New
Garrett
This is a question about Android Studio. Where is the Android Studio emulator’s camera default apartment 3D model stored in Android Stud...
New
Garrett
I’m stuck trying to understand how to get a variable initialised, and later updated, in kotlin to update in Jetpack Compose and cause a c...
New
DuendeMartin
My Android Studio emulator is stuck on this loading screen. What’s going on?
New
techrankers
I’m working on a production Android application and I’m trying to settle on an architecture that will remain maintainable as the project ...
New
bobj
The front screen cracked on my BLU J5L (FCC ID: YHLBLU5L20) months ago. The BLU company won’t won’t sell parts for it, or say which Chin...
New
bee
Hi, I’d like a class that I can access from all activities / views, which is initialised once and not need to pass the reference. I gues...
New

Other popular topics Top

PragmaticBookshelf
Ruby, Io, Prolog, Scala, Erlang, Clojure, Haskell. With Seven Languages in Seven Weeks, by Bruce A. Tate, you’ll go beyond the syntax—and...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
PragmaticBookshelf
Tailwind CSS is an exciting new CSS framework that allows you to design your site by composing simple utility classes to create complex e...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
PragmaticBookshelf
Build modern server-driven web applications using htmx. Whatever programming language you use, you’ll write less (and cleaner) code. ...
New
PragmaticBookshelf
Get the comprehensive, insider information you need for Rails 8 with the new edition of this award-winning classic. Sam Ruby @rubys ...
New
PragmaticBookshelf
Overarching tutorial for Python beginner and intermediate developers that teaches web development with the Flask framework. Miguel Gr...
New
PragmaticBookshelf
Use advanced functional programming principles, practical Domain-Driven Design techniques, and production-ready Elixir code to build scal...
New