Sign in Go Pro

Android MVI Pattern

MVI and the Android View lifecycle

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson
Autoplay

Up next

Previous

About

We now explore how to hook up menus, toolbars, and how to trigger navigation events with AddEditTaskActivity.

Comments

Hi,

I would like to say thank you for this course because this pattern gives me a headache when I'm seeing examples and how much code is needed to be implemented. Nice and clear step by step introduction!

Anyway I was wondering about one topic which is notorious for Android devs. How would you like to handle process death (save & restore) scenario for MVI states? Is there any chance for additional course video?

Regards,
Arkadiusz

Thank you for that, really happy to hear the course was helpful this way. :)

It's a great question, and I think it would indeed make for a great follow up episode. For now, here's a quick outline on how to survive process-death:

The core idea is to create an Application level component whose job will be to save the ModelStore(s) state. Then, that same component can initialize your ModelStore(s) on App restart. This will allow you to survive process death. One more thing, typically a user dismissing the app from the recent apps list might expect a full reset. So when re-launching an App from scratch, you might want to clear any previously stored ModelStore state.

There's a multitude of ways to save your state. If you don't feel inspired to write your own, I'd suggest taking a look like Square's Tape library: https://github.com/square/tape

Hope this helps!
Etienne

>
You need to go PRO to post comments.

Lessons in Android MVI Pattern