Leave a rating/review
You’re almost at the finish line! With the first part of the course done, you’ve covered almost all the concepts every Android developer needs to know about Networking nowadays! :]
You have covered advanced Retrofit concepts, like interceptors and error handling. Additionally, you implemented Kotlin Serialization, as a new and simple to use parser for data!
Interceptors are amazing because you can add behavior to your requests, without having to manually add it to each api call function. You simply add code in the interceptor’s request chain, and that’s it! They also allow you to log data, for better analysis of requests!
Instead of using complex callbacks, with multiple parameters, you implemented a Result class, which describes two cases, Success and Failure.
Then in code, you can check if the request has been successful or a failure, instead of having to check the data nullability. It’s easier, and more understandable!
There are many different parsers out there, and Kotlin Serialization is the new kid on the block. It’s similar in performance and features to Moshi, but it’s easier to use in terms of the code required to set it up for each model. It also supports multiplatform, which is a really interesting and fun concept, in the Kotlin world! In the final part of this course, you’ll learn about an amazing topic, and one of my favorite things to talk about - Kotlin Coroutines.
Coroutines are a way to program asynchronously, without having to write a lot of code, change your code in a way that doesn’t resemble regular, blocking code, like you did with callbacks in Retrofit, or worry about optimization! But I won’t spoil much more! If you want to learn about Coroutines, make sure to watch the final part of the course! :]