Networking the Kotlin way: Retrofit + Coroutines
summary
Claims that Retrofit pairs with Kotlin coroutines to replace RxJava for typical single-request networking, shows Retrofit supporting suspend functions (Retrofit 2.5-1 snapshot), demonstrates using Dispatchers.IO and Dispatchers.Main for thread control, and explains migration patterns: replace Single/Completable with Deferred or suspend, use launch/async/runBlocking builders, and wrap parallel calls in coroutineScope with async/await to get structured cancellation. Gives testing guidance using kotlinx-coroutines-test to override the Main dispatcher, touts thousands-of-coroutines lightweightness, and shows debugging and ViewModel scope auto-cancel behavior.
AI-written summary · about
chapters (25)
- 0:00Introduction
- 0:30Networking on Android
- 2:33Primitives
- 2:50Networking primitives
- 3:36Learning curve
- 6:18Retrofit interface
- 7:52Retrofit API
- 9:48Curtain Builders
- 11:42Curtain Dispatcher
- 12:12Dispatchers IO
- 14:23With Context
- 15:51What is Context
- 17:14Cancellation
- 17:51Job
- 18:53ViewModel Example
- 19:33ViewModel Scope
- 21:40ViewModel Scope Testing
- 22:59Parallel Decomposition
- 24:16CoreTeamBuilder
- 25:30courtingscope
- 25:52curtainscope
- 26:38debugging
- 27:53Kotlin vs Java
- 29:48Should you use Kotlin
- 31:09Outro
related talks
49mLaunching Into Coroutines
42mI Swapped RxJava for Coroutines. Why You Should Too
29mTrip into the async world
43mAsynchronous programming using Coroutines
42mKotlin Coroutines: Beyond async/await
40mBuilding Asynchronous Mechanisms in Android App, Using Kotlin Coroutines
42mKotlin Coroutines: An Intro to Practical Use on Android
20mLean Async Code with Kotlin's Coroutines
