Illustration by Virginia Poltrack

Hilt and Dagger annotations cheat sheet

Manuel Vivo
Android Developers
Published in
Jul 20, 2020

--

Hilt defines a standard way to do dependency injection (DI) in your application by providing containers for every Android class in your project and managing their lifecycles automatically for you. Hilt is built on top of the popular DI library Dagger so benefits from the compile time correctness, runtime performance, scalability, and Android Studio support that Dagger provides.

This cheat sheet allows you to quickly see what the different Hilt and Dagger annotations do and how to use them. For more information about DI and Hilt, check out these guides or read the documentation. If you prefer a step-by-step learning approach, check out the Using Hilt in an Android app codelab.

Download cheat sheet in PDF

Hilt and Dagger annotations cheat sheet. Download in PDF here.

--

--