A2UI for Android: Safely Rendering AI-Generated UI with Jetpack Compose
DREAMWALKERDreamus Company
AI agents are starting to generate not only text, but also interactive user interfaces. For Android apps, this raises a practical question: how much UI should we let an agent generate, and where should the Android client keep control? A2UI is a declarative protocol for agent-driven interfaces. Instead of sending arbitrary code, HTML, or WebView content, an agent sends structured UI messages such as components, data models, catalogs, and actions. The client then renders them with its own native UI toolkit. In this session, I will explore what A2UI means for Android developers by building and analyzing a Jetpack Compose based renderer. We will look at how A2UI messages such as createSurface, updateComponents, updateDataModel, and action can be mapped to Compose state, component registries, data binding, and user interaction callbacks. The talk will cover the practical design points that matter on Android: catalog-based allowlists, rendering only trusted components, preserving Material 3 design consistency, handling LLM streaming output, mapping JSON state to Compose recomposition, and sending user actions back to the agent. We will also compare A2UI with WebView-based dynamic UI, traditional Server-Driven UI, Remote Compose, and App Functions, and discuss where each approach fits. The goal is not to let AI “write arbitrary Android UI,” but to design an Android app that safely lets agents draw only the UI surfaces the app explicitly supports.
Intended audience
This session is for Android developers who are interested in AI agents, generative UI, Server-Driven UI, or dynamic UI rendering with Jetpack Compose. Basic knowledge of Jetpack Compose, Android app architecture, and JSON-based APIs will help, but prior knowledge of A2UI is not required. It is especially useful for developers who want to integrate AI agents into Android apps while keeping control over security, design system consistency, accessibility, and native user experience.