Chapter 4: Managing Dependencies in Android Applications
In this chapter, we will analyze the concept of dependency injection (DI) and the benefits it provides and look at how this was done in the past in Android applications either through manual injection or using Dagger 2. We will go over some of the libraries used in Android applications, stopping and looking in more detail at the Hilt library and how it simplifies DI for an Android application.
In this chapter, we will cover the following topics:
- Introduction to DI
- Using Dagger 2 to manage dependencies
- Using Hilt to manage dependencies
By the end of this chapter, you will be familiar with the DI pattern and libraries such as Dagger and Hilt, which can be used to manage dependencies in Android applications.