The Rise of the State Machines: An Introduction to Predictable State Container–Based Architectures for Your Android Apps
summary
An introduction to using state-per-step state machines for Android apps, demonstrated with a Kotlin DSL library named flou that models login flows using coroutines and ViewModel stores. Shows a compiled, type-safe implementation where reducers produce pure transitions that can be recorded to reproduce crashes, side-effects are emitted and tested, and unit tests run much faster than full Espresso suites. Discusses tradeoffs: easier local reasoning and testing and restored navigation visibility versus some repetitive actions and the lack of a single global navigation map unless machines are composed.
AI-written summary · about
chapters (16)
- 0:00State machines in Android
- 1:04Auth problems
- 3:16Key requirements
- 5:31MVI and unidirectional flow
- 8:01Pure functions for state
- 9:28Side effects in state
- 11:54MVI limits for navigation
- 12:39State machines for UI flows
- 16:36MVI vs state machines
- 22:58Global navigation
- 23:45Kotlin DSL for navigation
- 27:24Login flow with DSL
- 35:50Testing business logic
- 36:35DSL in ViewModel
- 40:18Limitations and future
- 41:20Q&A
related talks
33mThe Rise of the State Machines
40mCompose Without Flow: Unidirectional State with Snapshots and Coroutines
33mA View State Machine for Network Calls on Android
29mModern Android Development using MVI architecture
34mFunctional Android
45mImplementing Modern Android Architecture
41mViewModels, LiveData and Lifecycles, oh my!
45mExploring the possibilities of Unidirectional Data Flow Architectures on Android (en)
