Mobile apps · Library

Coroutines and Flow

Kotlin's way of writing code that waits, for a network call or a database read, without freezing the screen, plus Flow for streams of values that change over time.

Android building blocks · Open source · updated

How it works

A suspend function can pause at a slow call and resume later without blocking a thread, so asynchronous code reads top to bottom like ordinary code instead of nested callbacks. Coroutines run in scopes tied to a lifetime, such as viewModelScope for a screen's ViewModel, and are cancelled automatically when that scope ends (structured concurrency). Dispatchers choose where work runs: Main for the interface, IO for disk and network.

Flow is a stream of values over time: a Room query that re-emits when rows change, search results as the user types, a download's progress. StateFlow holds the current UI state that Compose screens observe. Both come from JetBrains' kotlinx.coroutines library, work in Kotlin Multiplatform, and have largely replaced callbacks and RxJava in new Android code.

Coroutines and Flow pricing

Open source

Free (Apache 2.0).

Approximate, checked September 2026.What the other tools cost

More in Mobile apps

Android building blocks

All 34 Mobile apps terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.