Thanks Philip, you re my absolute Android mentor! Always waiting for your videos to come out. When i found a USD job (i have one, but in local currency which is garbage) i will definitely buy some of your courses
Thank you Phillip..as always very nice video. I have a big doubt: figure we are handling our UI state with a class. So inside the class for example we have a list of something. The list is retrieved through a repository and figure it's come from room. Since we are handling all through a state class what we do is to collect the list from the view model and when we receive a new list we will update the state UI. The UI is collecting our state and not directly the list (which as we said is collected in the VM). Now even if the app goes in background the VM still collects update from repository. How do we handle this?
Thanks very much, that's really helpful. I am currently doing some r&d with Kotlin multiplatform mobile and looking into sharing across both Android and iOS all the layers including the views (composables) and view models. In general, everything works great, but I still don't have an opinion on how to deal with the lifecycle thing you mentioned at the end of the video (definitely will need to spend more time on the iOS-side investigation). So far lifecycle-related events is the only phenomenon that requires so much attention in the multiplatform project 🙂
Thanks Philipp! And about implement a collector inside of a viewModel? I'm using a mutableStateList to fill my LazyColumn, so my approach was start a collector in vm and update my stateList from that.
Hey Philip, first of all thank you for these perfect-explained videos. But I think those both have different use cases so we can't say that someone using it wrong.
Hi Philipp Lackner, please make a video on how to handle the flow values emitted from Room Database. Should i use asStateFlow, or StateIn while collecting the flows from room database? Your previous video on flow mistake helped me to resolve a issue. thanks for the help.
You should use “StateIn” operator since you will be having cold flows from ROOM and not hot flows (MutableStateFlows or MutableSharedFlows). If you then need to use the result with other flows (say hot flows declared in your viewmodel), you can combine all with the “combine” operator.
At the end you mention that the lifecycles only exist on Android, and the regular version are for desktop. Wouldn't that mean that this issue is still present on desktop? What would be the fix there?
hey philipp I've used your coroutines with retrofit tutorial but I am facing a problem. the problem is that when we get our api response from enqueue we also get response in run and logcat which makes it easy to understand when If we are using lifecycleScope then nothing is showing response in run and logcat please help me (this is your tutorial link: ruclips.net/video/t6Sql3WMAnk/видео.html )
tobe honest this api is so ugly.. though it is working.. i feel it so wrong.. i believe the problem occurs because Garbage collector method is not suitable for declarative programming.. Declarative programming need different methods to be optimized.. as the way it's nature should be.. delete memory once. scope is ends.. thats it.. everybody happy.. Im starting to think that we have a very big problem here.. don't get me wrong I'm just kinda frustrated, and even though it is working, i didn't feel it's helpful... i hope they get rid of this method soon, and back to nature.. it should be simple, thats the idea of why compose is been made
Hey Philipp, thank you for such a nice explaination.
Btw, you are repeating yourself at 6:22 .
I am guessing there is editing issue.
I think he left in a bad take
Love hearing the explanation and seeing the examples. Great work. Thanks Phillip!
Interesting, I read the documentation but didn't understand it like that. Now with your video, it's very clear.
Great video! Please make more videos on flows and stateFlow and different best practises!
He has videos on this already
Thanks Philip, you re my absolute Android mentor! Always waiting for your videos to come out.
When i found a USD job (i have one, but in local currency which is garbage) i will definitely buy some of your courses
Hey Philipp, many thanks for the clear explanation.
Thank you Phillip..as always very nice video. I have a big doubt: figure we are handling our UI state with a class. So inside the class for example we have a list of something. The list is retrieved through a repository and figure it's come from room. Since we are handling all through a state class what we do is to collect the list from the view model and when we receive a new list we will update the state UI. The UI is collecting our state and not directly the list (which as we said is collected in the VM). Now even if the app goes in background the VM still collects update from repository. How do we handle this?
Thanks very much, that's really helpful. I am currently doing some r&d with Kotlin multiplatform mobile and looking into sharing across both Android and iOS all the layers including the views (composables) and view models. In general, everything works great, but I still don't have an opinion on how to deal with the lifecycle thing you mentioned at the end of the video (definitely will need to spend more time on the iOS-side investigation). So far lifecycle-related events is the only phenomenon that requires so much attention in the multiplatform project 🙂
Great explanation with some use case examples thanks Phillip
Thanks Philipp! And about implement a collector inside of a viewModel? I'm using a mutableStateList to fill my LazyColumn, so my approach was start a collector in vm and update my stateList from that.
Can you explain in a video, difference between using MutableState and MutableStateFlow?
Hey Philip, first of all thank you for these perfect-explained videos. But I think those both have different use cases so we can't say that someone using it wrong.
For Android it's certainly wrong. In which case would you not want to collect your flows with collectAsStateWithLifecycle?
Thanks Phillip
Them videos coming in 🔥🔥🔥 and educative... Thanks Philipp ❤️
Thanks man. Really helpful.
Does this Apply to STATEFLOWS too!??
Hi Philipp Lackner, please make a video on how to handle the flow values emitted from Room Database. Should i use asStateFlow, or StateIn while collecting the flows from room database?
Your previous video on flow mistake helped me to resolve a issue. thanks for the help.
You should use “StateIn” operator since you will be having cold flows from ROOM and not hot flows (MutableStateFlows or MutableSharedFlows). If you then need to use the result with other flows (say hot flows declared in your viewmodel), you can combine all with the “combine” operator.
you are a blessing
Thanks Phlipp. Must we use to collect variables (for example list data) that in our state data class with collectAsStateWithLifecycle?
Nice Explanation 👍🏻
Much love bro!
At the end you mention that the lifecycles only exist on Android, and the regular version are for desktop. Wouldn't that mean that this issue is still present on desktop? What would be the fix there?
How to recompose the screen when data saved to shared preference?.
Thanks for sharing. It was helpful ^_^
Hey Philipp what is the theme you are using? How is it called?
it's xcode theme
I would like to try launcher that you use at your device. Could you please share?
I don't use a launcher
@@PhilippLackner But icons have a particular style. Theme?
Nice video!!!
oh, i just saw normal philipp for a second. 😁😁😁😁
me 2
❤❤
Is there a better way than 5 seconds which is hardcode?
hey philipp I've used your coroutines with retrofit tutorial but I am facing a problem. the problem is that when we get our api response from enqueue we also get response in run and logcat which makes it easy to understand when If we are using lifecycleScope then nothing is showing response in run and logcat please help me (this is your tutorial link: ruclips.net/video/t6Sql3WMAnk/видео.html )
1st
Strange edits at 6 minute mark
Oops sorry I oversaw that
tobe honest this api is so ugly.. though it is working..
i feel it so wrong..
i believe the problem occurs because Garbage collector method is not suitable for declarative programming..
Declarative programming need different methods to be optimized.. as the way it's nature should be.. delete memory once. scope is ends.. thats it.. everybody happy..
Im starting to think that we have a very big problem here..
don't get me wrong I'm just kinda frustrated, and even though it is working, i didn't feel it's helpful...
i hope they get rid of this method soon, and back to nature.. it should be simple, thats the idea of why compose is been made
Why don`t you use new UI in studio?
Thanks 🔥
I don't understand why you use StateFlow instead of just State and using the .value property directly. Is there a reason?
StateFlow makes it easy to add reactivity to your state