Hilt provides a standard way of Dagger Dependency injection to Android applications.

As some of us are already using Dagger2 for quite some time, most of them were facing a lot of issues while creating objects, dependency graphs, subcomponents creations, and their scoping and it is quite confusing if anyone uses it the first time.

Hilt came up with an approach to solve some of the problems, by using Hilt annotations will generate the dagger injection code into base classes.

Dagger Hilt Setup:

Add below code snippet in project Gradle file

Add below code snippet in app/gradle

Dagger Release notes …

What motivated me to write this article despite having a lot of stuff on the internet regarding clean architecture?
A few months back when I want to understand clean architecture, I found a lot of articles on the internet, but those are a bit hard to understand and not clear as well. My main motive would be, it should be easy to understand and simple BTW

Let's jump into it:

There are so many discussions nowadays regarding clean architecture in Android, when your application is growing bigger you need to be more careful to manage it for future developments.


Avinash Mujja

Software developer @Gojek, Currently experimenting on jetpack compose.

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