~/talk

Rex - From Dagger to Dagger Hilt

Talkat Android Makers 2022 · 2022-04-25..04-26· [android]
slides:none on file

Migrating a Dagger app to Hilt proves practical: setup from scratch uses @HiltAndroidApp on Application and @AndroidEntryPoint on Activities/Fragments, ViewModels use @HiltViewModel and constructor injection, and modules use installIn(SingletonComponent) or activity/view components. Built a refactor that removes custom components, fixes scopes, and adds WorkerFactory + getWorkManagerConfiguration for workers. Watch for gotchas: fragments must run in Hilt activities, ViewModel parent is retained activity so no activity context, dynamic features and UI tests need extra work, and build-time checks catch most migration errors.

AI-written summary · about

  1. 0:00Introduction
  2. 0:36Context
  3. 1:45Dependency Injection
  4. 2:37Dagger
  5. 4:42Dagger Hilt
  6. 5:17Singleton Component
  7. 5:55Bindings
  8. 6:17How does it work
  9. 6:51Fragments services
  10. 7:23Modules
  11. 9:12Worker
  12. 9:59Research
  13. 11:16Refactoring
  14. 12:50Migration Guide
  15. 13:24Application Migration
  16. 15:14Health Activities
  17. 15:43Annotation
  18. 15:57Default bindings
  19. 16:22Binding naming
  20. 16:36Retained activity
  21. 17:37Take away
~/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.