跳到正文
Skillpedia
移动应用10k · #11942

projected-hardware

它能做什么

这个技能说明如何在 Android 应用中访问投屏智能眼镜上的摄像头和麦克风等硬件。涵盖眼镜权限和连接管理。适合开发智能眼镜功能的 Android 开发者。

适用场景

  • ✓你的应用需要用已连接的智能眼镜拍照的时候。
  • ✓你的应用需要访问投屏眼镜的麦克风并请求权限的时候。
  • ✓眼镜连接断开时,你需要处理连接并释放资源的时候。

技能链接

https://github.com/android/skills/blob/main/xr/projected-hardware/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/android/skills/blob/main/xr/projected-hardware/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我在 Android 应用中添加一个功能,从已连接的智能眼镜拍摄照片。”

每周 5 个新技能,1 分钟读完。

工作原理

这个技能指向投屏环境、权限和拍照的参考步骤。它说明如何检查眼镜连接,并管理与连接相关的资源。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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 to understand how to get a projected context and how to manage its lifecycle.

Request glasses hardware permissions

  • Hardware permissions and opt-in : You must read Request hardware permissions 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

常见问题

需要哪个编译 SDK?

项目必须使用 compileSdk 36 或更高版本。

眼镜断开连接时硬件还能用吗?

不能。只有在眼镜与手机连接时才能访问硬件。

如何声明权限?

摄像头和麦克风权限需要在 Android 清单文件中声明,并在运行时请求。

详情

作者的原始描述

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.

repo: android/skills

热度

GitHub 星标
10k
排名
#11942
许可证
Apache-2.0
更新时间
2026/10/29

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能