Dagger 2 Android Tutorial – Implementing Dagger Dependency Injection
Video by Simplified Coding via YouTube
Source
Hi everyone, welcome to Dagger 2 Android Tutorial. In the last video we learned the Basics of Dagger; and now in this Dagger 2 Android Tutorial, we will finally implement Dagger in our Project.
In this video we will Inject our ViewModel inside Fragment using Dagger Dependency Injection.
The steps to implement Dagger Dependency Injection in your project are:
#1 Add @Inject annotations to classes that you want to inject
#2 Create a module for the classes that cannot be constructor injected e.g. Interfaces
#3 Create Injectors for Activity/Fragments
#4 Create App Component
#5 Instantiate Dagger inside your application class, implement HasAndroidInjector and inject DispatchingAndroidInjector
#6 Use AndroidInjection.inject to inject dependencies with the help Inject annotation
You can get the Project from Here 👉 👉 https://bit.ly/3sy0Ghp
Dagger Official Documentation 👉 https://dagger.dev/dev-guide/android
If you are having trouble navigating between different lessons of this Android Dependency Injection Course then you can go to this link.
👉 https://simplifiedcoding.in/course/android-dependency-injection-course
Here you will find all the videos of this course in chronological order.
If you want to get in touch with me; you can find my contact details here:
👉 https://www.simplifiedcoding.net/about/
Finally, If you love my content please SHARE my courses to your friends. You can share this course to your Facebook, WhatsApp etc.
For more contents related to Software Development visit my website.
👉 https://www.simplifiedcoding.net
You can SUPPORT me if you want
👉 Patreon: https://www.patreon.com/BelalKhan
👉 UPI (India Only): probelalkhan@okaxis
👉 PayTM (India Only): +917549161079
👉 PayPal: https://www.paypal.me/probelalkhan
You can also check some of my other courses from these links
👉 Android Testing Tutorial: https://bit.ly/2OWyO95
👉 Android MVVM Tutorial: https://bit.ly/3iLfVzu
👉 Android Game Development Tutorial: http://bit.ly/38JmltC
👉 Retrofit Android Tutorial: http://bit.ly/2DEwAl1
👉 Android RecyclerView Tutorial: http://bit.ly/2TqVjPz
👉 Android Room Tutorial: http://bit.ly/2PfQHeN
👉 Firebase Auth Tutorial: http://bit.ly/2WUGhEo
👉 Android Notification Tutorial: http://bit.ly/2Sc6jQl
👉 Building a Complete Wallpaper App: http://bit.ly/30UN8zV
👉 Build Tic Tac Toe in Android: http://bit.ly/30goxW0
❤️❤️ Thank You All for the Love and Support ❤️❤️
#AndroidDependencyInjection
#Dagger2
#Hilt