We may earn an affiliate commission when you visit our partners.
Vasiliy Zukanov

In this course you'll learn all about Dependency Injection in Android and master Dagger and Hilt Dependency Injection frameworks. By the end of the course, you'll acquire an expert-level knowledge and will be ready to use Dagger, Hilt or manual Dependency Injection in your own Android applications.

A set of carefully designed, hands-on exercises will help you solidify your knowledge and allow you to practice using Dependency Injection in a controlled environment.

Read more

In this course you'll learn all about Dependency Injection in Android and master Dagger and Hilt Dependency Injection frameworks. By the end of the course, you'll acquire an expert-level knowledge and will be ready to use Dagger, Hilt or manual Dependency Injection in your own Android applications.

A set of carefully designed, hands-on exercises will help you solidify your knowledge and allow you to practice using Dependency Injection in a controlled environment.

This course puts emphasis on professional, pragmatic and time-tested techniques and best practices. All the material that you'll learn has been thoroughly tested and evaluated in real production Android applications. You can even copy large parts of the source code from the tutorial application to your own projects to spare yourself much time and headache.

  • 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 learning Dagger, but, unfortunately, some still give up in the process. This course will make your learning journey more efficient and enjoyable, ensuring that you acquire these valuable skills, which are in exceptionally high demand in the Android industry.

So, if you want to learn Dependency Injection, Dagger and Hilt to develop clean and maintainable Android applications - this course is for you.

Enroll now

What's inside

Learning objectives

  • 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

Syllabus

Introduction
Fundamental Dependency Injection Techniques
Extraction of MVC Views Construction Logic into a Factory
Dependency Injection Terminology
Read more
Comparison Between Fundamental Dependency Injection Techniques
Dependency Injection Puzzlers and Large-Scale Structure
Dependency Injection Architectural Pattern
Architectural Patterns
Dependency Injection Architectural Pattern (DIAP)
Fundamental Dependency Injection Techniques vs DIAP
Tutorial Application
Tutorial Application Demo
How to Get the Source Code of the Tutorial Application
Tutorial Application Code Review
Tutorial Application Refactoring Rationale
Journey to Dependency Injection in the Tutorial Application
Extraction of the User Interface Logic into MVC View
Exercise 1
Base Class for MVC Views
Extraction of the Domain Logic into Use Case
Exercise 2
Extraction of the Dialogs Management Logic into Dialogs Navigator
Extraction of the Navigation Logic into Screens Navigator
Model View Controller (MVC) Architectural Pattern
Sharing an Instance of a Service among Multiple Clients
Removing Unneeded "Proxy" Dependencies
The Law of Demeter
Refactoring the Use Case According to the Law of Demeter
Exercise 3
Application Composition Root
Lazy Initialization of Services
Activity Composition Root
Exercise 4
Exercise 4 Solution
Runtime Construction Arguments
Exercise 5
Presentation Composition Root
Tutorial Application Refactoring Summary
Pure Dependency Injection
The Main Benefit of Dependency Injection
Context Isolation
Objects vs Data Structures
Injecting Services "from Outside"
Convention Over Configuration (CoC)
Dependency Injection Frameworks
Dagger 2 Tutorial
Dagger 2
Gradle Configuration
Components and Modules
Exercise 6
Scopes
Component as Injector
Dependent Components
Exercise 7
Subcomponents
Exercise 8
Multi-Module Components
Automatic Discovery of Services
Provider Methods in Modules vs Automatic Discovery
Workflow with Dagger
Dagger Tutorial Summary
Additional Dagger Conventions
Android Services and Dialogs
Static Provider Methods and Component Builders
Type Bindings
Qualifiers
Providers
Dagger and ViewModel
ViewModel
Incorrect ViewModel Integration
Dedicated Factories for ViewModels
Refactoring ViewModel Factories According to the Law of Demeter
Centralized Factory for ViewModels
Multibinding
ViewModel with SavedState
Why ViewModel is So Complex
Simplification of ViewModel with SavedState
Hilt
Hilt's Fundamental Assumptions
How to Get the Source Code
Hilt Gradle Setup
Removing Dagger Components
Hilt Injection Mechanics
Installing Modules into Components
Hilt Scopes
Providing AppCompatActivity
Hilt and ViewModel
Hilt Summary
Course Summary
Bonus Lecture

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Covers Dagger and Hilt, which are industry-standard dependency injection frameworks that are widely used in professional Android development environments
Includes hands-on exercises and a tutorial application on GitHub, which allows learners to practice and apply their knowledge in a practical setting
Explores the Model View Controller (MVC) architectural pattern, which is a foundational concept in software engineering and Android app development
Teaches techniques that have been thoroughly tested and evaluated in real production Android applications, ensuring relevance and applicability
Requires learners to refactor code according to the Law of Demeter, which is a principle that promotes loose coupling and maintainability
Discusses ViewModel with SavedState, which may be complex and require simplification, potentially adding to the learning curve

Save this course

Save Dependency Injection in Android with Dagger and Hilt to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Dependency Injection in Android with Dagger and Hilt with these activities:
Review Android Fundamentals
Strengthen your understanding of core Android concepts like Activities, Fragments, and Services. This will provide a solid foundation for grasping Dependency Injection within the Android framework.
Show steps
  • Review the official Android documentation on core components.
  • Complete a basic Android tutorial project.
  • Identify areas where you feel less confident and focus your review there.
Read 'Dependency Injection'
Gain a deeper understanding of the underlying principles of Dependency Injection. This will help you appreciate the benefits and complexities of using Dagger and Hilt in Android.
Show steps
  • Read the book cover to cover, taking notes on key concepts.
  • Try to relate the concepts to your existing Android development knowledge.
  • Identify areas where you have questions and research them further.
Implement Manual Dependency Injection
Practice implementing Dependency Injection manually in a small Android project. This will help you understand what Dagger and Hilt are doing under the hood and appreciate their benefits.
Show steps
  • Create a new Android project with a simple UI.
  • Identify dependencies that can be injected into your Activities and Fragments.
  • Implement manual Dependency Injection using constructors or setter methods.
  • Write unit tests to verify that dependencies are being injected correctly.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Read 'Clean Architecture'
Learn how to structure your Android applications for maintainability and testability. This will help you use Dependency Injection more effectively and create cleaner, more robust code.
View Clean Architecture on Amazon
Show steps
  • Read the book cover to cover, taking notes on key concepts.
  • Try to relate the concepts to your existing Android development knowledge.
  • Identify areas where you have questions and research them further.
Explore Dagger 2 Examples
Work through online tutorials that demonstrate the use of Dagger 2 in Android applications. This will provide practical experience with the framework and help you understand its key components.
Show steps
  • Find several online tutorials that cover Dagger 2 in Android.
  • Follow the tutorials step-by-step, paying attention to the code examples.
  • Modify the examples to experiment with different Dagger 2 features.
Refactor an Existing App with Hilt
Take an existing Android application (even a small one) and refactor it to use Hilt for Dependency Injection. This will provide valuable hands-on experience with Hilt and help you understand how to migrate existing codebases.
Show steps
  • Choose an existing Android project to refactor.
  • Add the necessary Hilt dependencies to your project.
  • Identify components that can be managed by Hilt.
  • Replace manual Dependency Injection with Hilt annotations.
  • Test your application to ensure that everything is working correctly.
Write a Blog Post on DI in Android
Solidify your understanding by writing a blog post explaining Dependency Injection in Android with Dagger and Hilt. This will force you to organize your thoughts and articulate the concepts clearly.
Show steps
  • Choose a specific aspect of Dependency Injection in Android to focus on.
  • Research the topic thoroughly and gather relevant information.
  • Write a clear and concise blog post explaining the concept.
  • Include code examples to illustrate your points.
  • Proofread and edit your blog post before publishing it.

Career center

Learners who complete Dependency Injection in Android with Dagger and Hilt will develop knowledge and skills that may be useful to these careers:
Android Developer
An Android Developer builds applications for the Android platform, and this course helps one to create clean and maintainable applications. Mastery of dependency injection, which is covered in the course, is crucial for building scalable and testable software. This course's emphasis on professional techniques and best practices directly translates to improved code quality and efficiency in a developer's day-to-day work. The detailed exploration of Dagger and Hilt frameworks in this course is particularly relevant for those seeking to excel in Android development.
Mobile Application Developer
A Mobile Application Developer designs and implements software for mobile devices, and this course provides fundamental knowledge related to Android applications. The course's focus on dependency injection helps promote modular and maintainable code, contributing to a mobile application developer's ability to create complex applications more efficiently. The practical exercises in this course assist in applying these concepts in real-world contexts. Also, the study of Dagger and Hilt offered by this course helps set a developer apart from others.
Software Engineer
A Software Engineer designs, develops, and maintains software systems, and this course provides a valuable deep dive into dependency injection that elevates one's skillset to write higher quality code. The course's teaching of Dagger and Hilt frameworks helps a software engineer build modular, testable applications. Through hands-on exercises, this course enables a software engineer to apply dependency injection to improve application architecture, which is important in complex software projects. The best practices highlighted in the course are directly applicable and beneficial for a software engineer.
Mobile Software Architect
A Mobile Software Architect is responsible for the high level design of mobile applications, and this course provides the necessary skills to understand modern architectures involving dependency injection. This course's curriculum, by focusing on hands-on experience with Dagger and Hilt, helps a mobile software architect ensure that their architecture is sound and practical. This course will be especially useful to any architect because it focuses on the best practices and time-tested techniques used in real production applications, which are critical for a mobile software architect.
Technical Lead
A Technical Lead guides development teams, and this course emphasizes best practices when using dependency injection. Technical leads will benefit greatly from the course's hands-on exercises and tutorial application. The course focuses on architectural patterns, and the exploration of how to use Dagger and Hilt help a technical lead guide their team through the complexities of modern Android development. A technical lead needs to have a firm grasp of the material covered by this course to help guide their team to success.
Application Architect
An Application Architect is responsible for the design and structure of applications, and this course is especially valuable for understanding and applying dependency injection. The course reviews architectural patterns, and the hands-on exercises using Dagger and Hilt help reinforce core concepts. The material in this course is specifically designed for application architects who want to design scalable and efficient systems. An application architect will be able to leverage the knowledge gained in this course to build maintainable and robust applications.
Backend Engineer
A Backend Engineer develops the server side logic for applications, and while this course is Android focused, the underlying concepts of dependency injection are broadly applicable to backend development. The principles of dependency injection this course teaches, such as its use for modularity and testability, are concepts that help a backend engineer create robust and scalable systems. Although the course uses Android specific tooling, a backend engineer may find this course helpful as the underlying principles are transferable.
Software Consultant
A Software Consultant advises clients on software solutions, and the in-depth knowledge of dependency injection that this course provides will enhance a consultant's ability to make recommendations. This course's focus on Dagger and Hilt, along with its emphasis on best practices, gives a software consultant a deeper understanding of modern Android development. Clients will value a software consultant who has studied dependency injection and can guide them in making informed decisions about their software projects. This course may enhance one's understanding of application architecture.
Solutions Architect
A Solutions Architect designs the structure of IT systems and applications, and this course may be useful for understanding dependency injection in Android systems. Though this course primarily focuses on Android development, the principles of dependency injection discussed here are applicable to system design more generally. Specifically, the practical exercises and the focus on best practices this course provides will be useful for a solutions architect who is designing a system that includes Android components. The principles of clean and testable code this course emphasizes are important at the systems level.
Quality Assurance Engineer
A Quality Assurance Engineer tests software for quality, and this course can be useful as it goes into detail on how to build testable applications. The modular design emphasized when using dependency injection helps a quality assurance engineer design effective testing strategies. While direct coding experience is not always necessary in this role, an understanding of how clean code is produced helps a quality assurance engineer better develop test strategies. The hands-on exercises in this course offer direct insights into development.
DevOps Engineer
A DevOps Engineer manages and automates software delivery, and while this course is focused on application development, understanding the principles of dependency injection may be helpful for deployment pipelines. A DevOps engineer may find the principles of modular system design in this course useful. The best practices and techniques are also applicable to the broader context of software development and deployment. The focus on best practices within this course is valuable to a DevOps engineer.
Systems Analyst
A Systems Analyst studies computer systems and makes recommendations for improvements, and this course gives insights into Android architectures with dependency injection. The dependency injection concepts covered in this course are useful for understanding software architecture, thus allowing a systems analyst to make better recommendations. While a systems analyst may not be deeply involved in the specifics of Android development, the course helps broaden one's understanding of software development best practices. This course may be helpful for a systems analyst who wishes to have a better understanding of modern application development.
Project Manager
A Project Manager oversees software development projects and may benefit from this course as they need to communicate with various developers. A project manager responsible for Android projects needs a strong understanding of the development process. This course will help give them a basic understanding of dependency injection and provide an understanding of modern Android development, especially how to use Dagger and Hilt. These help a project manager communicate more effectively with their team. While a project manager is not a coding role, a project manager who has taken this course can better guide their team.
Technical Writer
A Technical Writer creates documentation and training materials, and this course may be useful as it offers technical insights into dependency injection. Technical writers may benefit from this course as it provides a detailed look at specific software development techniques. Understanding dependency injection, Dagger, and Hilt can enhance the technical writing of a technical writer who is documenting Android code. A technical writer who needs to create tutorials or explain software architectures may find this course useful.
UI Designer
A User Interface Designer creates the visual interface of applications. Although this course is not focused on design, it may be useful for a UI Designer to get an understanding of the underlying principles of software development. A UI Designer who understands the complexities of application development, as covered by this course, can make more informed decisions during their design process. This course might be helpful for a UI Designer who desires a better understanding of the technical aspects of application creation.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Dependency Injection in Android with Dagger and Hilt.
Provides a comprehensive overview of Dependency Injection principles and patterns. It explains the core concepts behind DI and how it promotes loose coupling and testability. While not Android-specific, understanding the general principles is crucial before diving into Dagger and Hilt. This book is more valuable as additional reading to provide a strong theoretical foundation.
Discusses architectural patterns and principles that complement Dependency Injection. Understanding Clean Architecture can help you design more maintainable and testable Android applications that leverage Dagger and Hilt effectively. This book is more valuable as additional reading to provide a strong theoretical foundation for designing robust applications.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser