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

manuel

Manuel Vivo

Manuel Vicente Vivo is a Staff Mobile Architect and seasoned Android engineer with experience at leading companies including Capital One, Google, and Bumble Inc. Beyond his technical expertise, Manuel is a dedicated mentor, accomplished public speaker, and prolific writer whose work has reached and inspired millions around the world.

Read More