What Makes HarmonyOS NEXT a Pure Cloud‑Native OS? Inside the Architecture and SDK
This article introduces HarmonyOS NEXT's pure, fast, and minimal design, its development base with DevEco Studio and ArkTS, the compilation artifacts (HAR, HSP, HAP), the system‑level open capability map, and the ARMS RUM SDK's architecture, session management, and three unobtrusive data‑collection schemes for performance monitoring.
Background
On October 22, 2024, Huawei released HarmonyOS NEXT (version 5.0.0, API 12). Unlike the previous dual‑framework HarmonyOS 3.1/4.0, NEXT completely abandons the Android Open Source Project and switches to a self‑developed kernel, becoming a truly "pure" HarmonyOS.
1. Three Keywords to Understand NEXT
Pure : zero AOSP code, unified kernel plus ArkTS syntax chain, fully removing Android compatibility baggage.
Fast : the Ark compiler translates code to machine code at compile time, greatly boosting runtime efficiency.
Minimal : one development, multi‑device deployment covering phone, tablet, wearables, car, and IoT scenarios.
2. Development Base Overview
IDE: DevEco Studio (JetBrains core) with visual multi‑device preview.
Language: ArkTS, built on TypeScript with stronger static typing and enhanced concurrency.
Compilation: source code is parsed by the front‑end compiler and compiled into Ark runtime bytecode, then packaged into the app. Traditional JS bundles require powerful devices, but HarmonyOS supports a wide range of devices, ensuring consistent experience across low‑end IoT to high‑end phones.
Compilation artifacts:
HAR (HarmonyOS Archive): intermediate format merged into HSP or HAP packages.
HSP (HarmonyOS Shared Package): enables runtime module sharing; only one copy exists when multiple HAPs depend on the same HSP.
HAP (HarmonyOS Ability Package): installable container that can run on multiple devices.
3. System‑Level Open Capability Map
Application framework: runtime, engine, and related open capabilities.
Application services: push, authentication, payment, and other core functions.
Media: storage, processing, and transmission of video, audio, and images.
Graphics: 2D/3D rendering, animation, and game‑related capabilities.
AI: machine learning, deep learning, NLP, computer vision, etc.
System: communication, security, drivers, DFX, diagnostics, and testing.
HarmonyOS SDK Architecture and Design
1. Overall SDK Architecture
Interface layer: exposed APIs for developers.
Feature layer: data‑collection modules (network, interaction, app, lag, crash, custom, WebView, page, etc.).
Core layer: basic services, utilities, logging, time, data protocol, session management, configuration management, OT extension.
Dependencies: Opentelemetry‑ts/js and pako for compression.
2. Session Management
A session spans from app launch to exit. The SDK creates a unique SessionID at launch, stores it globally, and attaches it to each event. When the app is killed or backgrounded for more than 60 seconds, a new session starts.
3. Data Collection Design
Three unobtrusive collection schemes are employed.
Scheme 1: System‑level API (HiAppEvent)
Leverages the Performance Analysis Kit’s HiAppEvent to subscribe to system events such as exceptions, lags, and startup times. For crash events, HiAppEvent captures NativeCrash and JsError, then the SDK processes the reported parameters and uploads the data.
Scheme 2: UI Component Lifecycle Listening
Listens to component lifecycle events. For example, the NavDestination component provides on(type: 'navDestinationSwitch', callback: Callback): void to monitor page switches; the difference between onShown and onHidden timestamps yields page stay duration.
Scheme 3: AOP‑based Compile‑time Injection
For events lacking system hooks, the SDK uses AOP via the Hvigorw plugin (inspired by HuolalaTech/AspectPro) to instrument code at compile time. For instance, the ohos.net.http request creation is intercepted to record network success/failure metrics and generate Network spans.
In summary, HarmonyOS NEXT serves as a native neural system for the era of ubiquitous intelligence, and Alibaba Cloud ARMS RUM SDK provides an industry‑leading full‑link monitoring solution for HarmonyOS applications.
Alibaba Cloud Observability
Driving continuous progress in observability technology!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
