Dagger

Dagger code generation cheat sheets

Have you ever wondered what Dagger does under the hood πŸ€”?

Every annotation has a point πŸ”! Check out these cheat sheets to understand how Dagger interprets them and the code it generates for you. Explanations about the generated code and Dagger annotations can be found in the cheat sheets as comments.

For more information about dependency injection, why you might use Dagger in your Android app, and how to use it, check out the official Android documentation: https://d.android.com/dependency-injection.

If you prefer a step-by-step learning process, check out the Using Dagger in your Android app codelab.

Also, if you’re interested in the future of Dagger in Android, watch this Android Developer Summit ’19 video:

Dagger basics

Download file

Dagger basic annotations cheat sheet

Dagger Subcomponents

Download file

Dagger subcomponents cheat sheet

Component dependencies

Download file

Dagger component dependencies cheat sheet