harmonyOS developer

# HarmonyOS Developer Skills

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "harmonyOS developer" with this command: npx skills add louiseleven/harmonyos

HarmonyOS Developer Skills

Core Rules

  • Use .equals() for string comparison, not ==
  • HarmonyOS uses ArkTS/TypeScript
  • UI built with ArkUI framework
  • App signing requires certificate configuration

Development Environment

  • IDE: DevEco Studio
  • Language: ArkTS (TypeScript superset)
  • SDK: HarmonyOS SDK
  • API: HarmonyOS Next API

ArkUI Basics

Components

// Basic component
@Entry
@Component
struct Index {
  @State message: string = 'Hello World'

  build() {
    Column() {
      Text(this.message)
        .fontSize(50)
        .fontWeight(FontWeight.Bold)
    }
    .alignItems(HorizontalAlign.Center)
    .width('100%')
    .height('100%')
  }
}

State Management

// @State - Component internal state
@State count: number = 0

// @Prop - Parent component prop
@Prop message: string

// @Link - Two-way binding
@Link childCount: number

// @Observed + @ObjectLink - Deep observation
@Observed
class Person {
  name: string = ''
  age: number = 0
}

@ObjectLink person: Person

Lifecycle

// Component lifecycle
aboutToAppear() {}    // About to display
onDidBuild() {}       // Build complete
aboutToDisappear() {} // About to destroy

Common Components

  • Text - Text display
  • Image - Image display
  • Button - Interactive button
  • Column/Row - Layout containers
  • List - Scrollable list
  • Grid - Grid layout
  • Stack - Stacked layout
  • Swiper - Carousel
  • TabContent - Tab pages

Layouts

// Linear layout
Column() { }  // Vertical
Row() { }     // Horizontal

// Flex layout
Flex() { 
  direction: FlexDirection.Row 
}

// Grid layout
Grid() { 
  columnsTemplate: '1fr 1fr 1fr' 
}

// Stack
Stack() { }

Routing

import router from '@ohos.router'

// Navigate
router.pushUrl('pages/Detail')

// Go back
router.back()

// With params
router.pushUrl({
  url: 'pages/Detail',
  params: { id: 123 }
})

// Get params
const params = router.getParams()

Network Requests

import http from '@ohos.net.http'

let httpRequest = http.createHttp()
httpRequest.request(
  'https://api.example.com/data',
  {
    method: http.RequestMethod.GET,
    header: { 'Content-Type': 'application/json' }
  },
  (err, data) => {
    if (!err) {
      console.log(JSON.stringify(data.result))
    }
  }
)

Local Storage

import preferences from '@ohos.data.preferences'

// Write
let preferences = await preferences.getPreferences(context, 'myPrefs')
await preferences.put('username', 'tom')
await preferences.flush()

// Read
let value = await preferences.get('username', 'default')

Permissions

import abilityAccessCtrl from '@ohos.abilityAccessCtrl'

// Declare in module.json5
// "requestPermissions": [
//   { "name": "ohos.permission.INTERNET" }
// ]

// Request at runtime
let atManager = abilityAccessCtrl.createAtManager()
atManager.requestPermissionsFromUser(context, ['ohos.permission.INTERNET'])

Common Permissions

  • ohos.permission.INTERNET - Network access
  • ohos.permission.GET_NETWORK_INFO - Network status
  • ohos.permission.CAMERA - Camera access
  • ohos.permission.WRITE_MEDIA - Media write
  • ohos.permission.READ_MEDIA - Media read

Build & Signing

  1. DevEco Studio → Build → Build Hap
  2. Configure signing in Project Structure → Signing Configs
  3. Requires .p12 certificate and .cer public key
  4. Use debug signing for development, release for production

Quick Reference

NeedSolution
State management@State, @Prop, @Link, @Observed
ListsList + ListItem
Network@ohos.net.http
Storage@ohos.data.preferences
Routingrouter.pushUrl()
ToastpromptAction.showToast()
Dialogdialog.showDialog()

Learning Resources

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.

Coding

Dlazy One Click Generation

Short-video generation pipeline. Configure subject, script, TTS voiceover, BGM, and subtitle styling.

Registry SourceRecently Updated
Coding

Dlazy Video Generate

Video generation skill. Automatically selects the best dlazy CLI video model based on the prompt.

Registry SourceRecently Updated
Coding

Dlazy Audio Generate

Audio generation skill. Automatically selects the best dlazy CLI audio/TTS model based on the prompt. 音频生成技能。根据提示词自动选择最佳的 dlazy CLI 音频/TTS 模型。

Registry SourceRecently Updated
Coding

Dlazy Vidu Audio Clone

Clone voice and generate new text reading audio with one click using Vidu Audio Clone.

Registry SourceRecently Updated