Dependency Injection In Android With Dagger

A complete guide to Dagger and Hilt dependency injection frameworks for Android development

Last updated 2022-01-10 | 4.8

- Master Dagger and Hilt dependency injection frameworks
- Understand the relationship between Dagger
- Dagger 2 and Hilt
- Learn the fundamental theory of Dependency Injection in Android

What you'll learn

Master Dagger and Hilt dependency injection frameworks
Understand the relationship between Dagger
Dagger 2 and Hilt
Learn the fundamental theory of Dependency Injection in Android
Discover the best practices of Android development using Dependency Injection
Dagger and Hilt

* Requirements

* Hands-on Android development experience
* Basic knowledge of Kotlin

Description

With this course you'll learn what dependency injection is, understand how it affects the architecture of your Android applications and master Dagger and Hilt dependency injection frameworks. This is a comprehensive resource, aimed to equip you with an expert-level Android development knowledge and skills.

Even though the ultimate goal of this course is to make you comfortable with Dagger, you'll also learn about so-called Pure Dependency Injection. That's when you incorporate dependency injection into your Android applications without using any third-party libraries. Pure Dependency Injection is important and useful technique and, in addition, mastering Pure DI will allow you to see what Dagger brings to the table and appreciate its features.


  • Professional grade 

  • From fundamentals to best practices

  • Non-trivial examples

  • Hands-on exercises

  • Tutorial Android application on GitHub with step-by-step commits history for easier review


Many developers spend weeks and even months learning Dagger, and some still give up on it. This course will spare you a lot of time because you won't need to figure out Dagger on your own. You'll also learn the associated best practices, so you'll be protected from the most common mistakes and won't shoot yourself in the foot. All technical solutions demonstrated in this course were tested in many professional projects and produced outstanding results.

So, if you want to learn what dependency injection is and how to use Dagger 2 to develop clean and maintainable Android applications - this course is for you.

Who this course is for:

  • Professional Android developers interested in mastering Dagger and Hilt

Course content

11 sections • 85 lectures

Dependency Injection Terminology Preview 04:45

Udemy Course Review Popup Preview 01:07

Fundamental Dependency Injection Techniques Preview 04:28

Comparison Between Fundamental Dependency Injection Techniques Preview 09:07

Large-Scale Structure Preview 07:29

Architectural Patterns Preview 06:23

Dependency Injection Architectural Pattern (DIAP) Preview 04:21

Fundamental Dependency Injection Techniques vs DIAP Preview 06:00

Tutorial Application Demo Preview 03:50

How to Get the Source Code of the Tutorial Application Preview 06:25

Tutorial Application Code Review Preview 14:07

Tutorial Application Refactoring Rationale Preview 08:55

Extraction of the User Interface Logic into MVC View Preview 19:32

Exercise 1 Preview 03:16

Base Class for MVC Views Preview 11:19

Extraction of the Domain Logic into Use Case Preview 12:47

Exercise 2 Preview 02:50

Extraction of the Dialogs Management Logic into Dialogs Navigator Preview 06:59

Extraction of the Navigation Logic into Screens Navigator Preview 09:12

Model View Controller (MVC) Architectural Pattern Preview 03:47

Sharing an Instance of a Service among Multiple Clients Preview 05:51

Removing Unneeded "Proxy" Dependencies Preview 05:38

The Law of Demeter Preview 03:34

Refactoring the Use Case According to the Law of Demeter Preview 06:04

Exercise 3 Preview 01:25

Application Composition Root Preview 11:23

Lazy Initialization of Services Preview 07:58

Activity Composition Root Preview 16:08

Exercise 4 Preview 01:51

Exercise 4 Solution Preview 09:14

Runtime Construction Arguments Preview 16:04

Extraction of MVC Views Construction Logic into a Factory Preview 09:58

Exercise 5 Preview 01:12

Presentation Composition Root Preview 15:29

Tutorial Application Refactoring Summary Preview 07:51

Pure Dependency Injection Preview 05:45

The Main Benefit of Dependency Injection Preview 09:38

Context Isolation Preview 08:58

Objects vs Data Structures Preview 09:12

Injecting Services "from Outside" Preview 12:11

Convention Over Configuration (CoC) Preview 14:01

Dependency Injection Frameworks Preview 04:34

Dagger 2 Preview 05:28

Gradle Configuration Preview 03:09

Components and Modules Preview 17:00

Exercise 6 Preview 02:29

Scopes Preview 12:49

Component as Injector Preview 12:07

Dependent Components Preview 08:10

Exercise 7 Preview 01:43

Subcomponents Preview 11:40

Exercise 8 Preview 01:24

Multi-Module Components Preview 12:32

Automatic Discovery of Services Preview 18:49

Provider Methods in Modules vs Automatic Discovery Preview 06:44

Workflow with Dagger Preview 15:56

Dagger Tutorial Summary Preview 05:48

Android Services and Dialogs Preview 12:21

Static Provider Methods and Component Builders Preview 18:33

Type Bindings Preview 13:16

Qualifiers Preview 17:08

Providers Preview 13:28

ViewModel Preview 01:59

Incorrect ViewModel Integration Preview 10:08

Dedicated Factories for ViewModels Preview 09:04

Refactoring ViewModel Factories According to the Law of Demeter Preview 06:30

Centralized Factory for ViewModels Preview 06:13

Multibinding Preview 16:49

ViewModel with SavedState Preview 20:47

Why ViewModel is So Complex Preview 18:15

Simplification of ViewModel with SavedState Preview 19:36

Hilt Preview 02:50

Hilt's Fundamental Assumptions Preview 05:46

How to Get the Source Code Preview 03:58

Hilt Gradle Setup Preview 04:17

Removing Dagger Components Preview 06:05

Hilt Injection Mechanics Preview 04:24

Installing Modules into Components Preview 08:16

Hilt Scopes Preview 04:25

Providing AppCompatActivity Preview 03:36

Hilt and ViewModel Preview 10:39

Hilt Summary Preview 06:51