androidengineers.Book a session

Advanced design extensions

Practice: Structured output and validation

exerciseSelf-paced

Assignment: specify and test a takeaway boundary

This is an advanced design exercise. No live structured-output feature exists in the pinned app. Implement the pure validation proposal from the lesson in a separate test fixture or your own extension branch; do not modify the baseline merely to make the roadmap appear complete.

Create examples for a valid list, zero items, six items, blank title, oversized item, and duplicates differing only in whitespace/case. Define what the UI should show in each case. Add a separate example that is structurally valid but factually unrelated to its source conversation; explain why the validator cannot detect that.

Write the proposed request/parse/validate/save sequence and specify timeout, cancellation, and explicit-retry behavior. Decide whether malformed JSON permits a repair request and cap any retry count. Include the provider capability check you would perform before choosing a schema.

Submit the table of inputs and expected outcomes, tests for the pure policy, and an editable-preview sketch. Completion means you can defend the boundary; it does not mean PocketChat now supports structured generation. Do not publish unsupported current-model claims without verifying the relevant provider documentation during implementation.

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: Structured output and validation | Gemini Chat for Android with PocketChat | Android Engineers