Implementing XML Parsing in ArkTS for HarmonyOS Applications

The ArkTS framework in HarmonyOS provides robust XML processing capabilities through its @ohos.xml module. This guide demonstrates practical implementation techniques using the XmlPullParser class with updated coding patterns. Attribute Extraction Workflow Initialize the parser with properly encoded XML data to hendle international character se ...

Posted on Wed, 04 Nov 2026 16:23:15 +0000 by The-Last-Escape

Building a Media Controller with Custom AVSession Communication in HarmonyOS

Media controller implementation leverages AVSession APIs to facilitate bidirectional communication with a media provider. The capabilities demonstrated here require a companion provider implementation for complete custom data flow, and controller interfaces are restricted to system-level applications. Project Structure entry/src/main/ets/ |---u ...

Posted on Sat, 31 Oct 2026 16:44:00 +0000 by kaje

Implementing Event Publishing and Subscription with Emitter and Custom Dialogs in HarmonyOS

Overview This sample demnostrates how to implement event-driven communication using HarmonyOS Emitter and how to create custom dialogs for displaying advertisement information. Preview The application showcases an e-commerce flow with the following functionality: Usage Instructions An advertisement dialog appears on app launch and can be dismi ...

Posted on Fri, 23 Oct 2026 16:53:56 +0000 by lapith

Achieving Pixel-Perfect UI Scaling in HarmonyOS ArkUI Using Manual Ratio Calculation

ArkUI provides four pixel units, with vp acting similarly to Android's dp and fp matching sp. This article demonstrates an alternative approach: calculating layout dimensions directly from raw pixel ratios to fit設計稿 specifications across all devices. First, obtain the physical screen width and height via the display API: import { display } f ...

Posted on Thu, 15 Oct 2026 16:08:47 +0000 by brash

HarmonyOS ArkTS UI Development Fundamentals

ArkTS is the primary language for building user interfaces on HarmonyOS, powered by the ArkUI declarative framework. This guide covers essential UI construction patterns, component composition, state management, layout systems, and advanced interaction techniques. Custom Component Architecture Components in ArkTS are defined using structural de ...

Posted on Wed, 14 Oct 2026 16:51:52 +0000 by joelg

Implementing Tabbed Interfaces with ArkUI in HarmonyOS

The ArkUI framework in HarmonyOS provides a versatile Tabs component for creating tabbed user interfaces. This component allows for organized presentation of content, with features such as active state indication, custom tab content, and performance optimization through lazy loading of inactive panels. Basic Layout The fundamental structure of ...

Posted on Sun, 11 Oct 2026 16:52:06 +0000 by lynxus

Implementing Audio and Video Recording in HarmonyOS Applications

Overview This technical guide demonstrates audio and video recording capabilities in HarmonyOS applications using the @ohos.multimedia.audio framework. The implemantation covers device switching, audio focus management, audio effects configuration, and various recording modes. Functionality Overview The application provides several audio-relate ...

Posted on Wed, 07 Oct 2026 16:50:21 +0000 by luminous

Implementing Spring Curve Animations in HarmonyOS ArkUI

Spring curve animations allow developers to create oscillating effects that exceed the target value before settling down, resulting in more natural and playful animations compared to standard easing curves. HarmonyOS ArkUI provides preset animation curves such as Linear, Ease, and EaseIn, but the spring curves generated from spring oscillator p ...

Posted on Mon, 05 Oct 2026 16:44:21 +0000 by kenwvs

TypeScript Fundamentals for HarmonyOS Development

TypeScript Language Overview TypeScript is a statically typed superset of JavaScript that compiles to plain JavaScript. It adds optional types, classes, and modules to JavaScript, helping catch errors early through static type checikng and making code more maintainable. In the HarmonyOS ecosystem, ArkTS builds upon TypeScript by extending it wi ...

Posted on Mon, 28 Sep 2026 16:34:54 +0000 by ohjay

Building a Custom Verification Code Input Component in HarmonyOS ArkUI

Challenges with Multiple TextInput Components Initial Focus: The system does not automatically determine which input field should receive focus upon initialization. This can be partially resolved by adding .defaultFocus(index == 0) to the first input. Deletion Handling: The onChange event often fails to trigger when a user deletes characters ( ...

Posted on Mon, 28 Sep 2026 16:18:14 +0000 by youknowho