hmos-multidevice-hardware-access

Manage hardware-capability adaptation and device-specific behavior in HarmonyOS applications.

Updated Jul 6, 2026
One-click install
npx skills add https://github.com/shirulot/codex-skill --skill hmos-multidevice-hardware-access-shirulot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hmos-multidevice-hardware-access
Source: https://github.com/shirulot/codex-skill/tree/main/hmos-multidevice-hardware-access
Command: npx skills add https://github.com/shirulot/codex-skill --skill hmos-multidevice-hardware-access-shirulot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the complexity of hardware-capability adaptation across diverse HarmonyOS device form factors, preventing crashes and UI inconsistencies when hardware features like cameras or sensors are missing or behave differently.

Core Features & Use Cases

  • Capability Detection: Standardizes SysCap and canIUse checks to ensure features are only exposed on supported hardware.
  • Camera Adaptation: Manages complex camera lifecycles, including foldable state changes, preview rotation, and stride-based memory alignment to prevent visual artifacts.
  • Use Case: When building a camera app for foldable devices, use this Skill to ensure the camera correctly reconstructs when the device transitions from folded to expanded, and that the preview stream remains correctly oriented regardless of device rotation.

Quick Start

Use the hmos-multidevice-hardware-access skill to implement a robust camera initialization sequence that handles foldable state changes and device rotation.

Frequently Asked Questions about hmos-multidevice-hardware-access

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle camera preview rotation and lifecycle during foldable state transitions in HarmonyOS?

To handle camera preview rotation during foldable state transitions in HarmonyOS, implement a robust camera initialization sequence that reconstructs the camera and applies rotation-aware rendering logic to prevent visual artifacts.

What is the best way to check hardware capabilities and manage fallback strategies across HarmonyOS devices?

The best way to check hardware capabilities across HarmonyOS devices is using standardized SysCap and canIUse checks within a declarative framework, ensuring features are only exposed on supported hardware with proper fallback strategies.

How do I manage sensor lifecycle and external device hot-plugging without causing app crashes?

To manage sensor lifecycle and external device hot-plugging without crashes, use a standardized hardware adaptation framework that provides consistent interaction rules and fallback behaviors for missing or disconnected hardware features.

Does HarmonyOS support stride-based memory alignment for camera previews to prevent visual artifacts?

Yes, HarmonyOS supports stride-based memory alignment for camera previews through specialized camera adaptation logic, ensuring preview streams remain correctly oriented and free of visual artifacts across different device form factors.

Why does my HarmonyOS app crash or show UI inconsistencies when hardware features are missing on diverse device form factors?

Your HarmonyOS app crashes or shows UI inconsistencies on diverse form factors because it lacks a unified hardware adaptation framework to standardize capability checks, manage missing hardware safely, and apply rotation-aware rendering logic.

Can I use a declarative framework to manage device-specific behavior for external device hot-plugging in HarmonyOS?

Yes, you can use a declarative hardware adaptation framework in HarmonyOS to manage device-specific behavior, including external device hot-plugging, sensor lifecycle management, and standardized capability detection across diverse hardware.