hz-android-2d-porting

Guides porting existing Android 2D apps to Meta Quest and Horizon OS — input adaptation, panel layout, and design requirements. Use when adapting a mobile Android app for Quest.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hz-android-2d-porting" with this command: npx skills add meta-quest/agentic-tools/meta-quest-agentic-tools-hz-android-2d-porting

Android 2D App Porting to Horizon OS

When to Use

Use this skill when:

  • Porting an existing Android 2D app to run on Meta Quest headsets
  • Adapting a mobile Android app for Horizon OS panels
  • Troubleshooting input, layout, or compatibility issues with a 2D app on Quest
  • 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 Quest 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. Design: Apps must meet Horizon OS design requirements for Horizon Store approval.
  4. Performance: Quest uses a mobile GPU (Adreno) with thermal constraints.

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

Porting Workflow

Step 1: Initial Testing

Install hzdb (the Quest device CLI) if you haven't already:

npm install -g @meta-quest/hzdb

Install the existing APK on a connected Quest device and test basic functionality:

hzdb app install path/to/your-app.apk
hzdb app launch com.example.yourapp

Note any immediate issues: crashes, black screens, input problems, or layout breakage.

Step 2: 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 3: 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 layout strategies such as ConstraintLayout or Jetpack Compose. See Panel Layout Reference.

Step 4: Gradle and Manifest Updates

Update your build configuration to target Horizon OS:

// build.gradle.kts
android {
    defaultConfig {
        minSdk = 29       // Android 10 minimum
        targetSdk = 34    // 32-34 for immersive apps, 32-36 for 2D apps
    }
}

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

Step 5: 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 XR Simulator for rapid iteration, then validate on-device.

Step 6: Store Submission

Before submitting to the Horizon Store:

  • Verify all Compatibility Requirements
  • Test on at least Quest 3 and Quest 2 (if targeting both)
  • 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

FeatureStatusNotes
Standard Android ViewsSupportedTextView, RecyclerView, etc.
Jetpack ComposeSupportedFull Compose UI toolkit
WebViewSupportedChromium-based
Media playback (ExoPlayer)SupportedVideo and audio
Networking (HTTP, WebSocket)SupportedWi-Fi connectivity
Room / SQLiteSupportedLocal database
WorkManagerSupportedBackground tasks
NotificationsSupportedHorizon OS notification panel
Bluetooth (peripherals)SupportedKeyboard, mouse, gamepad
Android Accessibility APIsSupportedTalkBack equivalent available

Restricted or Unavailable

FeatureStatusNotes
Camera (front-facing)Not availableNo standard camera in 2D mode
Telephony / SMSNot availableNo cellular radio
NFCNot availableNo NFC hardware
GPS / Fine locationLimitedWi-Fi-based location only
Fingerprint / BiometricPromptNot availableUse Meta account auth instead
Split-screen (multi-window)LimitedUse Spatial SDK panels instead
Google Play ServicesNot availableUse Meta equivalents or alternatives
ARCoreNot availableUse Meta Spatial SDK for spatial features
Multi-touch gesturesLimitedSingle pointer from controller

Common Issues and Fixes

IssueCauseFix
App crashes on launchMissing Google Play Services dependencyRemove or make GMS optional
Buttons too small to tapTouch targets under 48dpIncrease minimum tap target size
No scroll in listsSwipe-based scroll not triggeredEnsure RecyclerView/LazyColumn handles generic scroll events
Keyboard doesn't appearCustom input field not using InputConnectionUse standard EditText or TextField
Layout brokenFixed-size layout assumptionsUse responsive layouts with ConstraintLayout or Compose
App requests unavailable permissionsCamera, telephony, etc.Guard with hasSystemFeature() checks

Key Concepts

Compatibility Mode vs Native Targeting

Apps not specifically targeting Horizon OS run in compatibility mode:

  • Fixed panel size (simulating a phone screen)
  • Limited resizing
  • Basic input translation

Apps that target Horizon OS with proper manifest entries run in native mode:

  • Resizable panels
  • Full input API support
  • Access to Spatial SDK features (optional)
  • Better integration with Horizon OS shell

Testing Tools

  • hzdb: Command-line tool for installing, launching, and debugging apps on Quest
  • XR Simulator: Desktop tool for testing Quest apps without a headset
  • Meta Quest Developer Hub (MQDH): GUI tool for device management and debugging
  • Android Studio: Full IDE with Quest device support via ADB

Performance Considerations

Quest devices have mobile-class hardware with strict thermal limits:

  • GPU: Qualcomm Adreno (varies by Quest 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

hz-new-project-creation

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

hz-vr-debug

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

hz-api-upgrade

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

hz-xr-simulator-setup

No summary provided by upstream source.

Repository SourceNeeds Review