Hilt Dependency Injection (Kotlin Beginner Example)

  Переглядів 41,949

CodingWithMitch

CodingWithMitch

3 роки тому

The BEST android courses in the world: codingwithmitch.com/
In this video I show you how to use Hilt for dependency injection on android. This is a Kotlin example for beginners. Some of the other dependency injection libraries are Koin, Kodein, and Dagger. Hilt is the simplest way to do dependency injection on android (in my opinion). Hilt is built on top of dagger and makes dagger much simpler.
Code: github.com/mitchtabian/MVVMRe...
Follow me:
Instagram: / codingwithmitch
Twitter: / mitch_tabian
.
.

КОМЕНТАРІ: 102
@NMNaufaldo
@NMNaufaldo 3 роки тому
12:02 In the new version of Hilt, `ApplicationComponent` just change to `SingletonComponent`
@552kostya
@552kostya 2 роки тому
Thanks a lot man!
@nowrosemuhammadragib4337
@nowrosemuhammadragib4337 Рік тому
Thanks...
@codinginflow
@codinginflow 3 роки тому
Here is your engagement
@codingwithmitch
@codingwithmitch 3 роки тому
nice 1
@codinginflow
@codinginflow 3 роки тому
@@codingwithmitch What I don't even get a heart?
@felipefranco7444
@felipefranco7444 3 роки тому
@@codinginflow lol coding in flow you are also an awesome mentor!
@codinginflow
@codinginflow 3 роки тому
@@felipefranco7444 What do you mean "also"?
@felipefranco7444
@felipefranco7444 3 роки тому
@@codinginflow Mitch is a mentor so are you . Both teach developers in a great way!
@samyups1111
@samyups1111 3 роки тому
I started learning Kotlin/Android in December and you are one of my constant go-to person! Also, THANK YOU for switching to Kotlin!!!
@richardgarcia6677
@richardgarcia6677 2 роки тому
Holy mother, i just ended up learning dagger and started with hilt so hilt make things a lot easier an much more clean. the negative point is tha it is in alpha release and a lot of deprecations happens making the maintenance a little much effort in this beggining but it definitely will be a strong requisite in the near future i will definitely use it... Thanks for the course you definitely nail it
@asmg4m3r65
@asmg4m3r65 2 роки тому
First time on the channel and I already loved your content! Keep it up, brother!
@kostyabakay
@kostyabakay 3 роки тому
Best DI tutorial! I have tried to learn Dagger several times but always I was giving up because of the complexity of the library...
@jonathanaustin4328
@jonathanaustin4328 9 місяців тому
Thanks for the vid, already easier to understand. Looking for the next one already.
@lifeOfCharlesMaina
@lifeOfCharlesMaina 2 роки тому
My best teacher any time when it comes to Android things 💯
@talhashaikh1435
@talhashaikh1435 2 роки тому
Nicely Explained in short..Sometimes few words can do magic ..this particular tutorial does the same
@tanjimahmed213
@tanjimahmed213 2 роки тому
Thank you, Mitch! Here is your engagement and your like! Keep it up! 👍
@tonnie7079
@tonnie7079 2 роки тому
Great Content and demonstration, easy to follow
@hellespont5072
@hellespont5072 3 роки тому
The gift that keeps on giving! 😁
@shafaquesattar
@shafaquesattar 3 роки тому
You are doing a great job..
@DS-bz4mz
@DS-bz4mz Рік тому
Very concise and helpful explanation, thank you :)
@SmemsMusic
@SmemsMusic 3 роки тому
Really good explanation man, thank you.
@lirjarmuhametova8516
@lirjarmuhametova8516 10 місяців тому
Я плохо знаю английский язык, но вы так хорошо объясняете, что даже я всё поняла. Спасибо большое за урок. Пожалуйста, продолжайте снимать видео
@hotellinaweb
@hotellinaweb Місяць тому
Hey Mitch I liked the video 😁😁 I hope I will be able to understand why are we doing DI by next two videos.
@ecemvarma4546
@ecemvarma4546 2 роки тому
Thanks for the vid best explanation!
@abdulrasheedilori7680
@abdulrasheedilori7680 2 роки тому
nice one mitch
@inmikeshands1722
@inmikeshands1722 3 роки тому
I am a codingWithMitch founding member subscriber and honestly its one of the best if not the best subscription I ever made in my life highly recommend, this is my first time seeing hilt at work and yes it is much easier and more straightforward to understand and to use then dagger2 so thank you Mitch for everything you are doing for us please keep it up
@codingwithmitch
@codingwithmitch 3 роки тому
thanks for the testimonial :)
@PhilandNevie
@PhilandNevie 3 роки тому
Great summary.
@muhammedshahin6299
@muhammedshahin6299 Рік тому
Awesome one
@judefrancis
@judefrancis 3 роки тому
Awesome stuff
@alexiachimov9817
@alexiachimov9817 3 роки тому
Awesome tutorials !
@gamerdot0
@gamerdot0 3 роки тому
Thank you!
@mal7othify
@mal7othify 3 роки тому
Great engagement
@danyelsh874
@danyelsh874 2 роки тому
thanks, dear mitch
@abdelrhmantalat9813
@abdelrhmantalat9813 3 роки тому
Greate Work!!
@staceyrichards8656
@staceyrichards8656 3 роки тому
Thanks Mitch. Very clear and concise explanation. It helped me a lot.
@hanamanth_vlogs6565
@hanamanth_vlogs6565 3 роки тому
Very good content sir
@genshinassassin1139
@genshinassassin1139 3 роки тому
Watching this video 69th time Still hilt is something to learn🧐 And will learn it soon
@ivanbartolelli9361
@ivanbartolelli9361 3 роки тому
Hey Mitch, if you someday come to Argentina I will be glad to buy you a good Fernet with Coca, you deserve it dude!
@MaisUmSomente
@MaisUmSomente 3 роки тому
I will try that.
@vanosuperhero
@vanosuperhero 2 роки тому
Thanks!
@MedAmineSouaiaia88
@MedAmineSouaiaia88 3 роки тому
Thank you; you made DI clear for me.
@danyelsh874
@danyelsh874 2 роки тому
perfect
@siddharthashankar8396
@siddharthashankar8396 Рік тому
Nice Video
@taar1
@taar1 3 роки тому
In Android Studio there's a presentation mode: View -> Appearance -> Enter Presentation Mode Could help for future videos :)
@roshanfx369
@roshanfx369 3 роки тому
Thanks
@silviavargas931
@silviavargas931 Рік тому
Wow I like
@faithphysicsphilosophy6721
@faithphysicsphilosophy6721 3 роки тому
Thank you
@Hacker-x
@Hacker-x 3 роки тому
This time.. I am watching the video in the car and waiting the order from restaurant.. Thanks😎
@codingwithmitch
@codingwithmitch 3 роки тому
Way to be efficient
@Hacker-x
@Hacker-x 3 роки тому
Thank you Mitch. I like your channel.. I am following you from Oman
@muzammalabdulghafoor6418
@muzammalabdulghafoor6418 3 роки тому
Man! You look better with bear, MaShaAllah!
@abolfazlrezaei5397
@abolfazlrezaei5397 2 роки тому
for who don't know about MaShaAllah, MashaAllah is a word that Muslims says to another guy :), so that means are you so good man 😂
@johnxina6996
@johnxina6996 2 роки тому
lol, no
@maXXik1337
@maXXik1337 3 роки тому
Hello sir, great video as always. Right now, i feel exactly like you described at the end. Which is something i feel incredibly often as being complete programming (Kotlin) newbie.... why do we do this instead of just put val string: String into viewModel constructor, right? I often feel things are way more complicated then they should/could be :| But if you anticipate it, i feel just fine about that, looking forward to next videos. One suggestion: you say that we should use this mostly for testing purposes, so last video if this course (or maybe even whole new series?) should touch testing for beginners and especially how using Hilt simplifies doing so.
@codingwithmitch
@codingwithmitch 3 роки тому
Next course with the cache will include some unit tests
@ahmetbozkan4610
@ahmetbozkan4610 3 роки тому
cool
@chaitanyagopinadh6000
@chaitanyagopinadh6000 3 роки тому
Hi, Everything undterstood well but one doubt how the module methods will call in mainactivity without we call those,Example you showed one randomstring append in mainactivity and printed in log, Could you please clarify me...
@TanujSareenRockStarDeveloper
@TanujSareenRockStarDeveloper 3 роки тому
👍
@electricalprogrammer456
@electricalprogrammer456 Рік тому
🐐🐐🐐🐐
@AkshatKumawat
@AkshatKumawat 3 роки тому
✌️✌️
@mytubekt
@mytubekt 3 роки тому
Great explanation ! :)
@MuhammadNaveed2016
@MuhammadNaveed2016 3 роки тому
First Engagement
@kaiumhossain3208
@kaiumhossain3208 2 роки тому
hey Mitch hilt is not working for new gradle versions 7 and up. It's showing missing dependency but have applied all the dependencies needed
@juniorlapunete4660
@juniorlapunete4660 3 роки тому
Hi Mitch, please can make more videos about CRUD MVI using kotlin?
@codingwithmitch
@codingwithmitch 3 роки тому
I have tons. Look at any of my courses on my website
@abhimanyoosingh7027
@abhimanyoosingh7027 3 роки тому
If possible please suggest how to work admob 💵💵💵 with hilt and viewmodel
@Soaring333
@Soaring333 2 роки тому
I can't get any of the dependency stuff to build. Not sure what I'm missing.
@HelloBayzid
@HelloBayzid 3 роки тому
First view
@mehdiparsaei1867
@mehdiparsaei1867 3 роки тому
The second. Thanks a lot.
@tausifuddinahmed4868
@tausifuddinahmed4868 3 роки тому
is DI only used for making testing easier? Code reusability is another vital reason according to the android official documentation.
@codingwithmitch
@codingwithmitch 3 роки тому
Yes I said that. You use the same instance of an object
@johnybaby9574
@johnybaby9574 3 роки тому
i am liking this video lol
@ankurg_
@ankurg_ 3 роки тому
What if I have two functions of return type String. How Hilt will figure out which dependency to provide?
@codingwithmitch
@codingwithmitch 3 роки тому
Tomorrows video will show you that (part 15)
@ankurg_
@ankurg_ 3 роки тому
@@codingwithmitch Thanks Mitch. Just saw that video and my doubt is clear :)
@JitubhaiyaPhysics
@JitubhaiyaPhysics 3 роки тому
mitch
@codingwithmitch
@codingwithmitch 3 роки тому
jitender
@terencejumba1939
@terencejumba1939 2 роки тому
if you are getting errors after adding hilt when you run build the app:KaptDebugKotlin error remove the @parcelize annotation in recipe model class
@matheuskloster8730
@matheuskloster8730 4 місяці тому
did not work here
@alaadeego5416
@alaadeego5416 2 роки тому
hey mitch ur engagement
@samstoyroom
@samstoyroom 2 роки тому
What about Koin?
@user-jg4pk6bq2g
@user-jg4pk6bq2g 3 роки тому
Mitch, you have site codingwithmitch.com. Did you create it by youself, with you own hands?
@codingwithmitch
@codingwithmitch 3 роки тому
Yep with my own hands ✋
@user-jg4pk6bq2g
@user-jg4pk6bq2g 3 роки тому
@@codingwithmitch Good job! How could you learn so many things?! I admire)
@codingwithmitch
@codingwithmitch 3 роки тому
@@user-jg4pk6bq2g lots of time lol
@erickramones2167
@erickramones2167 2 роки тому
7:52 fontsize was ok, maybe 35.
@muhammadrizwan7179
@muhammadrizwan7179 3 роки тому
Nice, confusion is going away
@igorkluev5682
@igorkluev5682 3 роки тому
comment for the algorithem gods
@bboydarknesz
@bboydarknesz 3 роки тому
ok, report now ApplicationConmponent is deprecated and replaced with SingletonComponent :'D
@weirdyadav
@weirdyadav 3 роки тому
Was your beard always that thick?
@codingwithmitch
@codingwithmitch 3 роки тому
no been working on it
@yuruar
@yuruar 3 роки тому
Nothing is clear
@cristicode4301
@cristicode4301 4 місяці тому
Very shallow bullshit explanation. No one understood anything. Reminds me of Traversy type of explanation.
@tom-wz5le
@tom-wz5le 2 роки тому
Thanks
@udayshah4525
@udayshah4525 3 роки тому
Here is your engagement
@mohammadshahhoud5120
@mohammadshahhoud5120 3 роки тому
Thanks
@anantawasthy4892
@anantawasthy4892 3 роки тому
Here is your engagement
Hilt ViewModels and Dependency Injection
16:35
CodingWithMitch
Переглядів 29 тис.
Hilt - Providing Retrofit Instance and Repository
20:36
CodingWithMitch
Переглядів 18 тис.
Surprise Gifts #couplegoals
00:21
Jay & Sharon
Переглядів 25 млн
How to get a FREE HYPERCHARGE SKIN!
02:07
Brawl Stars
Переглядів 16 млн
1 класс vs 11 класс (рисунок)
00:37
БЕРТ
Переглядів 4,1 млн
Full Guide to Manual Dependency Injection + Removing Dagger
14:50
Philipp Lackner
Переглядів 32 тис.
Kotlin Coroutines Beginner Example (Android)
23:12
CodingWithMitch
Переглядів 157 тис.
Hilt - Android Dependency Injection
28:57
Android Developers
Переглядів 51 тис.
What is Dependency Injection? | Why | Spring
8:17
Telusko
Переглядів 670 тис.
HILT Field Injection and Constructor Injection
9:44
CodingWithMitch
Переглядів 24 тис.
6 Design Patterns Every Android Developer Must Know
14:16
Philipp Lackner
Переглядів 76 тис.
Android Dependency Injection - Manually Injecting Dependencies
14:54
Simplified Coding
Переглядів 15 тис.
From Physics Student to Software Engineer
6:22
CodingWithMitch
Переглядів 10 тис.
Result of the portable iPhone electrical machine #hacks
1:01
KevKevKiwi
Переглядів 7 млн
Rabbit R1: Barely Reviewable
19:53
Marques Brownlee
Переглядів 7 млн
🤏 САМЫЙ ТОНКИЙ гаджет #Apple! 🍏
0:29
Яблочный Маньяк
Переглядів 242 тис.
Тестируем Gravis Ultrasound... ну почти.
48:18
Дмитрий Бачило
Переглядів 39 тис.
Phone repairs are getting ridiculous - Here's why.
22:24
Mrwhosetheboss
Переглядів 2,2 млн