Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
Android Dependency Injection with Dagger 2 and Kotlin

Android Dependency Injection with Dagger 2 and Kotlin

1h 53mAdvanced2019-02-01

Authors

G. Blake Meike

G. Blake Meike

Engineer, Architect, and Code Poet

Course details

Dependency injection (DI) is increasingly popular in Android. Injection reduces the amount of code required in an application, reducing debugging overhead. A DI tool like Dagger, which assumes responsibility for creating and providing dependencies of an object, can help make your code cleaner, easier to understand, and easier to test. Dagger 2, the latest version, is particularly highly regarded for its speed and compile-time safety. In this course, Blake Meike teaches Android developers to use Dagger 2 with Kotlin—the newly embraced Android programming language. Review Dagger basics, including the four major types of dependency injection: method, field, lazy, and provider injection. Learn how to use Dagger annotations to declare dependencies, satisfy them, and create reusable modules you can share across your apps. Plus, learn about multibinding and components, the new way of associating modules with injection targets in Dagger 2.

Learning objectives
Dagger basics
Method and field injection
Lazy and provider injection
Dagger annotations: @Module, @Binds, @Provides, and @Named
Multibinding
Components and subcomponents
Singletons and custom scope

Skills covered

KotlinAndroid DevelopmentAndroidMobile DevelopmentGoogleLearningOpen Source

Concepts

0. Introduction

  • 01 - Improve dependency injection with Dagger
  • 02 - What you should know
  • 03 - Using the exercise files

1. Basics

  • 04 - What is Dagger
  • 05 - Why use Dagger
  • 06 - Setting up a Dagger project

2. Essential Dagger

  • 07 - Building the graph with @Inject and @Component
  • 08 - Introducing Dagger
  • 09 - Method and field injection
  • 10 - Lazy and provider injection

3. Modules

  • 11 - When Dagger can't figure it out - @Modules and @Binds
  • 12 - When it's complicated - @Provides
  • 13 - When types are not enough - @Named
  • 14 - Multibinding - Sets
  • 15 - Multibinding - Maps with simple keys
  • 16 - Real-world example - Architecture components #1
  • 17 - Real-world example - Architecture components #2
  • 18 - Real-world example - Architecture components #3
  • 19 - Multibinding - Maps with complex keys
  • 20 - Real-world example - Architecture components solved

4. Components

  • 21 - @Components review
  • 22 - Extending the builder with @Component.Builder and @BindsInstance
  • 23 - @Component dependencies
  • 24 - Introducing @Subcomponents
  • 25 - @Subcomponents review
  • 26 - Extending the subcomponent builder

5. Scope

  • 27 - Rethinking the graph
  • 28 - @Singletons and @Reuseable
  • 29 - Custom @Scope

Conclusion

  • 30 - Next steps

Related courses

Related learn paths

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
zarinpal
zibal