hz-android-2d-porting

指导将现有的 Android 2D 应用移植到 Meta Quest 和 Horizon OS,包括输入适配、面板布局和设计要求。适用于将移动 Android 应用适配到 Quest 时使用。

仓库最近推送
GitHub Stars
269
Forks
25
Issues / PRs
8

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "hz-android-2d-porting":https://skillpi.com/zh/skills/deepskill-7c9d4e3b5264c8b37147b49cba65cc334a92439a9e81ce9fe544baf44e77db91。安装前核对上游来源和版本:https://github.com/meta-quest/agentic-tools。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

指导将现有的 Android 2D 应用移植到 Meta Quest 和 Horizon OS,包括输入适配、面板布局和设计要求。适用于将移动 Android 应用适配到 Quest 时使用。

0 下载

介绍来源: third_party · meta-quest · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: hz-android-2d-porting
license: Apache-2.0
description: "Guides porting existing Android 2D apps to Meta VR and Horizon OS — input adaptation, panel layout, and design requirements. Use when adapting a mobile Android app for Meta VR. For UI design decisions, use hz-panel-designer if available. Build path: Standard Android; use hz-quest-verify-first if the build path is unclear."
allowed-tools: Bash(metavr:*), Bash(hzdb:*)

Android 2D App Porting to Horizon OS

When to Use

Use this skill when:

  • Porting an existing Android 2D app to run on Meta VR headsets
  • Adapting a mobile Android app for Horizon OS panels
  • Troubleshooting input, layout, or compatibility issues with a 2D app on Meta VR devices
  • Preparing an Android app for Horizon Store submission
  • Evaluating whether an existing Android app is compatible with Horizon OS

Overview

Horizon OS is built on Android (AOSP) and can run standard Android applications inside panels -- floating 2D windows positioned in 3D space. Most well-built Android apps work on Meta VR devices with minimal changes, but several areas require attention:

  1. Input: There is no touchscreen. Users interact via controller pointer (ray-casting), hand tracking, or connected peripherals.
  2. Layout: Apps run in resizable panels, not full-screen on a fixed display.
  3. Compatibility: Dependencies and permissions must work without Google Play Services or unavailable hardware.
  4. Design and performance: Apps must meet Horizon Store requirements on mobile hardware.

The goal of porting is to make the app feel native to the Meta VR experience while preserving existing functionality.

Porting Workflow

Step 1: Initial Testing

Build and install the existing app with its normal Android workflow. Android Studio, Gradle, and adb all work with a connected Meta VR device:

./gradlew installDebug
adb shell am start -n com.example.yourapp/.MainActivity

Prefer metavr app install <apk> and metavr app launch <package> over raw adb here, then stream metavr adb logcat --follow during this first run. Note any immediate crashes, black screens, input problems, or layout breakage.

Step 2: Compatibility Audit

Check whether the app depends on Google Play Services, unsupported hardware, or prohibited permissions before changing its UI. Make unsupported features optional or replace them with Horizon OS alternatives. See Compatibility Requirements.

Step 3: Input Adaptation

The most common porting issue is input. Touch events are translated from the controller pointer, but:

  • Hover states are now visible (users point before clicking)
  • Scrolling uses the thumbstick, not swipe gestures
  • Multi-touch gestures (pinch-to-zoom) do not translate directly
  • Tap targets must be large enough for pointer accuracy (48dp minimum)

See Input Adaptation Reference for detailed guidance.

Step 4: Layout Adjustment

Panels are resizable and can have various aspect ratios. Your app must handle:

  • Dynamic width and height changes
  • Landscape and portrait orientations
  • Different effective DPI values

Use responsive Android layouts and window-size breakpoints. See Panel Layout Reference.

Step 5: Gradle and Manifest Updates

Update your build configuration to target Horizon OS:

// build.gradle.kts
android {
    defaultConfig {
        minSdk = 29       // Android 10 minimum
        targetSdk = 34    // API 34 or higher required for all new 2D panel apps
    }
}

Add required manifest entries for device targeting. See Gradle Setup Reference.

Step 6: Input Testing

Test with all supported input methods:

  • Controller: point-and-click, thumbstick scroll, trigger tap
  • Hand tracking: pinch-to-select, hand scroll
  • Keyboard/mouse: Bluetooth peripherals, system keyboard for text fields

Use the Meta Spatial Simulator for rapid desktop iteration, then validate on-device with the Meta Horizon OS Android Studio plugin or normal ADB tooling. Keep metavr adb logcat --follow running during each input pass — it catches input errors that don't visibly crash.

Step 7: Store Submission

Before submitting to the Horizon Store:

  • Verify all Compatibility Requirements
  • Test on at least Quest 3, Quest 3S, and Quest 2 (if targeting them), plus Meta VR Glasses
  • Confirm the app works in both passthrough and immersive home environments
  • Review Meta's content policies and technical requirements

Quick Compatibility Check

Works on Horizon OS

Feature Status Notes
Standard Android Views Supported TextView, RecyclerView, etc.
Jetpack Compose Supported Full Compose UI toolkit
React Native Supported Uses the standard Android application path
WebView Supported Chromium-based
Media playback (ExoPlayer) Supported Video and audio
Networking (HTTP, WebSocket) Supported Wi-Fi connectivity
Room / SQLite Supported Local database
WorkManager Supported Background tasks
Notifications Supported Horizon OS notification panel
Bluetooth (peripherals) Supported Keyboard, mouse, gamepad
Android Accessibility APIs Supported TalkBack equivalent available

Restricted or Unavailable

Feature Status Notes
Telephony / SMS Not available No cellular radio
NFC Not available No NFC hardware
GPS / Fine location Limited Wi-Fi-based location only
Fingerprint / BiometricPrompt Not available Use Meta account auth instead
Multiple app-owned panels Limited Use the current public multi-panel guidance when available
Google Play Services Not available Use Meta equivalents or alternatives
ARCore Not available Use Meta Spatial SDK for spatial features
Multi-touch gestures Limited Single pointer from controller

Common Issues and Fixes

Issue Cause Fix
App crashes on launch Missing Google Play Services dependency Remove or make GMS optional
Buttons too small to tap Touch targets under 48dp Increase minimum tap target size
Keyboard doesn't appear Custom input field not using InputConnection Use standard EditText or TextField
Layout broken Fixed-size layout assumptions Use responsive Views or Compose layouts
App requests unavailable permissions Telephony, NFC, or other absent hardware Guard with hasSystemFeature() checks
APK rejected for prohibited permissions Library or plugin silently added a prohibited permission Run aapt dump permissions your-app.apk, then check prohibited list
APK rejected for invalid signature Signed with v1-only scheme v2 signing is default in AGP 7.0+; for older AGP, add v2SigningEnabled = true to your signing config

Testing Tools

  • Meta Horizon OS Android Studio plugin: Device connection, deployment, and Horizon OS development support
  • Meta Spatial Simulator: Desktop simulation for 2D Android apps on Horizon OS
  • Android Studio, Gradle, and ADB: Standard Android build, install, launch, and logcat workflows
  • metavr: Optional command-line convenience for device and app operations

Performance Considerations

Meta VR devices have mobile-class hardware with strict thermal limits:

  • GPU: Qualcomm Adreno (varies by model)
  • RAM: 6-12 GB shared between system and apps
  • Thermal: Sustained workloads may trigger thermal throttling
  • Avoid heavy overdraw and complex shader effects in 2D UI
  • Minimize background work to reduce power consumption
  • Test with representative data loads (large lists, images, etc.)

References

版本历史

  1. v1.8.0 GitHub ↗
    原版更新说明

    **Full Changelog**: https://github.com/meta-quest/agentic-tools/compare/v1.2.3...v1.8.0

  2. v1.2.3 GitHub ↗
    原版更新说明

    **Full Changelog**: https://github.com/meta-quest/agentic-tools/compare/v1.2.1...v1.2.3

  3. v1.2.1 GitHub ↗
    原版更新说明

    **Full Changelog**: https://github.com/meta-quest/agentic-tools/commits/v1.2.1

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 提供详细的移植工作流,涵盖从初始测试到商店提交的完整流程
  • 包含兼容性检查表和常见问题解决方案,实用性强
  • 针对 Meta VR 设备的特定需求进行了详细说明
触发精准95/100

亮点

  • 触发词精准完整,覆盖多种变体,边界清晰
  • description 明确指出了使用场景和目标平台
结构规范90/100

亮点

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,单文件≤500行
  • 结构良好,包含详细的步骤、兼容性检查、常见问题和测试工具
执行可靠88/100

亮点

  • 工具来源明确,参数正确,覆盖主要异常
  • 提供了详细的兼容性检查和常见问题解决方案
  • 不可逆操作有确认机制
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • developers.meta.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。