Android Networking: Beyond the Basics
Implement advanced concepts in the Retrofit library in Android, and add interceptors and parsers. Learn how Kotlin Coroutines can make your networking code easy to write and understand. By Subhrajyoti Sen.
3 (1) · 1 Review
This is part of the Android Data & Networking learning path. View path.
Who is this for?
Beginner Android developers who want to learn how to use the advanced features of Retrofit and couple it with Kotlin Coroutines.
- Kotlin Serialization
- Logging & Authentication Interceptors
- Custom error handling
- Kotlin Coroutines
- Retrofit with coroutines
Part 1: Implement Advanced Retrofit
Revise the concepts learned so far. Go over some of the repetitive tasks you had to complete with Retrofit, and how to solve them.
Implement a third way to parse data, which is light and supports multiplatform - Kotlin Serialization. Compare to other parsers.
Add logging interceptors to Retrofit’s client, to log information to analyze each request. Implement a custom error handling mechanism.
Practice using HTTP logging interceptors and the Result error handling, by implementing them for the registerUser, getNotes, addTask and getMyProfile requests.
Learn about another way to use interceptors, to add authentication headers to requests. Explore the interceptor request chain.
Practice implementing different REST methods using Retrofit, by adding a DELETE method to the api service.
Go over all the cool concepts you’ve covered in the third part of the course. Prepare for the last part of the course, and Kotlin Coroutines!
Part 2: Retrofit With Kotlin Coroutines
Get an introduction to Kotlin Coroutines and learn about how Retrofit has built in support. Discover why coroutines are a modern way of threading and networking.
Remove the Callback object from Retrofit, and wrap calls in Kotlin Coroutines to simplify the code and make it easier to understand.
Simplify the coroutine-powered api calls further, by implementing the built-in coroutines support in Retrofit.
To finish off the course, and practice learning about Kotlin Coroutines in Retrofit, simplify the rest of the calls!
Good job reaching the end of the course! :] Explore future courses and advanced topics in threading and networking.