Hilt Dependency Injection (Kotlin Beginner Example)
Вставка
- Опубліковано 14 гру 2020
- 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
.
. - Наука та технологія
12:02 In the new version of Hilt, `ApplicationComponent` just change to `SingletonComponent`
Thanks a lot man!
Thanks...
Here is your engagement
nice 1
@@codingwithmitch What I don't even get a heart?
@@codinginflow lol coding in flow you are also an awesome mentor!
@@felipefranco7444 What do you mean "also"?
@@codinginflow Mitch is a mentor so are you . Both teach developers in a great way!
I started learning Kotlin/Android in December and you are one of my constant go-to person! Also, THANK YOU for switching to Kotlin!!!
First time on the channel and I already loved your content! Keep it up, brother!
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
Best DI tutorial! I have tried to learn Dagger several times but always I was giving up because of the complexity of the library...
Thanks for the vid, already easier to understand. Looking for the next one already.
My best teacher any time when it comes to Android things 💯
Nicely Explained in short..Sometimes few words can do magic ..this particular tutorial does the same
Very concise and helpful explanation, thank you :)
Great Content and demonstration, easy to follow
The gift that keeps on giving! 😁
Я плохо знаю английский язык, но вы так хорошо объясняете, что даже я всё поняла. Спасибо большое за урок. Пожалуйста, продолжайте снимать видео
You are doing a great job..
Really good explanation man, thank you.
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
thanks for the testimonial :)
Thank you, Mitch! Here is your engagement and your like! Keep it up! 👍
Awesome tutorials !
Great summary.
Thank you!
Thanks for the vid best explanation!
nice one mitch
thanks, dear mitch
Thanks Mitch. Very clear and concise explanation. It helped me a lot.
Awesome stuff
Hey Mitch I liked the video 😁😁
I hope I will be able to understand why are we doing DI by next two videos.
Watching this video 69th time
Still hilt is something to learn🧐
And will learn it soon
Greate Work!!
Very good content sir
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.
Next course with the cache will include some unit tests
Thanks
In Android Studio there's a presentation mode: View -> Appearance -> Enter Presentation Mode
Could help for future videos :)
I will try that.
Hey Mitch, if you someday come to Argentina I will be glad to buy you a good Fernet with Coca, you deserve it dude!
Thanks!
Awesome one
Great engagement
Thank you
perfect
Thank you; you made DI clear for me.
Man! You look better with bear, MaShaAllah!
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 😂
lol, no
This time.. I am watching the video in the car and waiting the order from restaurant.. Thanks😎
Way to be efficient
Thank you Mitch. I like your channel.. I am following you from Oman
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...
👍
Hi Mitch, please can make more videos about CRUD MVI using kotlin?
I have tons. Look at any of my courses on my website
cool
Wow I like
Nice Video
If possible please suggest how to work admob 💵💵💵 with hilt and viewmodel
Great explanation ! :)
What if I have two functions of return type String. How Hilt will figure out which dependency to provide?
Tomorrows video will show you that (part 15)
@@codingwithmitch Thanks Mitch. Just saw that video and my doubt is clear :)
✌️✌️
is DI only used for making testing easier? Code reusability is another vital reason according to the android official documentation.
Yes I said that. You use the same instance of an object
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
🐐🐐🐐🐐
First Engagement
I can't get any of the dependency stuff to build. Not sure what I'm missing.
mitch
jitender
The second. Thanks a lot.
if you are getting errors after adding hilt when you run build the app:KaptDebugKotlin error remove the @parcelize annotation in recipe model class
did not work here
What about Koin?
Mitch, you have site codingwithmitch.com. Did you create it by youself, with you own hands?
Yep with my own hands ✋
@@codingwithmitch Good job! How could you learn so many things?! I admire)
@@user-jg4pk6bq2g lots of time lol
i am liking this video lol
First view
7:52 fontsize was ok, maybe 35.
Nice, confusion is going away
hey mitch ur engagement
comment for the algorithem gods
ok, report
now ApplicationConmponent is deprecated and replaced with SingletonComponent
:'D
Was your beard always that thick?
no been working on it
Nothing is clear
Very shallow bullshit explanation. No one understood anything. Reminds me of Traversy type of explanation.
Thanks
Here is your engagement
Thanks
Here is your engagement