Using Hilt in a multi module project

Fabio Collini

Android Engineer

The New York Times

Modularizing a project is never easy, a lot of files to move and the dependencies between them is not always what we expect. Then the Dagger configuration used in a single module project often doesn't scale well to a multi module project. Hilt is opinionated about the configuration to use (we don't need to argue anymore about using component dependencies or subcomponents!) and this configuration works perfectly even in a multi module project.

In this talk we'll see first an introduction to Hilt and a comparison with Dagger to understand why it's easier to configure. Then we'll see how to leverage it in a multi module project (both in a standard layered architecture and in a Clean Architecture that uses the Dependency Inversion) to improve build speed and code testability. Spoiler alert: using sample apps that include a single feature in the app helps a lot!

Fabio Collini is a Google Developer Expert for Android and Kotlin. He started Android development in 2009, first as a freelance with two apps on Play Store and then as a developer for some companies and startups. Now he works as a remote engineer in the Android team at the New York Times. He is one of the authors of the second edition of Android Programmazione Avanzata, an Italian book dedicated to some advanced aspects of Android development.
He is a co-owner and writer for the Italian blog CodingJam and he publishes articles about Android and Kotlin on his medium profile.

droidcon EMEA is produced by:

Mobile Seasons GmbH (droidcon Global HQ)

Messedamm 22

14055, Berlin


.droidcon is a registered Trademark of Mobile Seasons GmbH

  • dc-social
  • Twitter - White Circle
  • Facebook - White Circle