Тёмный

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

CodingWithMitch
Подписаться 145 тыс.
Просмотров 6 тыс.
50% 1

The BEST android courses in the world: codingwithmitch.com/
In this video we talk about process death and how to restore state after a process has died. I talk about how to test for process death by simulating process death. I also talk about why I think process death is overrated and 95% of the time it does not matter.
Code: github.com/mitchtabian/MVVMRe...
Follow me:
Instagram: / codingwithmitch
Twitter: / mitch_tabian
.
.

Наука

Опубликовано:

 

13 янв 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 50   
@codinginflow
@codinginflow 3 года назад
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
@user-hl3br5qi6f
@user-hl3br5qi6f Год назад
Mitch, you have a talent to explain a complicated things in a simple way. Thank you! I love your courses!!!
@thomasfolmer7912
@thomasfolmer7912 3 года назад
I recently found your channel and there is so much to discover and learn ! Thanks and congratulation for the content !
@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!
@tiagosutter8821
@tiagosutter8821 2 года назад
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.
@rahhi9792
@rahhi9792 3 года назад
great content mitch. love it
@catalinghita7721
@catalinghita7721 2 года назад
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
@abdulmateench.5618
@abdulmateench.5618 3 года назад
Hey Mitch...you are just awesome....
@ajaydeepak9739
@ajaydeepak9739 3 года назад
Thanks mitch anther great video.
@muhammedshahin6299
@muhammedshahin6299 Год назад
Thank you mitch
@niranz7745
@niranz7745 2 года назад
awesome stuff
@antoniodevic8704
@antoniodevic8704 3 года назад
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 3 года назад
Great Journey!
@bakytdjumabaev469
@bakytdjumabaev469 3 года назад
Mitch, thanks
@TheWerBelek
@TheWerBelek 3 года назад
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 3 года назад
Looking at the code again, habit I guess
@j2shoes288
@j2shoes288 3 года назад
I have a question Mitch, How do you make Overnight blueberry French Toast, and also Cinnamon Toast?
@kirolosmalak858
@kirolosmalak858 Год назад
you are genius 😍😍
@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 2 года назад
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
@Andrey-pu1lv
@Andrey-pu1lv 2 года назад
thank you
@mehulbisht9708
@mehulbisht9708 3 года назад
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 3 года назад
I don't understand your question: "and which one's need to be loaded for the first time?"
@Zhuinden
@Zhuinden 3 года назад
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
@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 2 года назад
​@@pushkar.anand15 Cheers man, this solution is really helpful!
@mytubekt
@mytubekt 3 года назад
We can do it via Android studio. In Logcat there is red button for running app, when you hover its says "Terminate Application" 😉
@AyorindeAdesugba
@AyorindeAdesugba 3 года назад
Nice
@shivamsethi3829
@shivamsethi3829 3 года назад
gonna have some rice probably for lunch, awesome job
@codingwithmitch
@codingwithmitch 3 года назад
What about proteins?
@abolfazlrezaei5397
@abolfazlrezaei5397 3 года назад
hey Mitch, here's your engagement:)
@Trosydman
@Trosydman 3 года назад
Random engagement!!!! And I had a capuccino for breakfast XD
@danyelsh874
@danyelsh874 2 года назад
Engagement Thanks
@tarikhusin1767
@tarikhusin1767 Год назад
in the newer ver. of Hilt no need for @Assisted !
@arpie2671
@arpie2671 Год назад
This was difficult
@Lioneldali
@Lioneldali 3 года назад
the phone not running linux operating system and Android is not top of linux kernel
@codingwithmitch
@codingwithmitch 3 года назад
Sorry I didn't use the exact perfect terminology. It's a modified version of the Linux kernel
@speedboy93640
@speedboy93640 2 года назад
restore engagement state
@mishaeliseev
@mishaeliseev 3 года назад
My engagement : it's very hot in siberia today )))
@sanushradalage4091
@sanushradalage4091 3 года назад
Now the rain is over. I'm eating a burger. Engaged from Colombo, Sri Lanka
@raghavendpai
@raghavendpai 3 года назад
engagement💍💍💍
@edvardgrei6533
@edvardgrei6533 3 года назад
I ate macaroni for breakfast, it was delicious.
@raghavendpai
@raghavendpai 3 года назад
buns💍💍💍💍💍💍
@aydogdyaydogdiev1255
@aydogdyaydogdiev1255 2 года назад
i ate nothing for breakfast
@moonlightcheese
@moonlightcheese 5 месяцев назад
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.
Далее
Process Death and ViewModels (My apps are BROKEN)
26:32
Elden Ring DLC - ПОДОЖГЛО ПОПУ!
07:26
Просмотров 509 тыс.
Украшаю чехлы 🎀
00:51
Просмотров 324 тыс.
Full Guide to Jetpack Compose Effect Handlers
24:56
Просмотров 89 тыс.
DO NOT do this in a Software Engineering Interview
7:59
Software Engineering Interviews at Big Tech (Square)
31:06
WebRTC Crash Course
1:10:06
Просмотров 223 тыс.
Best practices for saving UI state on Android
20:36
Просмотров 37 тыс.
Dark Theme and Light Theme (Jetpack Compose)
31:14
Просмотров 18 тыс.
From Physics Student to Software Engineer
6:22
Просмотров 11 тыс.
Learn Android Process Death in 6min
6:27
Просмотров 14 тыс.
КРУТОЙ ТЕЛЕФОН
0:16
Просмотров 6 млн
iPhone 16 - НЕ СТОИТ ПРОПУСКАТЬ
4:50