MediumJetpack AppState: Compose State Beyond the UI | Medium
Sitemap

Member-only story

Below the Waterline: Running Compose State Where There Is No Screen

14 min readOct 31, 2026

--

A senior engineer’s tour of Jetpack AppState (Transform and StateStore), told through the bugs that only show up after launch.

Press enter or click to view image in full size
Below the Waterline: Running Compose State Where There Is No Screen
Below the Waterline: Running Compose State Where There Is No Screen

Not a Medium Member? “Read For Free”

1. The trouble with state nobody is looking at

Picture Pedalpost, a bike-courier app (invented for this post). One fact, “the courier is standing at a customer’s door,” has to be true in four places at once: the dispatch screen, a foreground service, a home-screen widget, and a notification action. Add a battery-saver flag, a zone filter, and an order feed, and you have the usual Android state mess:

  • A combine(...) call that grows a sixth upstream and loses its typed overload.
  • A MutableStateFlow<UiState> that wakes every collector when a single field changes, or a pile of separate flows that cannot be updated together.
  • A singleton, a SharedPreferences file, and a SavedStateHandle that each claim to own "the current delivery" and quietly disagree after process death.
  • Timers and notifications buried inside collectors, with cancellation rules nobody can recite.

Jetpack AppState attacks this from a direction that surprises people: it takes Compose’s snapshot state…

--

--

Android Expert
Android Expert

Written by Android Expert

Android Engineer & Kotlin Advocate. 🚀 Deep dives into Jetpack Compose, Coroutines, and Clean Architecture. Turning complex code into scalable solutions. 🛠️✨