目录

Atomic Service API Description

What Are Atomic Service APIs?

Since HarmonyOS NEXT Developer Preview1 (corresponding to API version 11), atomic services can be developed only using atomic service APIs.

The atomic service APIs are a subset of HarmonyOS SDK APIs. Their API capabilities are derived from kits to support efficient development of atomic services.

This document describes how to use the atomic service APIs for development. Before development, you need to understand the following features:

  1. Only the stage model is supported.
  2. Only ArkTS APIs are supported.
  3. Similar to applications, atomic services support two API import modes. You can select either of them.
    • Import by kit. Example:
      import { authentication } from '@kit.AccountKit';
    • Import by module. Example:
      import authentication from '@hms.core.authentication';
  4. SO libraries are not supported.
  5. Only third-party libraries developed using atomic service APIs are supported. Failure to meet this requirement will result in a failed release review.

Since HarmonyOS NEXT Developer Preview1 (corresponding to API version 11), atomic services developed using the HarmonyOS SDK can run only on devices of HarmonyOS NEXT Developer Preview1 or later.

How Do I Find Atomic Service APIs?

The atomic service APIs are a subset of HarmonyOS SDK APIs. When you select Atomic Service as your development template in DevEco Studio, the atomic service APIs are automatically filtered.

To view the reference document for the atomic service APIs, proceed as follows:

  1. Click API Reference to open the API reference document of the HarmonyOS SDK.
  2. Under Advanced filters in the navigation tree on the left, choose Filter by this from the drop-down list of Atomic service APIs to check the APIs that support atomic services.

    As shown in the following figure, API nodes supporting atomic services are properly displayed, whereas those not supporting are dimmed.

    In addition, you are advised to select Show only matching results.

  3. In the content directory of a normally displayed page, API nodes supporting atomic services are properly displayed, whereas those not supporting are dimmed.

    In addition, every API that supports atomic services is marked with the Atomic service API tag, which is in the following format:

    Atomic service API: This API can be used in atomic services since API version x.

    Example:

Viewing API References

Now you can go to HarmonyOS SDK API Reference to obtain the atomic service APIs.