A fast dependency injector for Android and Java
open sourceApache-2.0free
Dagger is a fully static, compile-time dependency injection framework for Java, Kotlin and Android, maintained by Google (it adapts an earlier version made by Square). It generates the wiring code at build time instead of using reflection, so errors show up when you compile and startup stays fast. Hilt, built on Dagger and in the same repository, gives Android apps a standard way to set it up. This is Google's Java library, not the Dagger CI engine from dagger.io.
Problems it solves
- wire up dependencies in my Android app without reflection slowing startup
- catch missing dependency bindings at compile time instead of at runtime
- a standard dependency injection setup for a large Android codebase
Features
- compile-time dependency injection for Java, Kotlin and Android
- generated code instead of reflection
- errors caught at compile time
- Hilt for Android apps
- annotation processor (dagger-compiler)
Alternatives
The same job
These do what Dagger does.
