display-glasses-with-jetpack-compose-glimmer
できること
このスキルは、Jetpack Compose Glimmerツールキットを使い、ディスプレイ付きのメガネに内容を表示するAndroid XRアプリの指針を提供します。メガネ向けの設計原則、作業の流れ、操作を扱います。スマートグラスで一目でわかる体験を作るAndroid開発者向けです。
使う場面
- ✓ディスプレイ付きのメガネに、一目でわかる内容を表示するAndroid XRアプリを作りたいとき。
- ✓メガネの画面のために、Glimmerのテーマとコンポーネントが必要なとき。
- ✓メガネの体験のために、文字の大きさとレイアウトを計画したいとき。
スキルのリンク
https://github.com/android/skills/blob/main/xr/display-glasses-with-jetpack-compose-glimmer/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Compose Glimmerを使い、次の会議をディスプレイ付きのメガネに表示する、シンプルなAndroid XRアプリを作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、投影されたアクティビティを設定し、ターゲットのSDKを確認します。そのうえで、Glimmerのテーマとコンポーネントを適用します。読みやすい文字とフォーカスによる操作のために、メガネの設計原則に従います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
compileSdk37 or higher (compileSdk = 37orcompileSdk { version = release(37) }). UpdatecompileSdkto 37 if lower. - When adding dependencies, follow the instructions in Create your first
activity for intelligent eyewear:
androidx.xr.glimmer:glimmer(minimum1.0.0-alpha21, or catalog aliaslibs.androidx.glimmer)androidx.xr.glimmer:glimmer-google-fonts(minimum1.0.0-alpha21, or catalog aliaslibs.androidx.glimmer.google.fonts)androidx.xr.projected:projected(minimum1.0.0-alpha13, or catalog aliaslibs.androidx.xr.projectedorlibs.androidx.projected)- Check
gradle/libs.versions.tomlfirst; if catalog entries exist, use them inapp/build.gradle.ktsand verify their versions meet the minimums. Never guess1.0.0-alpha01forglimmer-google-fonts.
Core constraints and limitations
- Don't : Use
MaterialThemeor Material 3 components (androidx.compose.material3.*) inside Projected Activities or Glimmer UI. - Do : Use
GlimmerThemeand Glimmer components (androidx.xr.glimmer.*). - Do : Always pass
createGoogleSansFlexTypography()fromandroidx.xr.glimmer.googlefontsastypographyinGlimmerTheme. - Specific hardware device models or unique capabilities aren't detailed.
- Elevation : Material 3 shadow or elevation modifiers aren't supported. Use
ShadowScopeorDepthtokens 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:requiredDisplayCategorytoandroid.hardware.display.category.XR_PROJECTEDinAndroidManifest.xml:
<br /><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>Mobile app integration : In the host phone app, add a button with
Text("Launch on Glasses"). ObserveProjectedContext.isProjectedDeviceConnected(context, coroutineContext)usingcollectAsStateWithLifecycle(initialValue = false)to set the button'senabledstate so it's disabled when glasses are disconnected. When clicked, launchGlassesMainActivityon the glasses display usingProjectedContext.createProjectedActivityOptions(context).toBundle()as shown in the following snippet:
<br />val options = ProjectedContext.createProjectedActivityOptions(context) val intent = Intent(context, ProjectedMainActivity::class.java) context.startActivity(intent, options.toBundle())UI library and font : When declaring the Glimmer, Google Fonts, and Projected artifacts in
app/build.gradle.kts, follow [Declaring Jetp
よくある質問
どのcompile SDKが必要ですか?
プロジェクトはcompileSdk 37以上をターゲットにする必要があり、低い場合はこのスキルが引き上げます。
音声のみのメガネにも使えますか?
いいえ。このスキルはディスプレイ付きのメガネ向けで、ディスプレイのない音声のみのAIグラスは対象外です。
投影されたアクティビティとは何ですか?
スマートフォンで動き、接続されたメガネにそのインターフェースを表示するアクティビティです。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 10k
- ランキング
- #11941
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/29
コメント
- …
このリポジトリの他のスキル
agp-9-upgrade
10kエージェントが、AndroidアプリをAndroid Gradle Plugin 9にアップグレードし、その破壊的変更に対応できるよう支援します。マルチプラットフォームのプロジェクトは対象外です。
camerax
10kエージェントが、CameraXを使ってAndroidのカメラ機能を作れるよう支援します。動画の録画、ハードウェアの制御、ML Kit、Media3のエフェクトを含みます。
android-for-cars-parked-apps
10kエージェントが、Androidの動画、ゲーム、ブラウザのアプリを、Android AutoとAndroid Automotiveで駐車中のアプリとして動かせるように適合させるよう支援します。
appfunctions
10kエージェントが、Androidアプリの主要な作業の流れを見つけ、AIエージェントや音声コマンドが実行できるAppFunctionsとして公開できるよう支援します。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。