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

Download materials
Save for later
Comments
Share

Learning path

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.

Covered concepts

  • Kotlin Serialization
  • Logging & Authentication Interceptors
  • Custom error handling
  • Kotlin Coroutines
  • Retrofit with coroutines

Part 1: Implement Advanced Retrofit

01
Toggle description

Revise the concepts learned so far. Go over some of the repetitive tasks you had to complete with Retrofit, and how to solve them.

Toggle description

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.

Toggle description

Practice using HTTP logging interceptors and the Result error handling, by implementing them for the registerUser, getNotes, addTask and getMyProfile requests.

Toggle description

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.

Conclusion 1:42
Toggle description

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

Toggle description

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.

Toggle description

To finish off the course, and practice learning about Kotlin Coroutines in Retrofit, simplify the rest of the calls!

Conclusion 1:25
Toggle description

Good job reaching the end of the course! :] Explore future courses and advanced topics in threading and networking.

Up next

Android & Kotlin
Android Background Processing
Learn about all the cool concepts from background processing in Android! Use the WorkManager, JobScheduler... more

Instructors

Contributors

Ananya Arora

Tech Editor

Adriana Kutenko

Illustrator

Over 300 content creators. Join our team.