Hilt Dependency Injection (Kotlin Beginner Example)

  Рет қаралды 42,206

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!!!
@asmg4m3r65
@asmg4m3r65 2 жыл бұрын
First time on the channel and I already loved your content! Keep it up, brother!
@richardgarcia6677
@richardgarcia6677 3 жыл бұрын
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
@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 11 ай бұрын
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
@DS-bz4mz
@DS-bz4mz Жыл бұрын
Very concise and helpful explanation, thank you :)
@tonnie7079
@tonnie7079 2 жыл бұрын
Great Content and demonstration, easy to follow
@hellespont5072
@hellespont5072 3 жыл бұрын
The gift that keeps on giving! 😁
@lirjarmuhametova8516
@lirjarmuhametova8516 Жыл бұрын
Я плохо знаю английский язык, но вы так хорошо объясняете, что даже я всё поняла. Спасибо большое за урок. Пожалуйста, продолжайте снимать видео
@shafaquesattar
@shafaquesattar 3 жыл бұрын
You are doing a great job..
@SmemsMusic
@SmemsMusic 3 жыл бұрын
Really good explanation man, thank you.
@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 :)
@tanjimahmed213
@tanjimahmed213 2 жыл бұрын
Thank you, Mitch! Here is your engagement and your like! Keep it up! 👍
@alexiachimov9817
@alexiachimov9817 3 жыл бұрын
Awesome tutorials !
@PhilandNevie
@PhilandNevie 3 жыл бұрын
Great summary.
@__Minecraft_Poseidon__
@__Minecraft_Poseidon__ 3 жыл бұрын
Thank you!
@ecemvarma4546
@ecemvarma4546 2 жыл бұрын
Thanks for the vid best explanation!
@abdulrasheedilori7680
@abdulrasheedilori7680 2 жыл бұрын
nice one mitch
@danyelsh874
@danyelsh874 2 жыл бұрын
thanks, dear mitch
@staceyrichards8656
@staceyrichards8656 3 жыл бұрын
Thanks Mitch. Very clear and concise explanation. It helped me a lot.
@judefrancis
@judefrancis 3 жыл бұрын
Awesome stuff
@hotellinaweb
@hotellinaweb 3 ай бұрын
Hey Mitch I liked the video 😁😁 I hope I will be able to understand why are we doing DI by next two videos.
@genshinassassin1139
@genshinassassin1139 3 жыл бұрын
Watching this video 69th time Still hilt is something to learn🧐 And will learn it soon
@abdelrhmantalat9813
@abdelrhmantalat9813 3 жыл бұрын
Greate Work!!
@hanamanth_vlogs6565
@hanamanth_vlogs6565 3 жыл бұрын
Very good content sir
@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
@roshanfx369
@roshanfx369 3 жыл бұрын
Thanks
@taar1
@taar1 3 жыл бұрын
In Android Studio there's a presentation mode: View -> Appearance -> Enter Presentation Mode Could help for future videos :)
@MaisUmSomente
@MaisUmSomente 3 жыл бұрын
I will try that.
@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!
@vanosuperhero
@vanosuperhero 2 жыл бұрын
Thanks!
@muhammedshahin6299
@muhammedshahin6299 Жыл бұрын
Awesome one
@mal7othify
@mal7othify 3 жыл бұрын
Great engagement
@faithphysicsphilosophy6721
@faithphysicsphilosophy6721 3 жыл бұрын
Thank you
@danyelsh874
@danyelsh874 2 жыл бұрын
perfect
@MedAmineSouaiaia88
@MedAmineSouaiaia88 3 жыл бұрын
Thank you; you made DI clear for me.
@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
@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
@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 жыл бұрын
👍
@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
@ahmetbozkan4610
@ahmetbozkan4610 3 жыл бұрын
cool
@silviavargas931
@silviavargas931 2 жыл бұрын
Wow I like
@siddharthashankar8396
@siddharthashankar8396 Жыл бұрын
Nice Video
@abhimanyoosingh7027
@abhimanyoosingh7027 3 жыл бұрын
If possible please suggest how to work admob 💵💵💵 with hilt and viewmodel
@mytubekt
@mytubekt 3 жыл бұрын
Great explanation ! :)
@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 :)
@AkshatKumawat
@AkshatKumawat 3 жыл бұрын
✌️✌️
@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
@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
@electricalprogrammer456
@electricalprogrammer456 2 жыл бұрын
🐐🐐🐐🐐
@MuhammadNaveed2016
@MuhammadNaveed2016 3 жыл бұрын
First Engagement
@Soaring333
@Soaring333 2 жыл бұрын
I can't get any of the dependency stuff to build. Not sure what I'm missing.
@JitubhaiyaPhysics
@JitubhaiyaPhysics 3 жыл бұрын
mitch
@codingwithmitch
@codingwithmitch 3 жыл бұрын
jitender
@mehdiparsaei1867
@mehdiparsaei1867 3 жыл бұрын
The second. Thanks a lot.
@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 6 ай бұрын
did not work here
@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
@johnybaby9574
@johnybaby9574 3 жыл бұрын
i am liking this video lol
@HelloBayzid
@HelloBayzid 3 жыл бұрын
First view
@erickramones2167
@erickramones2167 3 жыл бұрын
7:52 fontsize was ok, maybe 35.
@muhammadrizwan7179
@muhammadrizwan7179 3 жыл бұрын
Nice, confusion is going away
@alaadeego5416
@alaadeego5416 3 жыл бұрын
hey mitch ur engagement
@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 6 ай бұрын
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
Рет қаралды 30 М.
HILT Field Injection and Constructor Injection
9:44
CodingWithMitch
Рет қаралды 25 М.
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 26 МЛН
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 22 МЛН
FOOLED THE GUARD🤢
00:54
INO
Рет қаралды 62 МЛН
Hilt - Android Dependency Injection
28:57
Android Developers
Рет қаралды 51 М.
Android Dependency Injection - Manually Injecting Dependencies
14:54
Simplified Coding
Рет қаралды 15 М.
Hilt makes testing easier on Android
32:38
CodingWithMitch
Рет қаралды 16 М.
Hilt and dependency injection - MAD Skills
13:06
Android Developers
Рет қаралды 46 М.
6 Design Patterns Every Android Developer Must Know
14:16
Philipp Lackner
Рет қаралды 78 М.
Android Dependency Injection: Hilt + Retrofit
22:56
The Android Factory
Рет қаралды 4,9 М.
Everything you need to know about Dependency Injection
4:31
Stevdza-San
Рет қаралды 11 М.
Modularizing Android Apps
18:16
CodingWithMitch
Рет қаралды 20 М.
DO NOT do this in a Software Engineering Interview
7:59
CodingWithMitch
Рет қаралды 9 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,2 МЛН