By the end of this lesson your routines will survive closing the app, a reminder will ping you every day, and you will know how to fix the most common Expo errors and when Expo Go stops being enough.
You need: the Daily Routine app from lesson 3 running in Expo Go, your coding agent · Time: 8 minutes
Close Expo Go completely and open the app again. Your new routines are gone. Right now they live only in the phone's memory, which is wiped when the app closes.
To keep them, the app must save them in the phone's storage. Two common choices, both work in Expo Go:
- AsyncStorage: a simple "key → value" store. Perfect for a small list like ours.
- expo-sqlite: a real database on the phone. Better when you have thousands of rows or need searching and reports (for example a full UPI expense tracker).
Prompt · copy it into your AI agentRoutines and today's ticks disappear when I close the app. Save them on the phone so they survive restarts. Use @react-native-async-storage/async-storage and install it with "npx expo install", not npm install. Rules: load saved routines when the app starts; save after every add or tick; a new day starts with all ticks cleared, but the routines stay; if nothing is saved yet, show the three sample routines. Tell me how to test it on my phone.
Test: add a routine, tick two, close Expo Go fully (swipe it away), open again. Everything should still be there.
Do it now Do it now: test saving
Why?An app that forgets your data is a demo, not an app. Saving on the phone also means no server, no login and no monthly bill.
CarefulAsyncStorage is not encrypted. It is fine for routines, never for passwords, OTPs or bank details.
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- Always use npx expo install
- Add a daily reminder
- Fix common errors in two commands
- When Expo Go isn't enough: development builds
- Recap