Introduction to Dagger 2, Using Dependency Injection in Android

Introduction to Dagger 2, Using Dependency Injection in Android

This article contains a lot of information. So for the purpose of readability I have broken it into two parts.

[…]

To understand the Dagger2 usage in Android, let’s first try to understand the need for it. The important question is:

[…]

So, what are the benefits of providing the dependencies from outside the class?

The most important advantage is that it increases the possibility of reusing the class and to be able to test them independent of other classes.

[…]