From the course: Android Dependency Injection with Dagger 2 and Kotlin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Real-world example: Architecture components #1

Real-world example: Architecture components #1

From the course: Android Dependency Injection with Dagger 2 and Kotlin

Start my 1-month free trial

Real-world example: Architecture components #1

- [Instructor] At this point we've actually covered a whole lot of Dagger, we know how to use the @ sign inject annotation to build Daggers dependency graph. We know how to use the @ sign component annotation to tell Dagger which abstract Factory to implement. We know how to use @ sign name to distinguish between objects of the same type. We also know how to use modules to provide Dagger with extra information when it needs it. And we know how to use those modules to create collections of objects. In order to make all this easy to comprehend however, we've used some really really simple fragmentary examples. Let's have a look at a more realistic example. While anyone should be able to follow this example, it will make a lot more sense if you're familiar with Jetpack, Google's architecture components. Here's a quick review of some of the important bits. Androids architecture components provide a standard way of obtaining a ViewModel for a given activity. There is a depth method on a…

Contents