Implementing Real-Time Clock Interfaces in HarmonyOS Hardware Drivers

Core Functionality The Real-Time Clock (RTC) module serves as the temporal backbone for embedded operating systems. It maintains accurate system time and supports scheduled alarm events. Leveraging an external backup power source, the RTC preserves timekeeping operations during system shutdowns. Upon power restoration, it synchronizes the OS cl ...

Posted on Sun, 20 Sep 2026 16:06:53 +0000 by jevman

HarmonyOS WebView Component: Navigation Control and History Management

WebView Navigation and History Tracking in HarmonyOS Web navigation enables users to move between different pages within a WebView component. This functionality enocmpasses history traverasl, programmatic page transitions, and cross-application linking. The following sections demonstrate implementation patterns using HarmonyOS ArkUI TypeScript ...

Posted on Thu, 17 Sep 2026 16:47:42 +0000 by Xyphon

HarmonyOS Development with ArkUI Components - Media Query Implementation

1. Import Required Modules import mediaquery from '@ohos.mediaquery'; 2. Setting Up Media Query Conditions Use the matchMediaSync interface to define media query conditions and store the returned listener handle. For example, to monitor landscape orientation changes: const orientationListener = mediaquery.matchMediaSync('(orientation: landscap ...

Posted on Thu, 17 Sep 2026 16:12:09 +0000 by Asperon

HarmonyOS Next UI Framework: JavaScript Syntax Reference

JavaScript Syntax JavaScript (JS) files are used to define the business logic for HML pages, supporting the ECMA JavaScript language standard. Leveraging JavaScript's dynamic capabilities allows applications to be more expressive and flexible in design. This section details the supported compilation and runtime features for JS files. Supported ...

Posted on Tue, 15 Sep 2026 16:30:15 +0000 by vitorjamil

Mastering HarmonyOS Architecture and Development Environment Configuration

System Architecture Overview Analyzing the underlying structure reveals that both HarmonyOS and Android rely on the Linux kernel. Divergence occurs at the Hardware Abstraction Layer (HAL), where the systems split. As the platform matures, the components unique to HarmonyOS are designed to replace legacy Android modules entirely. Adopting this e ...

Posted on Thu, 03 Sep 2026 16:38:34 +0000 by LordShryku

HarmonyOS State Management with ArkTS: Component and Application-Level Patterns

@State Decorator The @State decorator is used to declare a state variable in a component. When the state variable changes, the component automatically re-renders. Assigning Values to Class Properties In HarmonyOS with ArkTS, you can assign values to class properties within components. Here's an example: @Component struct MyComponent { @State ...

Posted on Thu, 03 Sep 2026 16:28:07 +0000 by benyboi

Calling ArkTS Functions from Non-ArkTS Threads in HarmonyOS

Module Registration First, we need to register the native module. This is done in the queue_work.cpp file: // queue_work.cpp EXTERN_C_START static napi_value Init(napi_env env, napi_value exports) { napi_property_descriptor desc[] = { { "queueWork", nullptr, QueueWork, nullptr, nullptr, nullptr, napi_default, nullptr } ...

Posted on Fri, 21 Aug 2026 16:48:40 +0000 by Tonsil

Responsive Design with HarmonyOS ArkUI Media Queries

Media queries enable dynamic UI adjustments based on device attributes like screen dimensions, resolution, orientation, and color depth. They form the foundation of responsive application design, ensuring consistent and optimal user experiences across diverse hardware. Typical use cases include adaptive layouts, typography scaling, conditional ...

Posted on Tue, 04 Aug 2026 16:41:01 +0000 by unbreakable9

HarmonyOS N-API Module Loading in Main Thread

Module Loading Overview The Node-API napi_load_module intreface enables module loading in the main thread. After loading, developers can retrieve exported properties using napi_get_property or access functions via napi_get_named_property. Supported scenarios include: Loading system modules (e.g., @ohos.hilog) Loading modules from ArkTS files ...

Posted on Fri, 31 Jul 2026 16:08:29 +0000 by himnbandit

Working with XML in HarmonyOS ArkTS: Structure Definition and Processing

An XML element consists of three main parts: Tag: Marks the begining and end of an element Attributes: Provide additional information about the element Content: The data contained within the element Element Structure Example <book category="fiction"> <title>XML Fundamentals</title> <author>Jane Smith</ ...

Posted on Fri, 24 Jul 2026 16:39:15 +0000 by bagsobrands