Skip to main content
skill CX Codex

projected-hardware — Claude Code skill: features and install

The projected-hardware Claude Code skill explains how Android apps access hardware on Android XR glasses. It covers camera and microphone permissions, device connections, and audio routing.

Apache-2.0 444 installs ★ 10,691 updated 2026-10-23

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add android/skills --skill projected-hardware -a claude-code
Open on GitHub

What projected-hardware does

The skill explains how an Android app can access the camera and microphone on Android XR glasses. It covers requesting runtime permissions, capturing a photo through ProjectedContext, and managing the glasses’ connection to the host phone. The project needs compileSdk 36 or higher.

For audio capture, it describes routing AudioRecord to the glasses microphone over Bluetooth HFP. It also covers getting the phone’s context with ProjectedContext.createHostDeviceContext(activity), an API marked with @OptIn(ExperimentalProjectedApi::class). Hardware access lasts only while the glasses are connected to the host phone; ProjectedContext handles resource lifecycle management.

What it helps with

  • request runtime camera and microphone permissions for glasses
  • capture a photo with the glasses camera through ProjectedContext
  • route AudioRecord to the glasses microphone
  • manage resources as glasses connect to or disconnect from the phone

Example prompts for the agent

  • Add photo capture from Android XR glasses using ProjectedContext to my Android app.
  • Set up camera and microphone permissions for intelligent eyewear in my Android app.
  • Route AudioRecord to the glasses microphone over Bluetooth HFP.

How to install projected-hardware

1Skills CLI (Vercel)

npx skills add android/skills --skill projected-hardware -a claude-code

2Manually: put the files in place

~/.claude/skills/projected-hardware/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/projected-hardware/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about projected-hardware

How do I install projected-hardware in Claude Code?

Run npx skills add android/skills --skill projected-hardware -a claude-code. The skill file is at ~/.claude/skills/projected-hardware/SKILL.md.

What does projected-hardware do?

It guides Android app development for accessing Android XR glasses cameras and microphones, requesting runtime permissions, and managing connections with ProjectedContext.

What does projected-hardware require?

The project needs compileSdk 36 or higher. The glasses must be connected to the host phone for their hardware to be accessible.

Source text

SKILL.md · Apache-2.0
---
name: projected-hardware
description: Provides instructions and workflows for accessing and managing hardware
  on Android XR projected devices, such as audio glasses and display glasses. Use
  this skill when building experiences for intelligent eyewear in an Android app and
  you need to access device hardware like the camera and microphone, handle glasses-specific
  runtime permissions, or manage connection lifecycles using projected context.
license: Complete terms in LICENSE.txt
metadata:
  author: Google LLC
  last-updated: '2026-11-13'
  keywords:
  - Android XR
  - intelligent eyewear
  - audio glasses
  - display glasses
  - glasses hardware
  - ProjectedContext
  - projected context
  - runtime permissions
  - CameraX
  - audio recording
---

## Prerequisites

- You must use a `compileSdk` of 36 or higher.

## Connection and lifecycle management

Intelligent eyewear hardware is only accessible while the glasses are connected
to the host phone. Monitor connection state and manage resource lifecycles using
`ProjectedContext`. You must read
[Understand projected activities and projected contexts](references/android/develop/xr/jetpack-xr-sdk/glasses/support-different-types.md) to understand
how to get a projected context and [how to manage its lifecycle](references/android/develop/xr/jetpack-xr-sdk/glasses/check-availability.md).

## Request glasses hardware permissions

- **Hardware permissions and opt-in** : You must read [Request hardware permissions](references/android/develop/xr/jetpack-xr-sdk/request-hardware-permissions.md) to understand how to declare camera and microphone runtime permissions in the Android Manifest file, request runtime permissions in different scenarios, and handle permission results.

## Glasses hardware access and capabilities

- **Camera capture and CameraX** : You must read [Capture an image with the glasses' camera](references/android/develop/xr/jetpack-xr-sdk/access-hardware-projected-context.md) to understand the implementation patterns for capturing a photo with the glasses' camera using a `ProjectedContext`.
- **Bluetooth HFP audio and host device context** : Read [Use a projected
  context to access hardware](references/android/develop/xr/jetpack-xr-sdk/access-hardware-projected-context.md) to route `AudioRecord` to the glasses microphone over Bluetooth HFP (`TYPE_BLUETOOTH_SCO`, `VOICE_COMMUNICATION`, `setPreferredDevice`, and `setCommunicationDevice`) and to obtain the host phone context from a projected activity using `ProjectedContext.createHostDeviceContext(activity)` (annotated with `@OptIn(ExperimentalProjectedApi::class)` from `androidx.xr.projected.experimental.ExperimentalProjectedApi`).

© Google LLC · Apache-2.0 · android/skills

Similar skills

SKILL.md skills catalog →

From the same set36

The whole set →
litert-runtime litert-runtime walks through Kotlin code and Gradle setup for running .tflite models on Android with the CompiledModel API. Covers CPU and GPU inference, buffer reuse, preprocessing, and migration from the legacy TFLite stack. CX Codex +1 558installs wear-widgets wear-widgets — a skill that builds, migrates, and checks Wear OS widgets using Glance Wear and Remote Compose. It steps in when an Android project needs a new widget, a TileService migration, or a review of an existing implementation. CX Codex +1 544installs android-for-cars-parked-apps android-for-cars-parked-apps — a skill for Claude Code adapts existing Android video apps, games, and web browsers for parked use on Android Auto and Android Automotive OS. CX Codex +1 537installs litert-lm This Claude Code skill guides Android app work with on-device text language models. It covers chat, summarization, and extraction through LiteRT-LM. CX Codex +1 451installs glance-appwidget-updates-and-memory glance-appwidget-updates-and-memory — a Claude Code skill for updating Android AppWidgets built with Jetpack Glance and keeping their images within memory limits. It covers widget setup, state sync, and crash fixes. CX Codex +1 400installs ink-app-builder The ink-app-builder Claude Code skill adds stylus and touch drawing to Android apps with Jetpack Ink and Compose. It activates for drawing surfaces, stroke rendering, erasing, undo history, or stroke storage. CX Codex +1 387installs ink-custom-brush-builder ink-custom-brush-builder — a skill for Claude Code and Cursor builds custom brush definitions for Android apps using Jetpack Ink. Sets up tip shapes, multi-coat layers, and stylus behaviors. CX Codex +1 382installs mlkit-agent-api The mlkit-agent-api Claude Code skill guides Android agent workflows built with the ML Kit GenAI Agent API. It applies to multi-turn chat, on-device tool calls, and GenAiException handling. CX Codex +1 374installs

Project sponsors

Companies that keep this analytics open