Series
Android, Line by Line
3 parts, in order. Start at the top — each one assumes the one before it.
- 01 Let's Make WorkManager Work: Constraints, Unique Work, and a Retry That Stops Forty lines that run a job surviving the app being killed. Three decisions inside are worth stealing, and one line is a bug you can ship without noticing — because CancellationException is an Exception.
- 02 Let's Make SupervisorJob Work: Independent Failure Without Breaking the Tree One child throws and the whole scope dies. SupervisorJob fixes that — but you probably already have one and didn't know, and the way most people reach for it does nothing except break structured concurrency.
- 03 Let's Make a Callback Suspend: suspendCancellableCoroutine, Line by Line Wrapping a callback API in a suspend function is four lines. The fifth line — invokeOnCancellation — is the one that decides whether cancelling actually stops anything, and it's the one people leave out.