hmos-scan-kit-defaultscan

Integrates Huawei Scan Kit default UI barcode scanning into HarmonyOS ArkTS applications.

2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/skills --skill hmos-scan-kit-defaultscan-iskenkenya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hmos-scan-kit-defaultscan
Source: https://github.com/IsKenKenYa/skills/tree/main/skills/harmonyos/development/media/scan-kit/hmos-scan-kit-defaultscan
Command: npx skills add https://github.com/IsKenKenYa/skills --skill hmos-scan-kit-defaultscan-iskenkenya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding barcode and QR code scanning to a HarmonyOS app normally requires camera permission handling, custom camera UI, and scan result plumbing. This Skill automates the integration of Huawei Scan Kit's default scanning interface, which provides a system-level scan UI with pre-authorized camera access, so developers can add scanning with minimal code. ## Core Features & Use Cases - Default Scan UI Integration: Generates ArkTS code that calls scanBarcode.startScanForResult with configurable scan types, multi-code recognition, and album scanning options. - Device Compatibility Checks: Inserts canIUse capability detection before invoking scan APIs so unsupported devices (PC, watches without rear cameras) fail gracefully. - Guided 5-Step Workflow: Detects project state, identifies the scan entry point, extracts requirements with sensible defaults, writes the code, and verifies it via syntax checks and a full build. - Use Case: A developer says "add a scan feature to my app" and the Skill locates or creates the trigger page, wires up the scan button, shows results via Toast, and leaves a TODO marker for business logic. ## Quick Start Ask the agent to add a default-interface barcode scanning feature to the current HarmonyOS project page using Scan Kit.

Frequently Asked Questions about hmos-scan-kit-defaultscan

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

FAQPage Schema
How do I add barcode scanning to a HarmonyOS app without camera permission?

Use Scan Kit's default interface scanning via scanBarcode.startScanForResult from @kit.ScanKit. The system pre-authorizes camera access, so no CAMERA permission request is needed, and the scan UI is provided by the system.

How to configure scan types and multi-code recognition in HarmonyOS Scan Kit?

Pass a ScanOptions object to startScanForResult with scanTypes (e.g., scanCore.ScanType.ALL or specific types like QR_CODE), enableMultiMode for multi-code recognition, and enableAlbum for album image scanning.

Does HarmonyOS default scanning work on all devices?

No. Default interface scanning supports Phone, Tablet, and Wearables with rear cameras from version 6.1.0(23). Check support with canIUse('SystemCapability.Multimedia.Scan.ScanBarcode') or scanCore.isDefaultScanSupported before calling the API.

How to detect when a user cancels scanning in HarmonyOS Scan Kit?

The startScanForResult promise rejects with error code 1000500002 when the user cancels scanning. Handle this error code in the catch block to avoid black screens or unresponsive UI after cancellation.

What are the limitations of Scan Kit default interface scanning?

The default scan UI does not support custom UX settings, and album scanning only supports single-code recognition. If you need a fully customized camera interface with flash, zoom, or focus control, use custom interface scanning instead.