0

Projected Hardware

يدير العتاد في أجهزة Android XR المعروضة.

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.

Skill · سكل

Install

npx skills add android/skills --skill projected-hardware

Works with

claude-code (native), claude (native), codex (native), chatgpt (native), gemini-cli (native), cursor (native), copilot (native), opencode (native), amp (native), roo (native), kiro (native), goose (native), junie (native), trae (native), cline (compatible), continue (compatible), antigravity (compatible), windsurf (compatible), augment (compatible), qwen-code (compatible)

Content

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).

Source and license

Source
Android Skills
Original
android/skills/xr/projected-hardware/SKILL.md
License
Apache-2.0