harmony 鸿蒙Overview of ArkTS Common Library

  • 2023-10-30
  • 浏览 (499)

Overview of ArkTS Common Library

The ArkTS common library provides common basic capabilities, as illustrated in the figure below.

Figure 1 Capabilities of the ArkTS common library

arkts-commonlibrary

  • Supporting asynchronous concurrency and multithread concurrency

    • Supports standard JavaScript asynchronous concurrency capabilities such as Promise and async/await.
    • Uses TaskPool to provide a multithread running environment for applications. The use of TaskPool helps reduce resource consumption and improve system performance. It also frees you from caring about the lifecycle of thread instances.
    • Uses Worker to support multithread concurrency. The worker thread can communicate with the host thread. You need to proactively create and close a worker thread.
  • Providing common capabilities of adding, deleting, modifying, and querying elements in containers

  • Constructing and parsing XML files, URLs, and URIs

    • Extensible Markup Language (XML) is designed for data transmission and storage. The common library provides APIs for XML generation, parsing, and conversion.
    • URI is a uniform resource identifier that uniquely identifies a resource. URL is a uniform resource locator that provides a path for locating a resource.
  • Supporting common string and binary data processing and logging

    • Provides APIs to encode and decode strings.
    • Provides APIs to encode and decode Base64-encoded bytes.
    • Supports common rational number operations, including comparing rational numbers and obtaining numerators and denominators.
    • Provides Scope APIs to define the valid range of a field.
    • Provides APIs to process binary data in scenarios such as TCP flows or file system operations.
    • Supports logging using the console.
  • Providing the capability of obtaining process information and operating processes

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkTS Common Library

harmony 鸿蒙Comparison Between the Actor and Memory Sharing Models

harmony 鸿蒙Asynchronous Concurrency Overview

harmony 鸿蒙Concurrency Overview

harmony 鸿蒙Overview of Containers

harmony 鸿蒙CPU Intensive Task Development

harmony 鸿蒙I/O Intensive Task Development

harmony 鸿蒙Linear Containers

harmony 鸿蒙Multithread Concurrency Overview

harmony 鸿蒙Nonlinear Containers

0  赞