what you didn’t know about retrofit with kotlin
summary
Shows Retrofit as a configured stack not just an interface: Moshi converter with RFC3339 adapter for Kotlin data classes, an empty‑to‑null converter to handle zero‑byte responses, and OkHttp with a header interceptor for auth or analytics. Demonstrates using coroutines with suspend methods instead of Call enqueue, explains main‑safety and IO dispatchers, and inspects real requests in Android Studio network profiler using a blog API against jsonplaceholder.typicode.com so you see requests, headers, and failures end to end.
AI-written summary · about
chapters (23)
- 0:00Introduction
- 1:17What is retrofit
- 3:54Objectives
- 5:28HTTP Client
- 7:06Network Issues
- 9:16Interface
- 10:49Issues
- 13:02Retrofit
- 14:12The power of retrofit
- 15:22What does retrofit do
- 16:21Retrofit is declarative
- 17:59Agenda
- 18:28What are data converters
- 21:47Customization
- 23:06Empty to Null Converter
- 25:27OK HTTP
- 26:10Header Interceptor
- 28:20Profiler
- 30:27Coroutines
- 33:36Enqueue
- 34:25COD routines
- 36:57Main Safety
- 40:46Questions
related talks
32mNetworking the Kotlin way: Retrofit + Coroutines
39mReactive Android: RxJava and beyond
29mTrip into the async world
41mMaking a Kotlin, Architecture Components, Rx and Coroutines sandwich
40mBuilding Asynchronous Mechanisms in Android App, Using Kotlin Coroutines
20mLean Async Code with Kotlin's Coroutines
52mPowered by Kotlin
43mBattle of the Titans: RxJava vs Kotlin Coroutines
