androidengineers.Book a session

Capstone and assessment

PocketCook final assessment

exercise45–60 min

Explain before checking the answer key

Answer the ten questions without opening the implementation. Award two points for a correct explanation with a specific consequence, one for a partly correct explanation, and zero for an incorrect one. Then compare with the key and revisit the relevant lesson. This self-assessment is not a certification.

  1. Why does setupComplete gate microphone capture rather than socket onOpen?
  2. How many bytes represent 100 ms of 16 kHz mono PCM16? What does an eight-item queue bound after batching?
  3. Why can a nonblocking read return less than the buffer size, and why did that matter here?
  4. Why could waiting for the first playback chunk to drain cause silence?
  5. Why is server turnComplete not sufficient to set speaking=false?
  6. How can old input survive draining the microphone channel during mute?
  7. What distinguishes capture epoch, playback epoch and connection generation?
  8. What survives backgrounding or process recreation, and what does not?
  9. Does asking PocketCook to start a timer execute an app action? What would be needed?
  10. What do the unit simulation, silent playback test and live conversation each establish?

Answer key

  1. A transport connection is not an accepted model session. The controller waits for the protocol acknowledgement before starting capture and handles timeout/rejection without a microphone owner.
  2. 3,200 bytes. Eight full chunks represent 800 ms queued, with potentially one in flight; this excludes other buffers and is not total latency.
  3. The call returns currently available data. Forwarding each short fragment consumed one queue item, so item count did not reflect the intended audio duration. Accumulation restores that relationship.
  4. Playback may wait for its startup threshold while the writer waits for playback. Feed subsequent chunks continuously, handle partial writes, and observe completion independently.
  5. The network can finish producing a turn while samples remain buffered in the device. Playback-head progress and pending data describe the local output state.
  6. An item may already have been delivered to a consumer that has not resumed. A capture epoch rejects it even if mute was toggled off again before consumption.
  7. Capture epoch rejects pre-mute input; playback epoch rejects old locally queued response bytes; connection generation rejects callbacks belonging to ended sessions.
  8. Recipe position persists. Backgrounding ends voice and clears the key; ingredient checks and transcripts are not persisted. Rotation retains the ViewModel; process recreation returns to the library and reloads step position when selecting a recipe.
  9. No. The baseline declares no timer tool. A future implementation needs an allowed schema, validated arguments, bounded execution, duplicate handling, cancellation and truthful execution results.
  10. The simulation proves deterministic byte ordering/chunking. The silent device test proves frame consumption through AudioTrack. A live run tests provider response plus the acoustic interaction on that particular device/route. None substitutes for the others.

Project evidence, another 20 points

Use the capstone rubric: behavior 8, ownership 4, tests 4, and documentation/evaluation 4. Target at least 16/20 here and 16/20 on conceptual questions before treating the core course as complete. Retake missed questions after reproducing the relevant failure or test.

A submission with keys in source, unlabelled fake responses, or a claim of tools/camera absent from its code is incomplete regardless of numeric score. Live-provider cases left unverified should remain visible in the report. You can finish the deterministic track now and complete the live evaluation later.

Your next learning decision

Choose the next extension based on evidence: improve turn handling if interruptions fail; investigate routing if frame progress passes but speech is inaudible; design authenticated token issuance before distributing a voice-enabled release. Add camera only for a task that benefits from visual context. Keep the same discipline of a small implementation, meaningful tests and a clearly scoped claim.

Course study guide · Hands-on codelab · Pinned Android source

YOUR LEARNING JOURNEY

0 of 16 available lessons completed

Progress saved in this browser. No account needed.
PocketCook final assessment | Gemini Live for Android with PocketCook | Android Engineers