Dispatchers.Main— Android UI thread.Dispatchers.IO— Network calls, Room DB, File I/O.Dispatchers.Default— CPU-heavy sorting, JSON parsing, math.
Switch threads cleanly inside a suspend function using withContext(Dispatchers.IO).
ADVERTISEMENT