Implementing Asynchronous Operations in OpenHarmony NAPI with Callbacks and Promises
This article builds upon the foundation of porting third-party libraries to OpenHarmony NAPI. We'll modify the hellonapi.cpp and index.ets files to explore asynchronous operations using Promises and Callbacks within the NAPI framework. This guide includes three examples: a Callback-based asynchronous interface, a Promise-based asynchronous inte ...
Posted on Sun, 20 Sep 2026 16:19:52 +0000 by scliburn
Data Type Conversion Between C/C++ and JavaScript in NAPI Framework
NAPI Data Type Convresion Overview
OpenHarmony NAPI encapsulates ECMAScript standard data types including Boolean, Null, Undefined, Number, BigInt, String, Symbol, Object, and Function into the unified napi_value type. This type handles data exchange between ArkUI applications and native code.
This implementation demonstrates a synchronous Add( ...
Posted on Mon, 14 Sep 2026 16:52:30 +0000 by wiggly81
Integrating the yxml Library into OpenHarmony via Makefile Build System
Source AcquisitionObtain the source code for the yxml library from the project repository. The primary directory consists of the core source files, benchmarking utilities, and the original build scripts. The key files for integration are the main implementation file (yxml.c), the header file (yxml.h), and the build definition file (Makefile).To ...
Posted on Sun, 13 Sep 2026 16:39:47 +0000 by keyurshah
Understanding OpenHarmony's Media Subsystem Architecture
Source Code Organization
This discussion is based on OpenHarmony 3.2 Release source code from the player_framework module under the foundation directory. The source repository structure consists of two primary sections:
The frameworks directory contains two key components: a JavaScript/ArkTS binding layer (napi) that bridges application code wi ...
Posted on Sun, 23 Aug 2026 16:13:41 +0000 by jiehuang001
Docker Porting Guide for OpenHarmony Systems
Docker Overview
Virtualization technology has evolved significantly since the inception of operating systems. In the context of cloud-native computing, containers play a critical role in modern deployment architectures.
Docker is an open-source project that provides an additional abstraction layer on Linux operating systems, enabling users to d ...
Posted on Tue, 16 Jun 2026 16:45:43 +0000 by Okami
Exporting C++ Class Objects via Node-API and Managing Their Lifecycle
Sample Project Source Code Analysis
The sample project uses a Native C++ template with the Stage model. This analysis focuses on key implementation files for class object export and lifecycle management.
Class Definition and Method Implementation
NapiTest.h Header File
#ifndef __NAPI_TEST_H__
#define __NAPI_TEST_H__
#include "napi/native_ ...
Posted on Thu, 11 Jun 2026 18:28:49 +0000 by itworks
Building a Robust Instant Messaging System on OpenHarmony
Implementation Overveiw
Instant messaging enables real-time exchange of text, multimedia, and documents between multiple devices. This implementation targets the OpenHarmony ecosystem, utilizing a client-server architecture deployed on hardware such as the DAYU200 RK3568 board running OpenHarmony 3.1.
Core Architecture
Successful inter-device c ...
Posted on Tue, 26 May 2026 19:00:46 +0000 by eves
OpenHarmony Application Launch Mechanism and Runtime Initialization
This article examines the application launch sequence in OpenHarmony based on its source code, detailing the initialization procedures of key components such as process_spawner/ability_runtime/ui_engine/ets_runtime and their interconnections.
While different types of HAP applications may have specific variations, the overall launch flow remai ...
Posted on Fri, 22 May 2026 22:27:00 +0000 by anwoke8204
Implementing OpenHarmony HDF Platform Drivers for SoC Porting
Drivers in OpenHarmony are categorized into platform drivers and device drivers. Platform drivers handle on-SoC peripherals such as GPIO, I2C, and SPI controllers. Device drivers manage external components like LCD displays, touch panels, and WLAN modules connected to the SoC.The HDF (Hardware Driver Foundation) framework enables cross-operatin ...
Posted on Mon, 18 May 2026 23:35:21 +0000 by alwaysinit
Porting the OpenHarmony Kernel to a New Hardware Architecture
Porting the Processor Architecture
The foundation of kernel porting lies in adapting the processor architecture. In OpenHarmony, this step is optional—only required if the target architecture is not already supported. The list of currrently supported architectures can be found under liteos_m/arch. Refer to Table 1 for an overview.
Table 1: Supp ...
Posted on Thu, 14 May 2026 06:44:51 +0000 by jokerofsouls