PocketChat: Build Reliable Gemini Conversations on Android
Run and extend PocketChat with Kotlin, Compose, Gemini SSE streaming, Stop/Retry, bounded context, Room recovery, and an Android Engineers AI guide. Includes a tested code exercise.
Meet PocketChat and choose your evidence track
Build understanding through a runnable Android Engineers AI conversation app.
PocketChat combines a Compose interface, Gemini streaming, follow-up context, local history, saved answers, and an Android Engineers AI guide. You will run the finished sample, trace its decisions, then implement and test a context-retention improvement. This is a run–understand–extend codelab; the starting project is already functional.
The app you will explore



By the end, you can
- Explain system instruction, conversation context, and model training separately.
- Trace streamed text and cancel the underlying HTTP call.
- Add a completed-pair retention limit with a demonstrated failing test and passing implementation.
- Explain Room/lifecycle recovery and evaluate a curated AI guide honestly.
Prerequisites
Kotlin, Compose state, coroutines, HTTP/JSON, Git, Android Studio, JDK 17, SDK 36, and an API 26+ device/emulator. Your own Gemini access is needed only for live-model tasks. Allow several focused sessions; this walkthrough has not been timed.
What is not in this sample
No Google Search, course-text retrieval, structured takeaways, function calling, or production backend. The roadmap includes separate advanced design exercises; do not treat them as implemented app features.
Read the matching source and lesson
Step 1 of 12. Your progress is saved in this browser.