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
From the course: Android Dependency Injection with Dagger 2 and Kotlin
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
When Dagger can't figure it out: @Modules and @Binds5m 6s
-
(Locked)
When it's complicated: @Provides4m 49s
-
(Locked)
When types are not enough: @Named3m 33s
-
(Locked)
Multibinding: Sets4m 42s
-
(Locked)
Multibinding: Maps with simple keys4m 15s
-
(Locked)
Real-world example: Architecture components #14m 29s
-
(Locked)
Real-world example: Architecture components #23m 19s
-
(Locked)
Real-world example: Architecture components #31m 40s
-
(Locked)
Multibinding: Maps with complex keys4m 53s
-
(Locked)
Real-world example: Architecture components solved3m 25s
-
(Locked)
-
-
-