Android Dependency Injection: Hilt + Retrofit

  Рет қаралды 5,378

The Android Factory

The Android Factory

Жыл бұрын

Join me in this complete guide to adding dependency injection AND networking capabilities to your app with the best libraries in the game: Dagger Hilt and Retrofit. I hope the explanation is clear and appreciate your patience with a slightly longer video as there is a lot to cover, and many areas for interruptions haha! In the next episode we will make use of the data from the network call and dive a little deeper into "mappers" -- see you there!
Don't forget to subscribe and enable notifications to stay up-to-date!
Source code here: github.com/the-android-factor...
Jetpack Compose Basics: developer.android.com/codelab...
Hilt docs: developer.android.com/trainin...
Retrofit docs: square.github.io/retrofit/
Moshi docs: github.com/square/moshi/
---------- Popular Series ----------
Redux e-commerce app: • Season 10: E-commerce ...
Rick and Morty app: • Season 6: Rick & Morty...
---------- Connect with me ----------
LinkedIn: / domenic-polidoro-802b72b4
Instagram: / dom_polidoro
Twitter: / developer_dom
Tiktok: / building_android

Пікірлер: 23
@supuerawesome707
@supuerawesome707 21 күн бұрын
Love the realism of all the errors. It makes newer programmers like myself feel reassured that even the pros are human and write bugs!
@TheAndroidFactory
@TheAndroidFactory 21 күн бұрын
Humbled you think I'm a pro 😅 if people cut out the errors and specifically resolving them, it's not a real tutorial 👍 appreciate your support!
@dadveloper2326
@dadveloper2326 Жыл бұрын
Love the inclusion of the scuffed parts. Makes me feel better about not being able to always pump out a network request app with hilt, retrofit, compose, all the things in an hour like they want you do to in take home projects for job interviews! Shows us that solving the problem is the most important part of developing. Excited for the rest of the season❤
@TheAndroidFactory
@TheAndroidFactory Жыл бұрын
Yeah it is very easy to miss things here and there! Especially trying to talk to what I am doing and make the video coherent haha getting better at it but not doing things perfectly the first time really isn't a problem. Also there is a lot to learn from "failures" so all these little things you can get tripped up on will only heighten your understanding in the long run! Appreciate the support
@tiagosutter8821
@tiagosutter8821 Жыл бұрын
This channel seems so cool, i couldn't take the time to watch full seasons yet, but from what I watched I see that there is really good content all around in every video, i appreciate it. I imagine it takes a lot of time to produce such quality content. I really hope more people find your channel and it keeps growing.
@TheAndroidFactory
@TheAndroidFactory Жыл бұрын
Hey man I really, really appreciate that. I'd like to think the content is good, but most importantly I try to keep it "real" above all else. I'm just making cool stuff and sharing it with you guys. Help me grow by sharing the channel on any platform or group/people you think could benefit from it. Find some links on the About tab to connect on socials! Also, all the code is always on GitHub 🤙
@dadveloper2326
@dadveloper2326 Жыл бұрын
Absolutely, hands down one of the best Android content creators on KZfaq. Much of this free content is what helped me get a job in Android Development.
@TheAndroidFactory
@TheAndroidFactory Жыл бұрын
🫶
@farshad462
@farshad462 Жыл бұрын
For me facing this kind of error during the coding tutorial is pretty helpful because I can use the same approaches to solve problems when I encounter them in my own cases. Also personally, being in a rush won't have any advantages except being confused. Thanks by the way.
@TheAndroidFactory
@TheAndroidFactory Жыл бұрын
I appreciate that!! I think that mindset is really valuable too, thanks for watching :)
@marlonlom
@marlonlom 10 ай бұрын
How to add hilt but using ksp instead of kapt? it happen to get too much build errors :S
@TheAndroidFactory
@TheAndroidFactory 10 ай бұрын
I'd have to give it a Google and try it out! Maybe try a brand new project you try to add it into to see how it would work there and try to replicate that in your current project
@AatmikMishra
@AatmikMishra 9 ай бұрын
really love your videos Can you please make a playlist on a google current architecture pattern (MVVM) that includes ui -> uistate -> viewmodel -> usecase -> repository -> datasource -> api or room -> this denotes dependencies and can u tell us how to use hilt in these case
@TheAndroidFactory
@TheAndroidFactory 9 ай бұрын
Yeah I'd love to re-do the Rick and Morty series if you've seen that with Compose + Flow + Hilt + MVVM/MVI + testing, possibly multi-module, etc. Unfortunately it's tough for me to find time right now but I really want to get back on it. The OneQuote app is a pretty good architecture pattern though if you watch it
@AatmikMishra
@AatmikMishra 9 ай бұрын
really appreciate it you are doing a great job bro ! @@TheAndroidFactory
@TheAndroidFactory
@TheAndroidFactory 9 ай бұрын
@AatmikARM I'll make some more content soon. Thanks for the support! Help me grow by sharing with anyone you think would benefit from the channel 🙏
@AatmikMishra
@AatmikMishra 9 ай бұрын
sure 100% @@TheAndroidFactory
@SuperKrafs
@SuperKrafs 6 ай бұрын
Very nice! However, I ended up struggling because I wanted to be able to input IP/Port from the UI to form the baseUrl, and then I just couldn't figure out how to combine this with Hilt.
@TheAndroidFactory
@TheAndroidFactory 6 ай бұрын
Ah, if I am understanding correctly, Hilt isn't going to help you here. Hilt (or any dependency injection) cannot really take input from runtime. You can use Hilt to pre-generate part of the URL you need, but the port and IP would need to happen at runtime and append it to anything you made with Hilt. Does that make sense?
@SuperKrafs
@SuperKrafs 6 ай бұрын
@@TheAndroidFactory ok, that make sense. So just out of curiosity, would something like Koin be able to handle this case (as I understand it, it is doing its work during runtime)?
@TheAndroidFactory
@TheAndroidFactory 6 ай бұрын
I don't believe so either. Maybe if you were to "hack it" but my understanding of Koin "doing things at runtime" is just doing the same dependency mapping that Hilt does at runtime. Hilt does the mapping at compile time (which is why I like it better). But I don't think you get any additional runtime functionality like you need with Koin over Hilt. I could be wrong though, I've never implemented Koin myself, nor tried to use dependency injection for something like what you're doing.
@muratgunay1006
@muratgunay1006 3 ай бұрын
Why are you in such a hurry? You're talking without breathing. I am tired while listening. I wouldnt watch the entire video if I didnt really need it. Good video but you have to be slower a bit.
@TheAndroidFactory
@TheAndroidFactory 3 ай бұрын
Sorry I didn't think I was talking faster than normal haha, did you have the playback speed faster than 1x on KZfaq? Additionally, you could always set it to 0.75x if you need to slow the video down
Android Network Mapping Explained
10:52
The Android Factory
Рет қаралды 1,2 М.
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 18 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,7 МЛН
Hilt and dependency injection - MAD Skills
13:06
Android Developers
Рет қаралды 46 М.
Multi-module Android App Tutorial
17:04
The Android Factory
Рет қаралды 8 М.
Hilt Dependency Injection (Kotlin Beginner Example)
21:20
CodingWithMitch
Рет қаралды 42 М.
Все про Dagger Hilt в Android Studio + Kotlin
52:11
Neco Ru
Рет қаралды 11 М.
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 228 М.
95% Don't Understand THIS About Coroutines (Main-Safety)
9:38
Philipp Lackner
Рет қаралды 27 М.
Android Hilt на практике с MVVM
18:52
Тимофей Коваленко
Рет қаралды 13 М.
Hilt - лёгкий старт в Dagger
32:26
Android Broadcast. Все об Андроид разработке
Рет қаралды 14 М.