~/talk

Fully Understanding Dagger Hilt Migration from First Principles

TalkinJapaneseat DroidKaigi 2021 · 2021-10-19..10-21· [android, testing]
links:none on file
slides:none on file

A step-by-step migration from Dagger/Dagger Android to Hilt, demonstrated with a sample repo of four buildable commits. Covers concrete code edits: removing component factories, turning ApplicationComponent into EntryPoints backed by SingletonComponent, creating an aggregator module and moving modules into it, switching scope annotations and annotating activities/fragments with @AndroidEntryPoint, and removing DispatchingAndroidInjector. Also explains handling UI test issues (Robolectric, FCM, services) by replacing @AndroidEntryPoint with explicit EntryPoint lookups and guarded fallbacks, plus the Gradle/plugin configuration required for Hilt’s bytecode transformation.

AI-written summary · about

  1. 0:00Introduction
  2. 1:51Dagger fundamentals
  3. 4:18Dagger vs Dagger-Android
  4. 7:27Hilt approach
  5. 10:57Migration steps
  6. 11:59Component tree grafting
  7. 14:47Replacing scope annotations
  8. 15:49Migrating Activities
  9. 17:12Login migration
  10. 18:57Fragments migration
  11. 19:40Migration cleanup
  12. 20:01Common issues
  13. 24:13Hilt in UI testing
  14. 25:19Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.