newer version of hilt use @HiltViewModel before the class and @Inject before the constructor @HiltViewModel class RecipeListViewModel @Inject constructor() : ViewModel() { }
Good job! Do you consider to make video about "Error handling with coroutines and retrofit" ? Since there are a a lot of workarounds, i dont know how to use them efficiently.
Yeah that'll be in the next course. Generally I use something like this to execute the api/cache calls and handle errors github.com/mitchtabian/Clean-Notes/blob/master/app/src/main/java/com/codingwithmitch/cleannotes/business/data/util/RepositoryExtensions.kt
What if we want to inject something inside a Utility class. Can we still use @AndroidEntryPoint? In koin di framework we use KoinComponent everywhere. Please answer.
Hey Mitch, I was wondering if it might be error prone to use "by activityViewModels" when using Navigation Component with the Single Activity Pattern, as the View Model instance will then effectively be exposed to the entire scope of the app? I've heard of a way to scope View Models to individual navigation graphs with Hilt (haven't tried it yet), but do you know of a way where you can share a View Model instance between only a defined subset of Fragments? Thanks for the course, helps out a lot!
Hi when I created fragments its ask to implement these two methods inside fragment class. I havent any idea about this override fun prepareCall( contract: ActivityResultContract, callback: ActivityResultCallback ): ActivityResultLauncher { TODO("Not yet implemented") } override fun prepareCall( contract: ActivityResultContract, registry: ActivityResultRegistry, callback: ActivityResultCallback ): ActivityResultLauncher { TODO("Not yet implemented") }
Thanks Mitch. My ViewModel was throwing an exception since I hadn't put (kapt "androidx.hilt:hilt-compiler:1.0.0-alpha02") in my app's build.gradle. Quick question, is field injection possible inside a ViewModel using Hilt?
Hi Mitch, your videos are really very useful , would you pls create a multi module project using Hilt .. eagerly waiting for this video .. thanks in advance 🙂
Why can't i annotate my activities&fragments with AndroidEntryPoint when the classes are abstract ? like an abstract baseActivity !! is there anyway to handle this ?
I find it difficult to ENGAGE with Android Studio when Dagger/Hilt is being used in a project. Looks like Modern Android Development with Hilt involed needs to have separate system requirements Column on Android Studio page 😂
Yeah I've already checked that and have tried to use Hilt in project. Hilt makes DI incredibly easy but since it under the hood uses Dagger only which heavily adds to your build time, I decided not to use Hilt unless I get an access to high specs machine. I feel atleast 16GB of RAM with SSD is must for using these tools smoothly.
@@codingwithmitch Thank you Mitch. I have never heard these terminology before. Sure I have to do alot of catch-up before I can continue with this series. 🙏🙏
I don't think you need to do anything special. Try instantiating it in the abstract class I think it will work fine. I could be wrong tho I'm not at my computer
you obviously know the content and are very excellent with android, but its difficult for me to follow because you talk way too fast and just "code". more of "how its done kinda guy," not "what it is and why its doing this". because of that i dont understand the code and your speech speeed doesnt help. kudos all the same @least for those who seem to understand you
2:36 It seem in the new version of Hilt, we don't need `hilt-lifecycle-viewmodel` dependency
Deprecate @ViewModelInject. Equivalent functionality is now offered by @HiltViewModel, which is now part of the core Hilt Android APIs.
newer version of hilt use @HiltViewModel before the class and @Inject before the constructor
@HiltViewModel
class RecipeListViewModel @Inject constructor() : ViewModel() {
}
Also, AppModule's ApplicationComponent:class -> SingletonComponent:class
Appreciate the hilt info. Here's some complimentary engagement!
Hey Mitch, your each and every video is very informative and your explanation is too good
your setup is really nice.
Hey Mitch you're so powerful in teaching
Mitch thank you for your mention bro thats very cool!!!!!! ENGAGEMENT!
Many thanks Mitch. Very informative as usual. It makes things so much clearer when you show simple examples for each use case.
I'm just in this part of the course and now i want the Kotlin mobile multiplatform course. btw take your engagement
Yes definitely wanna appreciate Google for hilt but equally wanna appreciate your efforts as well... Thanks ;)
Thank you so much for the amazing videos, mitch.
private val engagement : Engagement by Subscribers()
Excellent engagement
Hi Engagements here!! :))
Thanks
Thank you Mitch ... from s.korea
Universal Android Boss
Thanks Mitch, you saved my day 😍
Привет, Митч ! Отличное видео ! Кажется я понял, как использовать Hilt )
Great stuff 👍, looking forward to more hilt
Thank you, Mitch
Nice one Mitch!
love it Mitch! Engagement pls
Always so clear! thank you
Engagement! Mitch try to use scrcpy instead of visor. You gonna love it!
I already paid for it so gotta get my monies worth 😂
Good job! Do you consider to make video about "Error handling with coroutines and retrofit" ? Since there are a a lot of workarounds, i dont know how to use them efficiently.
Yeah that'll be in the next course. Generally I use something like this to execute the api/cache calls and handle errors github.com/mitchtabian/Clean-Notes/blob/master/app/src/main/java/com/codingwithmitch/cleannotes/business/data/util/RepositoryExtensions.kt
Loved it 🙌🏻
Hi Mitch!
Have you ever tried scrcpy instead of Vysor?
Take a look!
Tks for the coding class. I`m learning a lot here in Bazil.
Best regards
Thank you very helpful tutorial
What if you want to share view models using navigation scope or parent fragment scope only? how would you do that using this approach?
Many thanks to you Mitch 👍
great work!!!!!! thank you for all your effort
Thanks so much, this saved my code
Great stuff 👍
Simplified learning experience, Here's some engagement
That was great!! What about if you already have dagger? how can I implement Hilt while still have dagger. I don't want to do the migration just yet.
What if there are two different string dependency in the hilt module and we want both of them , then how would dagger inject both ???
watch next video
Thanks Mitch for the video
boom now I know hilt
BOOM
What if we want to inject something inside a Utility class. Can we still use @AndroidEntryPoint? In koin di framework we use KoinComponent everywhere. Please answer.
Hey Mitch, I was wondering if it might be error prone to use "by activityViewModels" when using Navigation Component with the Single Activity Pattern, as the View Model instance will then effectively be exposed to the entire scope of the app? I've heard of a way to scope View Models to individual navigation graphs with Hilt (haven't tried it yet), but do you know of a way where you can share a View Model instance between only a defined subset of Fragments? Thanks for the course, helps out a lot!
That is a very good question. I also have not tried the method of scoping to a graph. I don't know the answer to your question.
@@codingwithmitch I would love to see an answer to this question. Do you have any updates since then?
Hi when I created fragments its ask to implement these two methods inside fragment class. I havent any idea about this
override fun prepareCall(
contract: ActivityResultContract,
callback: ActivityResultCallback
): ActivityResultLauncher {
TODO("Not yet implemented")
}
override fun prepareCall(
contract: ActivityResultContract,
registry: ActivityResultRegistry,
callback: ActivityResultCallback
): ActivityResultLauncher {
TODO("Not yet implemented")
}
Loving these lessons 👌
Thanks Mitch. My ViewModel was throwing an exception since I hadn't put
(kapt "androidx.hilt:hilt-compiler:1.0.0-alpha02") in my app's build.gradle.
Quick question, is field injection possible inside a ViewModel using Hilt?
I don't think so. but there's no reason to anyway. Hilt does all the heavy lifting so you can just magically pass anything as a constructor arg.
You should try scrcpy tool for screen mirroring,it's opensource and no need to install any app in your mobile so basically more secure
already paid for vysor so trying to get my monies worth
Hello
I don't understand this
by viewModel()
It means we don't have to initialise like this
ViewModelProvider(this).get(MyViewModel::class.java) ??
What about sharing viewmodel between activities is it the same way ?
remember bad old days view model injection with Dagger
Great content 🔥
Hi Mitch, your videos are really very useful , would you pls create a multi module project using Hilt .. eagerly waiting for this video .. thanks in advance 🙂
I get an error on your website when trying to register. I would like to follow the Hilt course!
Great work. Also, Can you cover inject viewModels with Fragment/Bundle arguments?
thnx for the tutorial, appreciate it
Good master
Ur the guy
great stuff
Hi Mitch. Is there any convenient solution to pass parameters to ViewModel in runtime by Hilt?
look into Assisted Inject
Can you record a tutorial on how to prepopulate Room db using Hilt?
cool as ever
Why can't i annotate my activities&fragments with AndroidEntryPoint when the classes are abstract ? like an abstract baseActivity !! is there anyway to handle this ?
Actually I haven't tried. Didn't know that
Thanks!
Hilt wont import the ApplicationComponent class
It's SingletonComponent now SAM YOU SHOULD KNOW THAT
@@codingwithmitch lol i figured. Damn I'm way behind 😂
@@codingwithmitch but it did actually worked yesterday and this morning it just wouldn't work. i had to open the documents and it was right there 🤣
I find it difficult to ENGAGE with Android Studio when Dagger/Hilt is being used in a project. Looks like Modern Android Development with Hilt involed needs to have separate system requirements Column on Android Studio page 😂
Lol just watch my hilt course it's free
Yeah I've already checked that and have tried to use Hilt in project. Hilt makes DI incredibly easy but since it under the hood uses Dagger only which heavily adds to your build time, I decided not to use Hilt unless I get an access to high specs machine. I feel atleast 16GB of RAM with SSD is must for using these tools smoothly.
thanks
nice one
Mitch please help. I am stuck with the DAO video Data Entity thing. Please suggest where to read about it. You are moving too fast.
We don't even have a Dao
@@codingwithmitch th-cam.com/video/rTWCxow5IJQ/w-d-xo.html Forgive me, its this one.
@@avinashdas1013 That is a DTO not a DAO. Dao is used with room persistence library.
@@codingwithmitch Thank you Mitch. I have never heard these terminology before. Sure I have to do alot of catch-up before I can continue with this series. 🙏🙏
Does someone receive the following error when starting the application: Error inflating class androidx.fragment.app.FragmentContainerView
Epic!
I like this!
Thanks Mitch
I didn’t know Alexender Volkanovski knew so much about Android dev..
Hi Mitch, please can you make more videos about CRUD MVI using Kotlin?
Entire course right here my friend codingwithmitch.com/courses/android-clean-architecture/
awesome
Engagementooooo :)
Why don't you switch to dark theme ? I think that would make viewers happy, and your eyes :D
How we can Create BaseFragment to instantiate ViewModel- val viewModel: EngagementViewModel by viewmodels() - thanks! -
I don't think you need to do anything special. Try instantiating it in the abstract class I think it will work fine. I could be wrong tho I'm not at my computer
love his
engagement
Engagementtttttttt
You always forget to add card. Btw engagement is new normal 😂.
Mitch
Jitender
I think the ViewModelnject is deprecated now and the right one is ViewModelScoped :)
use HiltViewModel
Engagement
some engagement 4 u
You can rest assured that I will never watch anything else than a free course.
bump
Like for shared VM trick
you obviously know the content and are very excellent with android, but its difficult for me to follow because you talk way too fast and just "code". more of "how its done kinda guy," not "what it is and why its doing this". because of that i dont understand the code and your speech speeed doesnt help. kudos all the same @least for those who seem to understand you
Engagement