Android Networking: Fundamentals

Sep 6 2022 · Kotlin 1.6, Android 12, Android Studio Chipmunk | 2021.2.1 Patch 1

Part 2: Implement Retrofit Basics

18. Conclusion

Episode complete

About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 17. Challenge: Work with Moshi Parser

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 18. Conclusion

Continue learning about the Networking in Android with our Android Networking: Beyond the Basics course!

The student materials have been reviewed and are updated as of July 2022.

Transcript: 18. Conclusion

Very well done! You’ve reached the end of the second part! :]

You’ve learned a lot of really useful concepts, which you’ll definitely use in other apps, as you work on more and more projects in the future.

You learned about Retrofit, and how to build its client, and respective ApiServices.

You also implemented different REST methods and requests, using the GET and POST annotations, and you used Query, Body and Header helper annotations.

Each of the annotations helps Retrofit generate different code underneath, with more configuration. As such, the Header annotation added headers to the request, like the authorization token.

The Query annotation appended extra parameters to the endpoint path, for the server to filter specific data. And the Body annotation specified the body parameter in each request, when you had more data to send at once.

Finally, you implemented Moshi, a cool parser which is much lighter than Gson. Along with the Moshi converter for Retrofit, you managed to fully automatize the process for parsing data from the server response to Kotlin objects, and from Kotlin objects to JSON for the server.

You’ve implemented almost every request in the RemoteApi, but there’s still more to do! In the next part, you’ll see how to add interceptors to Retrofit, to simplify your code even more, and provide more information for debugging. You’ll also implement a cleaner way to deal with errors, and another parser, which might even be easier than Moshi!