androidengineers.Book a session

Storage and lifecycle behavior

Practice: PocketChat history and recovery

exerciseSelf-paced

Assignment: build a recovery matrix

Use a dedicated emulator, not your only installation with valuable conversations. First run the Room close/reopen and Activity recreation tests through the instrumented suite. The tests name different guarantees; do not merge them into one “lifecycle works” claim.

For a manual comparison, save a completed answer, background the app, reopen it, and confirm that history exists but the debug key has cleared. Delete the source conversation and check that the saved snapshot remains with an unavailable-source label.

On the dedicated emulator only, an app stop/relaunch can probe persisted state:

adb -s <test-emulator-serial> shell am force-stop com.androidengineers.pocketchat
adb -s <test-emulator-serial> shell am start -n com.androidengineers.pocketchat/.MainActivity

This stops the app; it does not clear its data. Force-stopping while streaming may lose the newest uncheckpointed characters. Compare the stored status with the most recent visible text and explain the difference. Do not include a key or personal conversation in your screenshots.

Submit a matrix for rotation, backgrounding, process stop, source deletion, and storage failure. Include state owner, surviving data, expected UI label, actual result, and uncertainty. Finish by proposing a normalized Room schema for larger histories without pretending that proposal is already implemented.

Study guide · Hands-on codelab · Pinned Android source

YOUR LEARNING JOURNEY

0 of 23 available lessons completed

Progress saved in this browser. No account needed.
Practice: PocketChat history and recovery | Gemini Chat for Android with PocketChat | Android Engineers