Android Developers
Published in

Android Developers

Illustration by Virginia Poltrack

Hilt and Dagger annotations cheat sheet

Hilt defines a 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 the different Hilt and Dagger annotations do and 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.

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

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store