Architecture: One App for Both Glass Types

▶ Watch (1:59)

Code runs on the phone as a projected activity. A ViewModel is the single source of truth. The Jetpack projected library observes display capability. When a display is available, Jetpack Compose Glimmer UI renders. When not, an audio experience with Gemini Live API takes over. Display state triggers recomposition. This conditional rendering allows one app to work across both glass types. The app stays responsive to display changes, switching between UI and audio.

Audio-First Interactions Without a Display

▶ Watch (2:50)

Provide a sign of life when the projected activity launches. The Gemini Live API greets the user with current list items. Agentic tools enable actions like stopping the session via function calls. When a display turns on, the projected device controller adjusts audio verbosity. The app queries capability visual UI and listens for presentation mode changes. This keeps the experience concise whether or not a screen is visible.

Jetpack Compose Glimmer: Components for Additive Displays

▶ Watch (5:08)

Glasses displays add light and cannot create black. Jetpack Compose Glimmer components use additive-safe colors and Google Sans Flex typography. Buttons support touchpad taps and swipes with outline feedback. Toggles have selected and unselected states. Button groups overflow and scroll. Cards group information. Vertical lists include built-in scrolling and focus. Stacks show one item at a time with offscreen masking. A voice input indicator shows microphone activity.

Customizing and Navigating Glimmer Screens

▶ Watch (8:41)

Vertical list follows the same API as LazyColumn but adds smooth focus scrolling and a scrim. Stacks mimic lazy component patterns. Navigation Compose works for screen transitions. The theming system lets developers customize primary and secondary colors. Border colors emphasize interactive components. For example, positive color marks a confirmation button. Developers adapt existing Compose skills to glasses. Material-like patterns reduce the learning curve.

Testing Glasses Apps Without Hardware

▶ Watch (11:27)

Android Studio includes an AI glasses virtual device. Create it, pair with a phone emulator, and launch projected activities. You can interact with your app by tapping or swiping on the emulator. Use Compose previews to check UI against different environments. Test light, dark, and busy backgrounds. No physical glasses needed. The emulator is available in the latest Canary build.

Notable Quotes

Glasses uses an additive transparent display. This means it can only add light and it cannot create black. Adhithya Ramakumar · ▶ Watch (5:08)

Jetpack Compose Glimmer follows the same API principles and patterns with the other compos libraries that you already familiar with. Louis Pullen-Freilich · ▶ Watch (8:41)

Building for AI glasses doesn’t mean starting from scratch. Kathleen Bryan · ▶ Watch (13:26)

You don’t need a physical device to get started. Kathleen Bryan · ▶ Watch (14:07)

Key Takeaways

  • Use a shared ViewModel to support both audio and display modes in one app.
  • Jetpack Compose Glimmer provides components tuned for additive transparent displays.
  • The glasses emulator in Android Studio lets you test without physical hardware.