6

Network Calls with Kotlin Coroutines

Most of the apps we use on our phones fetch data that is hosted online on a server. As such, we developers have to understand how to request and send data to the servers too. In this chapter, we will learn how to send and request data that is hosted online and display it in our apps.

In this chapter, we will learn how to perform network calls with a networking library, Retrofit. We will learn how to consume application programming interfaces (APIs) using this library. Moreso, we will learn how to take advantage of Kotlin coroutines to perform asynchronous network requests in our app.

In this chapter, we’re going to cover the following main topics:

  • Setting up Retrofit
  • Introduction to Kotlin coroutines

Get Mastering Kotlin for Android 14 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.