Restoring State after Process Death (Do I need to care about process death?)

  Рет қаралды 6,464

CodingWithMitch

CodingWithMitch

Күн бұрын

Пікірлер: 50
@codinginflow
@codinginflow 4 жыл бұрын
It might not be easy to get your app into process death "naturally" but it will eventually happen so the question if you should handle it or not is not really there
@АлександрПальчевский-г7о
@АлександрПальчевский-г7о 2 жыл бұрын
Mitch, you have a talent to explain a complicated things in a simple way. Thank you! I love your courses!!!
@thomasfolmer7912
@thomasfolmer7912 4 жыл бұрын
I recently found your channel and there is so much to discover and learn ! Thanks and congratulation for the content !
@tiagosutter8821
@tiagosutter8821 3 жыл бұрын
Thanks for great content Mitch. The project that i work on is one of those project that handling process death really matters, we are facing big issues due to not properly handling process death, this content is going to be useful.
@mrmooshu7381
@mrmooshu7381 3 жыл бұрын
Nice to see that you have the same opinion my team arrived at when we considered process handling for our production app!
@catalinghita7721
@catalinghita7721 3 жыл бұрын
You can now retrieve an instance of your ViewModel without any additional configuration (without Hilt for example). The default ViewModel factory now provides the appropriate SavedStateHandle to your ViewModel so you don't neccesarily need a special factory for it
@rahhi9792
@rahhi9792 4 жыл бұрын
great content mitch. love it
@bboydarknesz
@bboydarknesz 3 жыл бұрын
Hi, here is my engement. The Assisted constructor have problem in newer version. @HiltViewModel class RecipeListViewModel @Inject constructor( private val randomString: String, private val repository: RecipeRepository, @Named("auth_token") private val token: String, @Assisted private val savedStateHandle: SavedStateHandle, ) required AssistedInject annotation in constructor, after applied it, my others DI asking for Inject annotation in constructor. Any idea, sir ? thank you
@pushkar.anand15
@pushkar.anand15 3 жыл бұрын
Hi Kevin, I faced a similar problem but found the fix. With the @HiltViewModel we can have the SavedStateHandle as a dependency without having to annotate it with @Assisted. So we can use SavedStateHandle without any annotation. Now I didn't look too deep into whether we can have the SavedStateHandle as a dependency without having to annotate it with @Assisted but I tried it and it works for me. Here is the source where I found the fix: github.com/google/dagger/issues/2287#issuecomment-771671159
@haojungao6738
@haojungao6738 3 жыл бұрын
​@@pushkar.anand15 Cheers man, this solution is really helpful!
@Zhuinden
@Zhuinden 4 жыл бұрын
I dunno I have 4 GB RAM and when I could still visit places with food in them, just the camera then Google Maps were enough to get process death to happen 🤔 Anyway, overall good advice because process death IS important 😉 you can reduce the amount of code you wrote to make it happen with SavedStateHandle.getLiveData
@kimworks8319
@kimworks8319 3 жыл бұрын
I knew I would find you here.
@Zhuinden
@Zhuinden 3 жыл бұрын
@@kimworks8319 I show up on process death related things :D
@muhammedshahin6299
@muhammedshahin6299 2 жыл бұрын
Thank you mitch
@abdulmateench.5618
@abdulmateench.5618 3 жыл бұрын
Hey Mitch...you are just awesome....
@marcoaureliosym
@marcoaureliosym 3 жыл бұрын
Nice tutorial, Mitch! I have a question: what if I have opened 3 activities before the Process Death, for example. How can I re-open the last activity that the user was navigating?
@DjangoMx
@DjangoMx 3 жыл бұрын
Hey, did you resolve the problem ? I was thinking on save a tracking of the user maybe in sharedpref or a file and thus reopen the last one act
@j2shoes288
@j2shoes288 4 жыл бұрын
I have a question Mitch, How do you make Overnight blueberry French Toast, and also Cinnamon Toast?
@mytubekt
@mytubekt 4 жыл бұрын
We can do it via Android studio. In Logcat there is red button for running app, when you hover its says "Terminate Application" 😉
@kirolosmalak858
@kirolosmalak858 2 жыл бұрын
you are genius 😍😍
@bakytdjumabaev469
@bakytdjumabaev469 3 жыл бұрын
Mitch, thanks
@tarikhusin1767
@tarikhusin1767 2 жыл бұрын
in the newer ver. of Hilt no need for @Assisted !
@ajaydeepak9739
@ajaydeepak9739 3 жыл бұрын
Thanks mitch anther great video.
@Andrey-pu1lv
@Andrey-pu1lv 2 жыл бұрын
thank you
@niranz7745
@niranz7745 3 жыл бұрын
awesome stuff
@mehulbisht9708
@mehulbisht9708 4 жыл бұрын
Mitch, if we were to cache results from the API into Room, then how to check how many results are already cached and which one's need to be loaded for the first time? Assuming that the API is not going to update it's contents frequently, Is checking the query parameters of the request that the user about to make a good approach?
@codingwithmitch
@codingwithmitch 4 жыл бұрын
I don't understand your question: "and which one's need to be loaded for the first time?"
@TheWerBelek
@TheWerBelek 4 жыл бұрын
Great content, thank you. I have a question: why do you use setter functions instead of kotlin properties (overriding set for vars)? Just a habit from java or is there a specific reason? Thanks once again!
@codingwithmitch
@codingwithmitch 4 жыл бұрын
Looking at the code again, habit I guess
@shivamsethi3829
@shivamsethi3829 4 жыл бұрын
gonna have some rice probably for lunch, awesome job
@codingwithmitch
@codingwithmitch 4 жыл бұрын
What about proteins?
@antoniodevic8704
@antoniodevic8704 4 жыл бұрын
Great video as always firstly :) The thing I wanna ask is are there any differences in process death when did by the OS ( low on memory so OS kills the app ) and when it is done manually through Android studio? What it did to me was when I terminated the process through Android studio it restored my last activity I was in before it went background and got killed , and when the OS killed the app it got restarted completely from the launcher activity. I can't find many resources online about this differences as mostly people point to the first case but not to the second. Can it be specific to device or manufacturer? I am running android 9, SDK 28 on Huawei honor lite 9 if it is of help to anyone with similiar situation :)
@cristianovecchi
@cristianovecchi 4 жыл бұрын
Great Journey!
@AyorindeAdesugba
@AyorindeAdesugba 4 жыл бұрын
Nice
@abolfazlrezaei5397
@abolfazlrezaei5397 3 жыл бұрын
hey Mitch, here's your engagement:)
@danyelsh874
@danyelsh874 2 жыл бұрын
Engagement Thanks
@arpie2671
@arpie2671 2 жыл бұрын
This was difficult
@Trosydman
@Trosydman 3 жыл бұрын
Random engagement!!!! And I had a capuccino for breakfast XD
@sanushradalage4091
@sanushradalage4091 3 жыл бұрын
Now the rain is over. I'm eating a burger. Engaged from Colombo, Sri Lanka
@Lioneldali
@Lioneldali 4 жыл бұрын
the phone not running linux operating system and Android is not top of linux kernel
@codingwithmitch
@codingwithmitch 4 жыл бұрын
Sorry I didn't use the exact perfect terminology. It's a modified version of the Linux kernel
@speedboy93640
@speedboy93640 3 жыл бұрын
restore engagement state
@mishaeliseev
@mishaeliseev 3 жыл бұрын
My engagement : it's very hot in siberia today )))
@raghavendpai
@raghavendpai 3 жыл бұрын
engagement💍💍💍
@edvardgrei6533
@edvardgrei6533 3 жыл бұрын
I ate macaroni for breakfast, it was delicious.
@raghavendpai
@raghavendpai 3 жыл бұрын
buns💍💍💍💍💍💍
@moonlightcheese
@moonlightcheese 11 ай бұрын
I don't like the use of Hilt in your guides. Hilt integration should be separate. It's impossible to learn the underpinnings of SavedStateHandle from this video because it presupposes use of an injection framework. Introducing frameworks makes the learning curve higher. While your code might be simpler, you ask a newb to take it on faith that it works without explaining it. "It's just magic" is not teaching.
@aydogdyaydogdiev1255
@aydogdyaydogdiev1255 3 жыл бұрын
i ate nothing for breakfast
Sending Data from Fragment to Fragment (without Safe Args)
21:47
CodingWithMitch
Рет қаралды 10 М.
Snackbar, SnackbarState and SnackbarHostState
20:13
CodingWithMitch
Рет қаралды 7 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Process Death and ViewModels (My apps are BROKEN)
26:32
CodingWithMitch
Рет қаралды 12 М.
MVVM ViewModel and State Events
15:21
CodingWithMitch
Рет қаралды 10 М.
Software Engineering Interviews at Big Tech (Square)
31:06
CodingWithMitch
Рет қаралды 7 М.
Trump's Plan for Ukrainian Lands / U.S. President's Demand
11:59
NEXTA Live
Рет қаралды 768 М.
DO NOT do this in a Software Engineering Interview
7:59
CodingWithMitch
Рет қаралды 9 М.
Full Guide to Jetpack Compose Effect Handlers
24:56
Philipp Lackner
Рет қаралды 102 М.
Recipe Network Entity (Retrofit Model)
9:22
CodingWithMitch
Рет қаралды 11 М.
Hilt ViewModels and Dependency Injection
16:35
CodingWithMitch
Рет қаралды 30 М.
iOS Development is Easier than Android Development (VLOG)
20:41
CodingWithMitch
Рет қаралды 52 М.
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 1 МЛН