Dagger Hilt: Live Code Tutorial, Pros and Cons
summary
Live migration of an Android app from Dagger 2 to Hilt in ~25 minutes, with actual edits: add @HiltAndroidApp and Hilt Gradle deps, convert modules to @InstallIn components, add @AndroidEntryPoint to activities/fragments, remove manual component boilerplate, and switch ViewModel wiring to Hilt + savedStateHandle assisted injection. App runs after fixes; gotchas include extra annotation processors (build‑time cost), manual AppCompatActivity binding and FragmentFactory edge cases, and limited immediate benefit if already on vanilla Dagger 2.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:10Dagger and Hilt overview
- 2:42Reviewing the tutorial app
- 4:43Migration strategy
- 8:55Setting up Hilt dependencies
- 10:48Understanding Hilt components
- 13:58Refactoring modules and scopes
- 21:05Injecting into UI components
- 30:24Handling view models
- 35:42Summary of Hilt concepts
- 37:15Pros and cons of Hilt
- 41:33Future predictions and Q&A
related talks
25mFully Understanding Dagger Hilt Migration from First Principles
22mRex - From Dagger to Dagger Hilt
32mUsing Hilt in a Multi-Module Project
44mHilt: Dependency Injection for the mere mortals
42m(Unofficial) Guide to App Architecture Guide Vol. 2
29mForging the Dagger for the modern Android world
25mDagger 2 Android : Defeat the Dahaka
47mUp to Date? Talking About Your App
