Dagger 2
List of resources to learn aboutLinks in bold are links you should defenitely go through.
Prior to learning Dagger
- SOLID (object-oriented design)
- S is for Single Responsibility Principle
- Dependency Inversion Principle
- Android Development: the SOLID Principles
- Single Responsibility Principle and Context
- Architecting Android...The clean way?
- MVP for Android: how to organize the presentation layer
- Robert C. Martin - Clean Architecture
- SOLID Principles : The Definitive Guide
From various Bloggers
- [Youtube] Dependency Injection
- Dependency Injection in Android with Dagger 2 - Simple tutorial to get you started on DI
- Take a Stab at Test-Friendly Architecture with Dagger 2 - Why you need Dagger and where it fits in
- Dagger 2 for Android Beginners — Introduction
- The lost droid and the magic Dagger: an intro to dependency injection for Android
- Dependency Injection with Dagger 2
- Tasting Dagger 2 on Android
- Dagger 2 Dependency Injection for Android Developers
- A Friendly Introduction to Dagger 2: Part 1
- A Friendly Introduction to Dagger 2: Part 2
- Inversion of Control Containers and the Dependency Injection pattern
- Dependency Injection Without the Boilerplate: Scoped Objects in Dagger 2
- Dagger 2 Basics - David Medenjak
- Dagger 2: Even sharper, less square - Transitioning from Dagger 1 to Dagger 2 and annoyances in Dagger 2
- Dependency Injection for beginners - Subhash Acharya
- Let’s learn Dagger2 while refactoring a poorly coded Android app
Organised by Blogger
Mindorks
- Introduction to Dagger 2, Using Dependency Injection in Android: Part 1
- Introduction to Dagger 2, Using Dependency Injection in Android: Part 2
- [Github] MindorksOpenSource/android-dagger2-example
- Android Dagger2: Critical things to know before you implement.
- A Complete Guide To Learn Dagger 2
Antonio Leiva
- Dependency injection on Android: Dagger (Part 1)
- Dagger: dependency injection on Android (Part 2)
- Dagger: Scoped object graphs (Part 3)
Vasiliy Zukanov
- Dependency Injection in Android
- Dagger 2 Tutorial
- Dagger 2 scopes demystified
- Advanced Dagger 2 Tutorial (Video)
- [Youtube] Dependency Injection in Android - Best Practices by Vasiliy Zukanov
- [Github] android_application_template
- [Github] idocare-android
Eugene Matsyuk
- Dagger 2. Part I. Basic principles, graph dependencies, scopes.
- Dagger 2. Part II. Custom scopes, Component dependencies, Subcomponents
- Dagger 2. Part three. New possibilities
Mirek Stanek
- Dependency injection with Dagger 2 - Introduction to DI
- Dependency injection with Dagger 2 - the API
- Dagger 2 - graph creation performance
- Dependency injection with Dagger 2 — Producers
- Dependency injection with Dagger 2 - Custom scopes
- Async Injection in Dagger 2 with RxJava
- Inject everything — ViewHolder and Dagger 2 (with Multibinding and AutoFactory example)
- Dagger 2 on production — reducing methods count
- Building UserScope with Dagger2
- Activities Subcomponents Multibinding in Dagger 2
- Dagger2Metrics - measure performance of DI graph initialization
- AndroidDevMetrics - dagger2metrics evolved into metrics for Android development
- Dagger 1 to 2 migration process
Garima Jain
- Dagger 2 : Component.Builder
- Dagger 2 : Check — SingleCheck — DoubleCheck … Scopes
- Dagger 2 : Component Relationships & Custom Scopes
- Dagger 2 Annotations: @Binds & @ContributesAndroidInjector
- [Youtube] Garima Jain - Dagger 2 Android: Defeat the Dahaka
Roberto Orgiu
Vandolf Estrellado
- [HOW-TO] Android Dagger (2.11/2.12/2.13) Butterknife (8.7/8.8) MVP (Part 1)
- [HOW-TO] Android Dagger (2.11/2.12/2.13) Butterknife (8.7/8.8) MVP (Part 2)
- [HOW-TO] Android Dagger (2.11/2.12/2.13) Butterknife (8.7/8.8) MVP (Part 3)
Santosh Dhakal
- Part 1: Simple Ways To Stab With Dagger 2 ( Scenario )
- Part 2: Simple Ways To Stab With Dagger 2 ( Module , Component and Field Injection)
- Part 3: Simple Ways To Stab With Dagger 2 ( Method Injection, Constructor Injection)
- Part 4: Simple Ways To Stab With Dagger 2 ( Module Dependencies and Named Providers)
- Part 5: Simple Ways To Stab With Dagger 2 ( Component Dependency & Subcomponent)
- Part 6: Simple Ways To Stab With Dagger 2 ( Scopes & Singletons)
- Part 7: Simple Ways To Stab With Dagger 2 ( Life of a scoped object)
- Part 8: Simple Ways To Stab With Dagger 2 ( Custom Scope)
Hafiz Waleed Hussain
- Dagger 2 ( Caution: PLEASE TRY AT HOME ) Part 1
- Dagger 2 ( Caution: PLEASE TRY AT HOME ) Part 2
- Dagger 2 ( Caution: PLEASE TRY AT HOME ) Part 3
- Dagger 2 ( Caution: PLEASE TRY AT HOME ) Part 4
Dagger Tips and Tricks
- Keeping the Daggers Sharp
⚔️ - Inject interfaces without provide methods on Dagger 2
- That Missing Guide: How to use Dagger2
Dagger Android modules
- New Android Injector with Dagger 2 — part 1
- New Android Injector with Dagger 2 — part 2
- [Youtube] Valentin Hinov - Understanding Dagger 2 on Android
- Dagger 2: Android Modules
- MVP with Dagger 2.11
Advanced Dagger Blogs
- [Youtube] Optimizing Dagger on Android: Developer Workflow and Runtime Performance
Slides - Repository layer using Room and Dagger 2 — Android
- Low Coupling With Rx and Dagger 2 in Android
- When the Avengers meet Dagger2, RxJava and Retrofit in a clean way
- MVVM architecture, ViewModel and LiveData — Part 2 (DI)
- Background Work with Android Job and Dagger
- Realm Migrations Supercharged with Dagger
- Retaining Dagger components across configuration change using Service-Tree
- Marinator: Delicious Dependency Injection
Testing
- Dagger 2 Android playground: Let’s play with different configurations and tests
- Fast and reliable UI tests on Android
- Providing test doubles with Dagger 1 and Dagger 2
- IdlingResource, Dagger and Junit rules
- Android testing using Dagger 2, Mockito and a custom JUnit rule
- Using Dagger For Testable Code
- How Dagger 2 Helps In Android Espresso Tests
- Activity Espresso Test With Dagger’s Android Injector
- DaggerMock - A JUnit rule to easily override Dagger 2 objects
With Kotlin
- Moving from Dagger to Koin — Simplify your Android development
- Better dependency injection for Android
- Dagger 2 in only 4 code lines
Videos
- Dagger 2 - A New Type of dependency injection
- The Future of Dependency Injection with Dagger 2 - Jake Wharton
- Dependency Injection with Dagger 2 - Brandon Gogetap
- Dependency Injection Using Dagger 2 - Patrick Hammond
- Architecting Android Applications with Dagger - Jake Wharton
- Understanding Dagger 2's Codegen implementation by Gregory Kick
- Mike Nakhimovich: Dagger 2: @Reusable, static @Provides, scopes
- Dagger 2 @ Pandora
- 360|AnDev 2016 - Daniel Lew: Dependency Injection Made Simple
- Inject with Dagger by Mateusz Herych
- Understanding Dagger 2's Generated Code by Ron Shapiro & David P. Baker
- Swordfighting with Dagger by Mike Nakhimovich
- Dagger Slidenerd Tutorials
Podcasts
Lessons from Caster.io
Github repos
- https://github.com/Karumi/KataSuperHeroesAndroid
- https://github.com/iammert/dagger-android-injection
- https://github.com/Ekito/koin
- https://github.com/hitherejoe/MvpBoilerplate
- https://github.com/ribot/android-boilerplate
- https://github.com/androidstarters/generator-android-mvp-starter
- https://github.com/gk5885/dagger-android-sample
- https://github.com/android10/Android-CleanArchitecture
Stackoverflow Questions to go through
- How to set up DAGGER dependency injection from scratch in Android project?
- Dagger 2 subcomponents vs component dependencies
- What determines the lifecycle of a component (object graph) in Dagger 2?
- Dagger- Should we create each component and module for each Activity/ Fragment
- How do you override a module/dependency in a unit test with Dagger 2.0?
- Android Unit Tests with Dagger 2
- Dagger2 Custom Scopes : How do custom-scopes (@ActivityScope) actually work?
- How do you organise your Dagger 2 modules and components?
- Dagger 2 Custom Scope for each Fragment (or Activity etc…)
- How do you override a module/dependency in a unit test with Dagger 2.0?
- Dagger 2 scope and subcomponents
- Dagger 2 error: dependency “cannot be provided without an @Inject constructor” while it actually annotated with @Inject
- Scopes in Dagger 2
- Problems with singletons when using component dependencies
- How do different retention policies affect my annotations?
- What's the difference between interface and @interface in java?