I have implemented dagger2 v2.2 previously but as now they have added dagger.android part also. so I am creating sample project with that.
I am aware about old methodolo
Official Documentation explains this topic quite well in my oppinion.
Anyway the main benefit is that instead of something like this
((SomeApplicationBaseType) getContext().getApplicationContext())
.getApplicationComponent()
.newActivityComponentBuilder()
.activity(this)
.build()
.inject(this);
You can simply write this, which makes life easier for everyone.
AndroidInjection.inject(this);
Less boilerplate, easier maintainability.
The previous approach is kind of breaking the basic concept of dependency injection, a class should not know any details about the way dependencies are being injected.