androidengineers.Book a session

Runtime integration and inference ownership

Practice: Runtime integration and inference ownership

exerciseSelf-paced

Your assignment

Build an adapter with ready, busy and closed states. Test cancel during initialization and during inference.

Work through it

  1. Start from the scenario below and write the expected behavior before changing code. If this is a design exercise, produce a diagram or decision table; for an implementation exercise, create a small reproducible project or test fixture.
  2. Address each of these decisions explicitly: Initialization scope, Execution and cancellation, Concurrency limits. Record the assumptions that influence your choices.
  3. Reproduce the ordinary case and the failure described in the scenario. Use controlled inputs or fake dependencies where a live service would make the result unpredictable.
  4. Compare the observed result with your expected behavior. Fix the underlying decision or implementation when they differ; do not change the expected outcome merely to hide a failure.
  5. Save the evidence and explain what remains unverified. A simulated service failure demonstrates application handling, but does not establish real-device or provider compatibility.

Scenario to test

Rapid taps submit five requests. A bounded adapter cancels or queues according to product policy rather than allocating five model instances.

Completion criteria

Your UI remains responsive and ownership of native resources is unambiguous.

Submit the diagram or relevant code, the inputs used, the observed result and a short explanation of the tradeoff. Include at least one ordinary case and one boundary or failure case.

Review your work

  • Could another learner reproduce the result from your notes?
  • Does the evidence prove the completion criterion, or only that a tool ran?
  • Which assumption would change your design if it proved false?

Continue only when you can explain the result independently. The final project will combine these decisions.

YOUR LEARNING JOURNEY

0 of 13 available lessons completed

Progress saved in this browser. No account needed.
Practice: Runtime integration and inference ownership | On-device AI on Android | Android Engineers