Dagger 2 examples [closed] Dagger 2 examples [closed] android android

Dagger 2 examples [closed]


I've just published sample app based on Gradle which integrates Dagger2, retrolambda, butterknife and lombok. You can find it here: https://github.com/mgrzechocinski/dagger2-example.

Hope it would help :)


I've just ported u2020-mvp app to Dagger 2. We use it as our sandbox app. Dagger 2 has nice implementation of scopes by the way. Components are really big deal. And it is based on u2021 made by Christian Gruber. You can check that as well.

Hope it helps :)


For anyone looking for a simple and straightforward way to just build a Dagger 2 project on Gradle/Android Studio, check out https://github.com/bytehala/dagger2-gradle-quickstart

In the commit messages, I also enumerate the steps to convert a fully functioning project to Dagger 2.

The target audience for this project is anyone who has no experience with dependency injection.

No other library besides Butterknife is used.

WARNINGThe aim of this sample project is simplicity, not completeness.Only the following features were used:

  • @Module
  • @Component
  • @Injects
  • @Provides
  • @Singleton

Topics such as scopes, submodules, etc are left as an exercise.