Dagger 2 @Inject & @Component Tutorial - CheezyCode (Hindi) #3

Поделиться
HTML-код
  • Опубликовано: 9 янв 2025
  • Learn Dagger 2 @Inject & @Component Annotations. This video covers - how Dagger2 creates the required objects for you, what is component in Dagger 2, what is the use of @Inject annotation. Learn how dagger does constructor injection in Android. Learn all about this in Hindi.
    Topics covered -
    1. What is @Component in Dagger2 Android?
    2. What is @Inject Annotation in Dagger?
    3. Implement Constructor Injection in Dagger2
    4. Complete Example of Dagger 2 in Android.
    Complete Dependency Injection Playlist Link -
    • Dagger 2 - Dependency ...
    Complete Android Architecture Components Playlist -
    • Android Architecture C...
    Beginner series in Android Playlist (Hindi) -
    • Android Tutorials Step...
    Kotlin Beginners Tutorial Series -
    • Kotlin Beginner Tutori...
    For more info - visit the below link
    www.cheezycode.com
    We are social. Follow us at -
    Facebook - / cheezycode
    Twitter - / cheezycode
    Instagram - / cheezycode

Комментарии • 79

  • @nilesh6929
    @nilesh6929 2 года назад +8

    Very well explained sir, thank you very much ;) Hindi mai sab thik se samaz aata hai, aur aap repeat bhi karte hai, plus visuals se bhi batate hai, thank you very much

  • @satyamiov3791
    @satyamiov3791 Год назад +2

    your best thing is you finish the topic in short video and add only related things and example that make video more understandable
    love the way of presenting content 💙💙

  • @sumankumar9091
    @sumankumar9091 Год назад +3

    I just wanted to take a moment to express my gratitude for all the knowledge and guidance you have provided me in my journey as an Android developer.
    Your lessons have been incredibly valuable and have helped me grow both professionally and personally. I truly believe that your teachings have been instrumental in shaping me into the developer I am today.
    Thank you for being an amazing teacher♥❤🙏🙏🙏🙏🙏

  • @DnyaneshwarMahajan-e8b
    @DnyaneshwarMahajan-e8b Год назад +2

    Simply great! Hats off to you Sir.

  • @ApoorvPandeyDev
    @ApoorvPandeyDev 2 года назад +2

    Your way of explanation, mind blowing!

  • @krunalkathikar2154
    @krunalkathikar2154 Год назад +1

    Great Tutorials 🔥🔥🔥

  • @ackerman6992
    @ackerman6992 2 года назад +2

    Great explanation sir 🙏

  • @analtrivedi007
    @analtrivedi007 2 года назад

    Best dragger tutorial. Thnaks Sir

  • @saeedsharif2463
    @saeedsharif2463 Год назад

    Sir very well explaination

  • @TechSpot56
    @TechSpot56 2 года назад +1

    Thanks for these amazing tutorials. 🙏

  • @SurajKumar-ge1um
    @SurajKumar-ge1um Год назад

    A very great tutorial bhai!! Keep it up!!
    However, I have a question, agar Consumers ko @Inject karke annotate kia jata h(Consumers as it means it will be consuming the objects), to sabse pehle humne UserRegistrationService Class par @Inject kyu kia in the context ki UserRegistrationService ka object banana h? Is Class par @Inject Annotate karne ka matlab to ye hua ki isko object mil rha hoga and ideally, Inject to MainActivity ko hona chahiye kyunki vo consumer h?

  • @rpitpatel1004
    @rpitpatel1004 2 года назад +3

    Great Tutorial Sir, Can you please provide a starter project so we can work on it as we go through the playlist? Thank you🙏

    • @CheezyCode
      @CheezyCode  2 года назад +1

      you can refer the new series or you can refer the github of this repo with MVVM and Retrofit - github.com/CheezyCode/DaggerMVVM

  • @sopnilshinde985
    @sopnilshinde985 9 месяцев назад

    very nice

  • @GunjanBijwe-t1j
    @GunjanBijwe-t1j Год назад

    last music in video...amzinggg

  • @dharmanshah1239
    @dharmanshah1239 Год назад

    thank you very much

  • @nikhilsinghvadhva5333
    @nikhilsinghvadhva5333 2 года назад

    Nicely explained.

  • @2chotti
    @2chotti 6 месяцев назад

    Than you

  • @islamicinsightbysaifi
    @islamicinsightbysaifi 2 года назад

    Very very thanks

  • @vmstudypoint
    @vmstudypoint 2 года назад

    Good
    Is this injection use in java

  • @samirmishra3738
    @samirmishra3738 2 года назад

    Thank you sir

  • @akashsathe6818
    @akashsathe6818 Год назад

    your videos are amazing but my DaggerUserRegistrationComponent class is not generated..

  • @sumitsingh6533
    @sumitsingh6533 Год назад +1

    UserRegistrionComponent not make my Class why...?

  • @vijaykumar-jm1fq
    @vijaykumar-jm1fq 2 года назад +4

    sir i am following your video, i am facing problem in this time that is kapt in dependency showing error and when i use annotation dependency instead of kapt dependency it works fine but getting problem in when i call this class "DaggerUserRegistrationServices". sir help me what should i do now?

    • @shashanksp9168
      @shashanksp9168 Год назад +2

      +1

    • @rizwanahmedkhan237
      @rizwanahmedkhan237 Год назад

      implementation 'com.google.dagger:dagger:2.45'
      kapt 'com.google.dagger:dagger-android-processor:2.45'
      kapt 'com.google.dagger:dagger-compiler:2.45'
      Use this dependency for dagger and kapt , it fixed my problem

    • @yashraghuvanshi6449
      @yashraghuvanshi6449 Год назад

      Try this whith implementation (" ") instead of kept(" ")

    • @Vk-bw9cv
      @Vk-bw9cv 11 месяцев назад

      annotationProcessor 'com.google.dagger:dagger-compiler:2.40.5'

  • @Usmankhan-yr3dl
    @Usmankhan-yr3dl 2 года назад

    even mvvm architecture was easy to learn but dependancy injection is hard to understand , complex topic It is

    • @CheezyCode
      @CheezyCode  2 года назад +1

      It is easy...just think before you jump to another video...why I did it the way I did it...what's the benefit do we get by writing code like this - just think for a moment...try to write down your problems, your thoughts on each concept. It will start making sense..
      Still stuck - write down in comments for me...I will help you out

  • @haider-u9s
    @haider-u9s Год назад

    need video on kmm

  • @sachinsharma7804
    @sachinsharma7804 2 года назад

    So using inject dagger knows what kind of object to build. Is that right?

    • @CheezyCode
      @CheezyCode  2 года назад +2

      Using Inject helps dagger to build that particular object. It is a way to tell Dagger that if you need X object - use this constructor annotated with @Inject.
      One more use case of @Inject will be covered in next video.

    • @sachinsharma7804
      @sachinsharma7804 2 года назад

      @@CheezyCode understood sir and thank you for uploading such advance topics. 👍🏻

  • @tayyabali4169
    @tayyabali4169 2 года назад

    sir java mein bhi bna den tutorial

  • @pragyanshreedas23594
    @pragyanshreedas23594 Год назад

    Where can I get the source code to understand more about this ?

  • @Hjjj-zh8sn
    @Hjjj-zh8sn 2 года назад

    is hilt also comming ?

  • @sundern990
    @sundern990 2 года назад

    🙏🏻

  • @abhishekpatidar2129
    @abhishekpatidar2129 Год назад

    can you please upload the code in github

  • @rajeevranjan7461
    @rajeevranjan7461 11 месяцев назад

    component class is not building

    • @adityatanwar9185
      @adityatanwar9185 11 месяцев назад

      Add this to dependencies
      implementation ("com.google.dagger:dagger-android-support:2.50")

  • @SudhanshuKumar-xy6xv
    @SudhanshuKumar-xy6xv 2 года назад

    @ - at

  • @kidz12gaming
    @kidz12gaming Год назад +1

    Execution failed for task ':app:kaptDebugKotlin'.
    > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
    > java.lang.reflect.InvocationTargetException (no error message)
    getting this error

  • @roshannepal388
    @roshannepal388 2 года назад +3

    When I built my code , I Got this error .
    So I am unable to use DaggerUserRegistrationServiceComponent.
    I need your help sir.
    Execution failed for task ':app:kaptDebugKotlin'.
    > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
    > java.lang.reflect.InvocationTargetException (no error message)
    * Try:
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.

    • @CheezyCode
      @CheezyCode  2 года назад

      Rebuild once

    • @roshannepal388
      @roshannepal388 2 года назад

      @@CheezyCode I got same error once again after rebuild

    • @CheezyCode
      @CheezyCode  2 года назад

      Not sure...need to check - you can refer the codebase on GitHub.com /cheezycode / dagger examples

    • @amarnathbaitha979
      @amarnathbaitha979 2 года назад +2

      @Rosan Nepal
      Please use this below code, I was facing same issue. Now it is working fine.
      plugins {
      id 'com.android.application'
      id 'org.jetbrains.kotlin.android'
      id 'kotlin-kapt'
      }
      implementation 'com.google.dagger:dagger:2.25.3'
      kapt 'com.google.dagger:dagger-android-processor:2.25.3'
      kapt 'com.google.dagger:dagger-compiler:2.25.3'

    • @albedo9617
      @albedo9617 2 года назад

      You probably don't need this anymore so commenting for other people, replace the kapt 'com.google.dagger....' with annotationProcessor 'com.google.dagger....' That fixed it for me.

  • @GurwinderSingh-qr1sf
    @GurwinderSingh-qr1sf 2 года назад

    Thanks for these amazing tutorials. 🙏