androidengineers.Book a session

Project setup and a fake-backed screen

Project setup and a fake-backed screen

articleSelf-paced

Prove the mobile integration before adding real model calls.

1. Gradle compatibility

Verify the current Android runtime requirements, Kotlin processor setup and SDK levels. Record the tested dependency set instead of combining snippets from different releases.

2. ViewModel ownership

Keep runner invocation outside composable rendering. Expose immutable UI state and collect it with lifecycle awareness. Recomposition must not start another agent run.

3. Event translation

Map runner events to user-facing status such as checking, awaiting confirmation and complete. Do not render raw internal tool payloads as chat messages.

Worked scenario

Rotating a device recomposes the screen. A retained ViewModel preserves the active run without executing the same tool again.

Apply it

Use fake runner events to test idle, running, tool activity, success and failure screens.

Check your understanding

Recomposition and configuration change do not duplicate agent execution. Explain the decision and show evidence from your implementation or design. If you cannot demonstrate it yet, revisit the relevant section before continuing.

YOUR LEARNING JOURNEY

0 of 13 available lessons completed

Progress saved in this browser. No account needed.
Project setup and a fake-backed screen | ADK for Android | Android Engineers