Skip to content
Skillpedia
Websites & UI (frontend)10k · #11941

display-glasses-with-jetpack-compose-glimmer

What it does

This skill gives guidelines for building Android XR apps that show content on display glasses, using the Jetpack Compose Glimmer toolkit. It covers design principles, workflows and interaction for glasses. It is for Android developers building glanceable experiences on smart glasses.

When to use it

  • ✓When you want to build an Android XR app that shows glanceable content on display glasses.
  • ✓When you need Glimmer theming and components for a glasses screen.
  • ✓When you want to plan the text size and layout for a display glasses experience.

Skill link

https://github.com/android/skills/blob/main/xr/display-glasses-with-jetpack-compose-glimmer/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/android/skills/blob/main/xr/display-glasses-with-jetpack-compose-glimmer/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Build a simple Android XR app that shows my next meeting on display glasses using Compose Glimmer.”

5 new skills a week. 1 minute to read.

How it works

The skill sets up the projected activity and checks the target SDK, then applies Glimmer theming and components. It follows the glasses design principles for readable text and focus-based interaction.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Glossary

Term Definition
Intelligent eyewear Hands-free eyewear with speakers, camera, and microphone (audio-only or display glasses).
Display glasses Eyewear with a private in-lens display for glanceable visuals that pair with audio.
Jetpack Compose Glimmer Compose UI toolkit providing components, theming, and focus behavior for display glasses.
Projected activity An Activity running on a phone host whose UI and input are projected to connected eyewear.
Projected device An XR eyewear device connected to an Android host phone that projects app content to it.
GlimmerTheme Root styling provider for GlimmerColors, GlimmerTypography, and GlimmerShapes.
Additive display Display where black (#000000) renders as 100% transparent by adding light to the scene.
Augmented experiences Lightweight, additive Android XR experiences that help users while they're on the go.
Visual angle Perceived size in XR; minimum readable text is 0.6 degrees (about 18sp at 1 m).

Prerequisites

  • Target compileSdk 37 or higher (compileSdk = 37 or compileSdk { version = release(37) }). Update compileSdk to 37 if lower.
  • When adding dependencies, follow the instructions in Create your first activity for intelligent eyewear:
    • androidx.xr.glimmer:glimmer (minimum 1.0.0-alpha21, or catalog alias libs.androidx.glimmer)
    • androidx.xr.glimmer:glimmer-google-fonts (minimum 1.0.0-alpha21, or catalog alias libs.androidx.glimmer.google.fonts)
    • androidx.xr.projected:projected (minimum 1.0.0-alpha13, or catalog alias libs.androidx.xr.projected or libs.androidx.projected)
    • Check gradle/libs.versions.toml first; if catalog entries exist, use them in app/build.gradle.kts and verify their versions meet the minimums. Never guess 1.0.0-alpha01 for glimmer-google-fonts.

Core constraints and limitations

  • Don't : Use MaterialTheme or Material 3 components (androidx.compose.material3.*) inside Projected Activities or Glimmer UI.
  • Do : Use GlimmerTheme and Glimmer components (androidx.xr.glimmer.*).
  • Do : Always pass createGoogleSansFlexTypography() from androidx.xr.glimmer.googlefonts as typography in GlimmerTheme.
  • Specific hardware device models or unique capabilities aren't detailed.
  • Elevation : Material 3 shadow or elevation modifiers aren't supported. Use ShadowScope or Depth tokens from Jetpack Compose Glimmer.
  • Typography limits: Minimum readable text size is 18sp (0.6°). Avoid "Thin" or "Hairline" weights, which shimmer on additive lenses.

1. Set up dependencies

  • Set up projected activity : When creating a projected activity, follow Create your first activity for intelligent eyewear and projectedcontext-source.md. Set android:requiredDisplayCategory to android.hardware.display.category.XR_PROJECTED in AndroidManifest.xml:

    <activity
        android:name="com.example.xr.projected.ProjectedMainActivity"
        android:exported="true"
        android:requiredDisplayCategory="android.hardware.display.category.XR_PROJECTED">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.XR_PROJECTED_LAUNCHER"/>
        </intent-filter>
    </activity>
    
    <br />
  • Mobile app integration : In the host phone app, add a button with Text("Launch on Glasses"). Observe ProjectedContext.isProjectedDeviceConnected(context, coroutineContext) using collectAsStateWithLifecycle(initialValue = false) to set the button's enabled state so it's disabled when glasses are disconnected. When clicked, launch GlassesMainActivity on the glasses display using ProjectedContext.createProjectedActivityOptions(context).toBundle() as shown in the following snippet:

    val options = ProjectedContext.createProjectedActivityOptions(context)
    val intent = Intent(context, ProjectedMainActivity::class.java)
    context.startActivity(intent, options.toBundle())
    
    <br />
  • UI library and font : When declaring the Glimmer, Google Fonts, and Projected artifacts in app/build.gradle.kts, follow [Declaring Jetp

FAQ

Which compile SDK does it need?

The project must target compileSdk 37 or higher, and the skill raises it if lower.

Is it for audio-only glasses?

No. The skill is for display glasses, and audio-only AI glasses without a display are excluded.

What is a projected activity?

It is an activity that runs on the phone and shows its interface on the connected glasses.

Details

Original description by the author

Provides guidelines for developing projected Android XR apps for display glasses using the Jetpack Compose Glimmer UI toolkit. Covers Glimmer design principles, workflows, and interaction models for the glasses form factor. Use this skill to build an Android XR Augmented Experience app with Jetpack Compose Glimmer. Don't use for audio-only AI glasses without a display, non-glasses Android XR headsets (spatial panels or 3D volumes with Jetpack Compose for XR), or phone and tablet Material 3 UIs.

repo: android/skills

Popularity

GitHub stars
10k
Ranking position
#11941
License
Apache-2.0
Updated
10/29/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills