Dagger 2 is a dependency injection framework for Android and Java that is developed by Google. In this tutorial, we will step by step learn how to use Dagger 2 and why we need it.
In part 1, we will learn what a dependency is, what injection means, and what benefits dependency injection provides in terms of code coupling, testability and single responsibility principle. We will also learn what new problems dependency injection brings up and how Dagger 2 can help us get rid of them while still reaping the benefits of dependency injection.