~/talk

Dependency Injection in Android using Dagger 2

Talkat droidconIN 2015 · 2015-12-12..12-13· [android]
links:none on file
slides:none on file

Dagger 2 provides compile-time dependency injection for Android that removes reflection, runs much faster than Guice/Roboguice and surfaces configuration errors at compile time, though graph composition can force extra recompiles. It uses @Module/@Provides methods and a @Component interface to wire dependencies, supports field/constructor/method injection, and allows custom scopes so you can have application vs activity scope singletons. Example: SharedPreferences injected into a data store via constructor, easily replaced with test doubles; generated code is readable and the approach works in real apps.

AI-written summary · about

  1. 0:00Start
  2. 3:47Definition of Dependency Injection
  3. 5:26Three Types of Injections
  4. 6:46Dependency Injection Libraries
  5. 10:00Issues with Dependency with Dagger
  6. 15:30Kinds of Injection
  7. 15:52Constructor Injection
~/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.