Summary
In this chapter, we learned how to fetch data from an API using Ktor. Then, we learned how to handle JSON responses, as well as plain text responses, using Kotlin Serialization. We also saw how different error scenarios could be handled.
Later, we learned how to load images from URLs using Coil and how to present them to the user via composables.
There are quite a few popular libraries for fetching data from APIs and loading images. We only covered some of the most popular ones. You might want to try out some of the other libraries to find out which ones fit your purposes best.
In the next chapter, we will introduce Compose lazy lists, powerful UI components that we can use to present our users with lists of items.
Unlock this book’s exclusive benefits nowScan this QR code or go to packtpub.com/unlock, then search this book by name. |
![]() |
