Android Suspenders
summary
Practical guide to replacing RxJava with Kotlin coroutines on Android, showing real code: concurrent fetches via async/await, ViewModel and Lifecycle CoroutineScope patterns, Job cancellation and checking isActive, and converting Play Services Tasks with suspendCoroutine. Measured costs: a thread ~1MB vs coroutine memory tens of KB, APK impact 774KB library down to <100KB with optimization. Runtime details: default dispatcher parallelism min 2, IO dispatcher min parallelism 64, channels for streaming and a working location-observer example using ReceiveChannel.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:13AMERICAN EXPRESS
- 0:25ANDROID SUSPENDERS
- 2:43AsyncTask
- 2:55Executors
- 3:16Loaders
- 3:34Future
- 3:44Libraries
- 4:16What does your typical mobile app do?
- 6:44core -android -rx2
- 7:42Creating routines
- 8:49How do we use them on Android?
- 11:02Coroutines can have a parent-child relationship
- 12:11Scopes
- 17:33What if I'm not using View Models?
- 19:45Cancellation requires co-operation
- 20:59launch rethrows exceptions
- 22:13Dispatchers
- 22:32What's a Coroutine Dispatcher?
- 25:00Most devs use RxJava for easy threading
- 25:38Coroutines can replace Single / Maybe / Completable
- 29:34Channels has 73 built-in operators
- 30:55Get last known location One shot callback
- 33:41Observe location updates Multiple value callback
- 38:18Kotlin Coroutines in Practice
related talks
37mAndroid Suspenders
40mBuilding Asynchronous Mechanisms in Android App, Using Kotlin Coroutines
35mEfficient Async with Kotlin Coroutines
43mBattle of the Titans: RxJava vs Kotlin Coroutines
38mAndroid Coroutines: How to manage async tasks in Kotlin
30mWe Suspend This Program for an Important Announcement
29mTrip into the async world
36mCracking Kotlin Coroutines
