Chapter 2: Deep Diving into Data Sources
In this chapter, we will study some of the popular libraries and frameworks used for retrieving and managing data on Android and how to do this without blocking the main thread of an application. We will start by going over how multithreading should be handled in an Android application and the available technologies we now have to easily handle this. We will then move on to implement loading data from the internet using libraries such as Retrofit and OkHttp, after which we will look at how we can persist data on a device using libraries such as Room and DataStore.
In this chapter, we will cover the following main topics:
- Understanding Kotlin coroutines and flows
- Using OkHttp and Retrofit for networking
- Using the Room library for data persistence
- Understanding and using the DataStore library
By the end of this chapter, you will have become familiar with how we can load, manage, and persist data in an Android application...