Goal and prerequisites
Read the companion lesson and use the pinned PocketCook checkout. Work in your own learning branch. This exercise combines source reading with observable behavior; do not edit production credentials or upload conversations.
Source to inspect
CookViewModel.kt, MainActivity.kt and LiveSessionTest.kt. Kotlin files live under app/src/main/java/com/androidengineers/pocketcook/; unit tests under app/src/test/java/com/androidengineers/pocketcook/, device tests under app/src/androidTest/java/com/androidengineers/pocketcook/.
Predict, run, explain
Read the background-clearing and stale-socket tests. Run them. On a device, advance the recipe, leave the app, return and inspect voice/progress. Design a future timer tool contract with a bounded duration, duplicate-call rule and cancellation behavior; keep this explicitly separate from implemented features.
./gradlew :app:testDebugUnitTest --tests '*PocketCookTest.backgroundClearsCredentialsAndEndsVoice'
./gradlew :app:testDebugUnitTest --tests '*LiveSessionTest.oldSocketCannotReopenNewSession'
Run commands from gemini-live/. Record the source revision, prediction, result and explanation. A test failing to compile is a setup problem, not the expected behavioral failure. If the device or provider is unavailable, state which checks remain unverified.
Reference reasoning and submission
Expected reasoning: recipe position persists but the credential and conversation do not. A retry is a new session. A tool success sentence has no authority to change local state. Deliver the observed lifecycle result and a table for valid, duplicate, invalid and cancelled hypothetical tool requests. Implementing a server or timer is not required to finish the core course.
Self-check
Can another learner reproduce your result from your branch and notes? Can you name the responsible source method without reading the lesson? Have you separated local tests from actual device/provider evidence? Revisit the corresponding concept if any answer is no.
Course study guide · Hands-on codelab · Pinned Android source