Your course project
You will understand and extend PocketCards, a Kotlin and Jetpack Compose app that turns notes into flashcards. This is a free, text-based course with practical work in a completed sample. It is not a video course or a build-from-empty tutorial. You will explain existing code, make a tested change, evaluate generated answers and implement an independent extension.
Open the codelab · Browse the course source
The roadmap gives the learning order; the articles explain the decisions; the codelab supplies runnable instructions. Use all three with the same app checkout. Expect 12–16 hours, including the independent capstone. Firebase setup and debugging may take longer.
Before you start
You should be able to read a Kotlin data class, call a suspend function and explain how a Compose screen receives state from a ViewModel. You need Git, Android Studio, JDK 17, SDK 36 / Build Tools 36.0.0 and an API 26+ device or emulator. No machine learning background is required.
First run the handwritten sample deck without Firebase. Your own Firebase project is needed only for live generation. Never include local configuration, App Check tokens or private notes in a submission. If you cannot use cloud inference, complete the deterministic sections and explicitly leave live-model evaluation unverified.
How the lessons and codelab fit together
| Course module | Codelab work | Evidence before moving on |
|---|---|---|
| 1. AI in an Android app | Read the overview, clone and explore the manual baseline | Separate model work from application rules |
| 2. Tokens and model behavior | Read the model adapter and schema | Explain why valid JSON can contain a false answer |
| 3. Cloud, local or hybrid | Read the Firebase and App Check setup; configure when ready | Draw the data boundary and state the offline behavior |
| 4. Kotlin architecture | Trace cancellation, persistence and final-card rendering | Predict a failed save and a late response |
| 5. Evaluation and privacy | Prepare the evaluation cases before live generation | Record expected facts without consulting model output |
| 6. Connect and improve | Finish setup, generate a real deck, then do the red/green exercise | Demonstrate an actual request and a failing-then-passing test |
| 7. Capstone and assessment | Complete failure checks and an independent extension | Submit evidence and score the final assessment |
Reading ahead in the adapter does not require a configured Firebase project. When a lesson references a later codelab section, inspect its code first and return to run it after setup.
Use a predict → run → explain loop
Before each experiment, write a prediction. Run the app or test, then explain the difference between expected and observed behavior. A command succeeding is evidence about that command, not proof of the entire feature.
Learning log
Revision:
Question or hypothesis:
Action / command:
Expected result:
Observed result:
Responsible source file:
Explanation:
Remaining uncertainty:
For example: “Saving a review fails, so the current card should stay visible.” Confirm the repository fails, the ViewModel exposes the error and the screen does not advance. A screenshot alone cannot establish all three.
Reading code versus changing code
The conceptual lessons contain excerpts and clearly marked teaching examples. Do not paste them over complete source files. The codelab's duplicate-question exercise is an implementation task: add the test, observe the expected failure, make the smallest fix and run the full unit suite. The capstone is a separate change you design yourself.
Use the pinned source rather than a moving main branch:
git clone https://github.com/AndroidEngineers/android-ai-cookbook.git
cd android-ai-cookbook
git switch -c learning/pocketcards c527701
cd ai-fundamentals
If you already cloned it for the codelab, reuse that learning branch. Do not overwrite your work by repeating setup unnecessarily.
Completion means evidence
Complete all six practice assignments, the codelab validation exercise, one independent extension and the final assessment. Keep a source commit, test results, sanitized evaluation sheet and app-only screenshots or recording. Distinguish live-provider evidence from fake-backed tests.
The final assessment is a self-assessment with an answer key and a project rubric. Its score is not an externally verified qualification. If an acceptance criterion fails, record the gap and repeat the relevant lesson before treating the project as complete.