diff --git a/CODEOWNERS b/CODEOWNERS
index 5b847d685a149d302ba349ea93f6329c32d1cd12..a98eba13b7b574232201efd76d84579561a42ccd 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -23,11 +23,17 @@ zh-cn/device-dev/quick-start/ @li-yan339
zh-cn/device-dev/driver/ @li-yan339
zh-cn/device-dev/get-code/ @li-yan339
zh-cn/device-dev/hpm-part/ @duangavin123_admin
-zh-cn/device-dev/subsystems/subsys-build-mini-lite.md @Austin23
-zh-cn/device-dev/subsystems/subsys-build-standard-large.md @Austin23
-zh-cn/device-dev/subsystems/subsys-build-gn-coding-style-and-best-practice.md @Austin23
-zh-cn/device-dev/subsystems/subsys-build-gn-kconfig-visual-config-guid.md @Austin23
-zh-cn/device-dev/subsystems/subsys-build-gn-hap-compilation-guide.md @Austin23
+zh-cn/device-dev/reference/hdi-apis/ @li-yan339
+zh-cn/device-dev/quick-start/quickstart-standard-env-setup.md @li-yan339 @chenmudan
+zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md @li-yan339 @chenmudan
+zh-cn/device-dev/porting/porting-thirdparty-overview.md @Austin23 @chenmudan
+zh-cn/device-dev/porting/porting-thirdparty-makefile.md @Austin23 @chenmudan
+zh-cn/device-dev/porting/porting-thirdparty-cmake.md @Austin23 @chenmudan
+zh-cn/device-dev/subsystems/subsys-build-mini-lite.md @Austin23 @chenmudan
+zh-cn/device-dev/subsystems/subsys-build-standard-large.md @Austin23 @chenmudan
+zh-cn/device-dev/subsystems/subsys-build-gn-coding-style-and-best-practice.md @Austin23 @chenmudan
+zh-cn/device-dev/subsystems/subsys-build-gn-kconfig-visual-config-guid.md @Austin23 @chenmudan
+zh-cn/device-dev/subsystems/subsys-build-gn-hap-compilation-guide.md @Austin23 @chenmudan
zh-cn/device-dev/subsystems/subsys-remote-start.md @duangavin123_admin
zh-cn/device-dev/subsystems/subsys-graphics-overview.md @duangavin123_admin
zh-cn/device-dev/subsystems/subsys-graphics-container-guide.md @duangavin123_admin
@@ -45,7 +51,7 @@ zh-cn/device-dev/subsystems/subsys-utils-overview.md @Austin23
zh-cn/device-dev/subsystems/subsys-utils-guide.md @Austin23
zh-cn/device-dev/subsystems/subsys-utils-faqs.md @Austin23
zh-cn/device-dev/subsystems/subsys-aiframework-guide.md @Austin23
-zh-cn/device-dev/subsystems/subsys-aiframework-envbuild.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-envbuild.md @Austin23
zh-cn/device-dev/subsystems/subsys-aiframework-tech-codemanage.md @Austin23
zh-cn/device-dev/subsystems/subsys-aiframework-tech-name.md @Austin23
zh-cn/device-dev/subsystems/subsys-aiframework-tech-interface.md @Austin23
@@ -79,14 +85,19 @@ zh-cn/device-dev/subsystems/subsys-security-sigverify.md @duangavin123_admin
zh-cn/device-dev/subsystems/subsys-security-rightmanagement.md @duangavin123_admin
zh-cn/device-dev/subsystems/subsys-security-communicationverify.md @duangavin123_admin
zh-cn/device-dev/subsystems/subsys-security-devicesecuritylevel.md @duangavin123_admin
-zh-cn/device-dev/subsystems/subsys-boot-overview.md @Austin23
-zh-cn/device-dev/subsystems/subsys-boot-init.md @Austin23
zh-cn/device-dev/subsystems/subsys-boot-appspawn.md @Austin23
-zh-cn/device-dev/subsystems/subsys-boot-appspawn-standard.md @Austin23
zh-cn/device-dev/subsystems/subsys-boot-bootstrap.md @Austin23
-zh-cn/device-dev/subsystems/subsys-boot-syspara.md @Austin23
zh-cn/device-dev/subsystems/subsys-boot-faqs.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init-cfg.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init-jobs.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init-plugin.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init-sandbox.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init-service.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init-sysparam.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-overview.md @Austin23
zh-cn/device-dev/subsystems/subsys-boot-ref.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot.md @Austin23
zh-cn/device-dev/subsystems/subsys-testguide-test.md @Austin23
zh-cn/device-dev/subsystems/subsys-dfx-overview.md @duangavin123_admin
zh-cn/device-dev/subsystems/subsys-dfx-hilog-rich.md @duangavin123_admin
diff --git a/README_zh.md b/README_zh.md
index 3c65434aac3acaee899db2e1eba85e61c03de5a5..ebf1bc8d7557d35f99eaacf8fd1427972d61d3b0 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -18,7 +18,7 @@
- master:最新开发版本。
- - OpenHarmony 3.2 Beta1版本:点击[此处](zh-cn/release-notes/OpenHarmony-v3.2-beta1.md)了解版本详情。
+ - OpenHarmony 3.2 Beta2版本:点击[此处](zh-cn/release-notes/OpenHarmony-v3.2-beta2.md)了解版本详情。
- OpenHarmony 3.1 Release版本:点击[此处](zh-cn/release-notes/OpenHarmony-v3.1-release.md)了解版本详情。
diff --git a/en/OpenHarmony-Overview.md b/en/OpenHarmony-Overview.md
index c9eff6c8fe752a73cc4b8a2837ffe2a8ee7c0f0f..1331ac52206cf1980ce59a7def62bfd32c27e406 100644
--- a/en/OpenHarmony-Overview.md
+++ b/en/OpenHarmony-Overview.md
@@ -1,202 +1,205 @@
# OpenHarmony Project
-## Introduction
+## Introduction
-OpenHarmony is an open-source project incubated and operated by the OpenAtom Foundation. It is an open-source operating system with a framework and platform applicable to smart devices in all scenarios of a fully-connected world. It aims to promote the development of the Internet of Everything (IoE).
+OpenHarmony is an open-source project incubated and operated by the OpenAtom Foundation. The purpose of this project is to build an open-source, distributed operating system (OS) framework for smart devices in all scenarios of a fully-connected world.
-## Technical Architecture
+## Technical Architecture
-OpenHarmony is designed with a layered architecture, which from bottom to top, consists of the kernel layer, system service layer, framework layer, and application layer. System functions are expanded by levels, from system to subsystem, and further to module. In a multi-device deployment scenario, unnecessary modules can be excluded from the system as required. The following figure shows the technical architecture of OpenHarmony.
+OpenHarmony is designed with a layered architecture, which consists of the kernel layer, system service layer, framework layer, and application layer from the bottom up. System functions are expanded by levels, from system to subsystem, and further to component. In a multi-device deployment scenario, unnecessary components can be excluded from the system as required. The following figure shows the technical architecture of OpenHarmony.

**Kernel layer**
-- Kernel subsystem: OpenHarmony uses a multi-kernel design \(Linux or LiteOS\) so that different kernels can be selected for devices with different resource limitations. The kernel abstraction layer \(KAL\) hides differences in kernel implementations and provides the upper layer with basic kernel capabilities, including process and thread management, memory management, file system, network management, and peripheral management.
+- Kernel subsystem: OpenHarmony uses a multi-kernel design (Linux or LiteOS) so that different kernels can be selected for devices with different resource limitations. The kernel abstraction layer (KAL) hides differences in kernel implementations and provides the upper layer with basic kernel capabilities, including process and thread management, memory management, file system, network management, and peripheral management.
-- Driver subsystem: Hardware Driver Foundation \(HDF\) lays the foundation for an open OpenHarmony hardware ecosystem. It allows for unified access from peripheral devices and provides foundation for driver development and management.
+- Driver subsystem: Hardware Driver Foundation (HDF) lays the foundation for an open OpenHarmony hardware ecosystem. It allows for unified access from peripheral devices and provides foundation for driver development and management.
**System service layer**
-The system service layer provides a complete set of capabilities essential for OpenHarmony to offer services for apps through the framework layer. This layer consists of the following parts:
+The system service layer provides a complete set of capabilities essential for OpenHarmony to offer services for applications through the framework layer. This layer consists of the following parts:
-- Basic system capability subsystem set: Implements distributed app running, scheduling, and migration across OpenHarmony devices. This subsystem set provides the following basic capabilities: Distributed Soft Bus (DSoftBus), distributed data management, Distributed Scheduler, Utils, multimodal input, graphics, security, and AI.
+- Basic system capability subsystem set: Implements distributed application running, scheduling, and migration across OpenHarmony devices. This subsystem set provides the following basic capabilities: Distributed Soft Bus (DSoftBus), distributed data management, Distributed Scheduler, Utils, multimodal input, graphics, security, and AI.
-- Basic software service subsystem set: Provides OpenHarmony with common universal software services, including common event and notification, telephony, multimedia, and Design For X \(DFX\).
+- Basic software service subsystem set: Provides OpenHarmony with common universal software services, including common event and notification, telephony, multimedia, and Design For X (DFX).
-- Enhanced software service subsystem set: Provides OpenHarmony with differentiated enhanced software services, including those dedicated to smart TVs, wearables, IoT devices, and more.
+- Enhanced software service subsystem set: Provides OpenHarmony with differentiated enhanced software services, including those dedicated to smart TVs, wearables, IoT devices, and more.
-- Hardware service subsystem set: Provides OpenHarmony with hardware services, including location, IAM, as well as those dedicated to wearables and IoT devices.
+- Hardware service subsystem set: Provides OpenHarmony with hardware services, including location, user IAM, as well as those dedicated to wearables and IoT devices.
-The basic software service, enhanced software service, and hardware service subsystem sets can be modified by the subsystems, and each subsystem can be modified by various functions, depending on the deployment scenario for a particular device form.
+The basic software service, enhanced software service, and hardware service subsystem sets can be tailored by subsystems, and each subsystem can be tailored by functions, depending on the deployment scenario for a particular device form.
**Framework layer**
-This layer provides with what you need to develop OpenHarmony apps: application framework and ability framework, specific to multiple languages \(like C, C++, and JS\), ArkUI framework, as well as multi-language APIs for hardware and software services. The APIs designed for different OpenHarmony devices can be modified based on various system components.
+This layer provides with what you need to develop OpenHarmony applications: application framework and ability framework specific to multiple languages (like C, C++, and JS), JS-specific ArkUI framework, as well as multi-language APIs for hardware and software services. The APIs designed for different OpenHarmony devices vary according to the components in use.
**Application layer**
-This layer consists of system apps and third-party apps. Each OpenHarmony app is powered by one or more Feature Abilities \(FAs\) or Particle Abilities \(PAs\). An FA provides a UI for user interaction. A PA has no UI and provides background task processing as well as data access. Apps developed based on FAs and PAs provide specific service characteristics and enable cross-device scheduling and distribution, delighting users with consistent and efficient experience.
+This layer consists of system applications and third-party applications. Each OpenHarmony application is powered by one or more Feature Abilities (FAs) or Particle Abilities (PAs). An FA provides a UI for user interaction. A PA has no UI and provides background task processing as well as data access. Applications developed based on FAs and PAs provide specific service characteristics and enable cross-device scheduling and distribution, delighting users with consistent and efficient experience.
-## Technical Features
+## Technical Features
**Hardware collaboration and resource sharing**
This feature is implemented through the following modules:
-- DSoftBus
+- DSoftBus
- DSoftBus is a unified base for seamless interconnection among devices. It powers OpenHarmony with distributed communication capabilities to quickly discover and connect devices, and efficiently transmit data.
+ DSoftBus is a unified base for seamless interconnection among devices. It powers OpenHarmony with distributed communication capabilities to quickly discover and connect devices, and efficiently transmit data.
-- Distributed data management
-
- DSoftBus manages apps and user data distributed across different devices. Under such management, user data is no longer bound to a single physical device, and service logic is decoupled from storage. As your apps are running across devices, their data is seamlessly transmitted from one device to another, creating a foundation for a user experience that is smooth and consistent.
-- Distributed Scheduler
-
- The Distributed Scheduler is designed based on technical features such as DSoftBus, distributed data management, and distributed profile. It builds a unified distributed service management mechanism \(including service discovery, synchronization, registration, and invocation\), and supports remote startup, remote invocation, binding/unbinding, and migration of apps across devices. This way, your app can select the most suitable device to perform distributed tasks based on the capabilities, locations, running status, and resource usage of different devices, as well as user habits and intentions.
+- Distributed data management
+
+ Distributed data management leverages DSoftBus to manage application data and user data distributed on different devices. Under such management, user data is no longer bound to a single physical device, and service logic is decoupled from storage. As your applications are running across devices, their data is seamlessly transmitted from one device to another, creating a foundation for a user experience that is smooth and consistent.
-- Device virtualization
-
- A distributed device virtualization platform enables cross-device resource convergence, device management, and data processing so that virtual peripherals can function as capability extensions of smartphones to form a super virtual terminal.
+
+- Distributed Scheduler
+
+ Distributed Scheduler is designed based on technical features such as DSoftBus, distributed data management, and distributed profile. It builds a unified distributed service management mechanism (including service discovery, synchronization, registration, and invocation), and supports remote startup, remote invocation, binding/unbinding, and migration of applications across devices. This way, your application can select the most suitable device to perform distributed tasks based on the capabilities, locations, running status, and resource usage of different devices, as well as user habits and intentions.
+
+
+- Device virtualization
+
+ A distributed device virtualization platform enables cross-device resource convergence, device management, and data processing so that virtual peripherals can function as capability extensions of smartphones to form a Super Device.
**One-time development for multi-device deployment**
-OpenHarmony provides you with the user application, ability, and UI frameworks. With these frameworks, you can develop your apps once, and then flexibly deploy them across a broad range of different devices.
+OpenHarmony provides you with the application, ability, and UI frameworks. With these frameworks, you can develop your applications once, and then flexibly deploy them across a broad range of different devices. One-time development for multi-device deployment
-Consistent APIs ensure the operational compatibility of apps across devices.
+Consistent APIs ensure the operational compatibility of applications across devices.
-- Adaptation of device capabilities \(including CPU, memory, peripheral, and software resources\) can be previewed.
-- Resources can be scheduled based on the compatibility between user apps and the software platform.
+- Adaptation of device capabilities (including CPU, memory, peripheral, and software resources) can be previewed.
+- Resources can be scheduled based on the compatibility between applications and the software platform.
**A unified OS for flexible deployment**
OpenHarmony enables hardware resources to be scaled with its component-based and small-scale designs. It can be deployed on demand for a diverse range of devices, including ARM, RISC-V, and x86 architectures, and providing RAM volumes ranging from hundreds of KiB to GiB.
-## OS Types
+## System Types
-OpenHarmony supports the following types:
+OpenHarmony supports the following system types:
-- Mini system
+- Mini system
- A mini system runs on the devices whose memory is greater than or equal to 128 KiB and that are equipped with MCU processors such as Arm Cortex-M and 32-bit RISC-V. This system provides multiple lightweight network protocols and graphics frameworks, and a wide range of read/write components for the IoT bus. Typical products include connection modules, sensors, and wearables for smart home.
+ A mini system fits into devices that come with Micro Controller Units (MCUs), such as Arm Cortex-M and 32-bit RISC-V processors, and memory greater than or equal to 128 KiB. This system provides multiple lightweight network protocols, a lightweight graphics framework, and a wide range of read/write components with the IoT bus. Typical products include connection modules, sensors, and wearables for smart home.
-- Small system
+- Small system
- A small system runs on the devices whose memory is greater than or equal to 1 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides higher security capabilities, standard graphics frameworks, and video encoding and decoding capabilities. Typical products include smart home IP cameras, electronic cat eyes, routers, and event data recorders \(EDRs\) for smart travel.
+ A small system runs on devices whose memory is greater than or equal to 1 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides higher security capabilities, standard graphics frameworks, and video encoding and decoding capabilities. Typical products include smart home IP cameras, electronic cat eyes, and routers, and event data recorders (EDRs) for easy travel.
-- Standard system
+- Standard system
- A standard system runs on the devices whose memory is greater than or equal to 128 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides a complete application framework supporting the enhanced interaction, 3D GPU, hardware composer, diverse components, and rich animations. This system applies to high-end refrigerator displays.
+ A standard system runs on devices whose memory is greater than or equal to 128 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides a complete application framework supporting the enhanced interaction, 3D GPU, hardware composer, diverse components, and rich animations. This system applies to high-end refrigerator displays.
-## Subsystems
+## Subsystems
You need to understand the following basic concepts related to OpenHarmony:
-- Subsystem
+- Subsystem
- OpenHarmony is designed with a layered architecture, which from bottom to top consists of the kernel layer, system service layer, framework layer, and application layer. System functions are expanded by levels, from system to subsystem, and further to module. In a multi-device deployment scenario, unnecessary modules can be excluded from the system as required. A subsystem is a logical concept and is a flexible combination of functions.
+ OpenHarmony is designed with a layered architecture, which consists of the kernel layer, system service layer, framework layer, and application layer from the bottom up. System functions are expanded by levels, from system to subsystem, and further to component. In a multi-device deployment scenario, unnecessary components can be excluded from the system as required. A subsystem, as a logical concept, consists of the least required components.
-- Module
+- Components
- A module is a reusable software binary unit that contains source code, configuration files, resource files, and build scripts. A module can be built independently, integrated in binary mode, and then tested independently.
+ A component is a reusable software binary unit that contains source code, configuration files, resource files, and build scripts. A component can be built independently, integrated in binary mode, and then tested independently.
-The following table describes the subsystems of OpenHarmony. For details about the readme files of these subsystems, see [https://gitee.com/openharmony/docs/tree/master/en/readme](https://gitee.com/openharmony/docs/tree/master/en/readme).
+The following table describes the subsystems of OpenHarmony. For details about the readme files of these subsystems, see [https://gitee.com/openharmony/docs/tree/master/en/readme](https://gitee.com/openharmony/docs/tree/master/en/readme).
-| Subsystem| Description| Applicable To|
+
+| Subsystem | Description | Application Scope |
| -------- | -------- | -------- |
-| Kernel| Supports small-sized LiteOS kernels that provide high performance and low power consumption for embedded devices and devices with limited resources, and supports Linux kernels that are applicable to the standard system.| Small system Standard system |
-| Distributed File System | Provides APIs for synchronizing local JS files. | Standard system |
-| Graphics | Consists of user interface (UI) components, layout, animator, font, input event, window management, and rendering and drawing modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for Internet of Things (IoT) devices with limited hardware resources or on the standard OS to develop OpenHarmony applications for standard- and large-system devices (for example, tablet and lite smart devices). | All systems |
-| Driver | Constructed using the C object-oriented programming (OOP) language. It provides a unified driver platform and is compatible with different kernels by means of platform decoupling and kernel decoupling. This unified driver platform is designed to provide a more precise and efficient development environment, where you develop a driver that can be deployed on different systems supporting HDF. | All systems |
-| Power Management | Provides the following functions: restarting the system, managing running locks, managing and querying the system power status, querying and reporting the charging and battery status, and turning on/off the device screen, including adjusting the screen brightness. | Standard system |
-| Pan-sensor | Contains sensors and misc devices. A sensor is a device to detect events or changes in an environment and send messages about the events or changes to another electronic device. Misc devices, including vibrators and LED lights, are used to send signals externally. You can call APIs to control the vibration of vibrators and lighting-on and lighting-off of LED lights. | Small system |
-| Multimodal Input | OpenHarmony provides a Natural User Interface (NUI) for you to interact with your users. Unlike conventional categorization of input methods, OpenHarmony combines input methods of different dimensions into multimodal inputs, so you can easily arm your app with multi-dimensional, natural interaction features by using the application framework and system built-in UI components or APIs. Specifically, OpenHarmony currently supports traditional input methods such as key and touch inputs. | Standard system |
-| Startup | Starts the OS middle layer between the time the kernel is started and the time apps are started. In addition, you can query and modify system attributes and restore factory settings. | All systems |
-| Update | Supports over the air (OTA) update of OpenHarmony devices. | Standard system |
-| Account | Provides interconnection with vendors' cloud account apps on the device side, and query and update of the cloud account login status. | Standard system |
-| Compilation and Building | Provides a compilation and building framework based on Generate Ninja (GN) and Ninja. | All systems |
-| Test | The test-driven development mode is used during the development process. You can develop new cases or modify existing cases to test new or enhanced system features. The test helps you develop high-quality code in the development phase. | All systems |
-| Data Management | Provides local data management and distributed data management: - Local app data management for lightweight preference databases and relational databases - Distributed data service to provide apps with the capability to store data in the databases of different devices | Standard system |
-| Programming Language Runtime | Provides the compilation and execution environment for programs developed with JavaScript or C/C++, basic libraries that support the runtime, and the runtime-associated APIs, compilers, and auxiliary tools. | All systems |
-| Distributed Scheduler | Starts, registers, queries, and manages system services. | All systems |
-| JS UI framework | OpenHarmony UI development framework that supports web-development-like paradigm. | All systems |
-| Multimedia | Provides easy-to-use APIs for developing multimedia components such as audio, video, and camera, and enables apps to use multimedia resources of the system. | All systems |
-| Common Event and Notification | Provides the common event management capabilities that allow apps to subscribe to, unsubscribe from, publish, and receive common events (such as screen-on/off events and USB device attachment/detachment events). | Standard system |
-| Misc Services | Provides the function of setting the time. | Standard system |
-| Bundle management | Provides bundle installation, uninstall, update, and query capabilities. | All systems |
-| Telephony | Provides basic communication capabilities of the cellular network, such as SIM cards, network search, cellular data, cellular calls, SMS, and MMS, as well as easy-to-use APIs for you to manage multiple types of calls and data network connections. | Standard system |
-| Utils | Stores basic OpenHarmony components, which can be used by OpenHarmony subsystems and upper-layer apps. | All systems |
-| Development Tools | Provides a performance profiler platform for you to analyze system issues such as memory and performance, including hdc used for device debugging, APIs for performance tracing, and a performance profiler framework. | Standard system |
-| DSoftBus | Provides cross-process or cross-device communication capabilities for the OpenHarmony system and consists of the DSoftBus and IPC modules. The DSoftBus module enables distributed communication between near-field devices and provides device discovery, connection, networking, and data transmission functions, regardless of the communication mode. The IPC module enables communication between processes on a device or across devices. | All systems |
-| XTS | Provides a set of OpenHarmony compatibility test suites, including the currently supported application compatibility test suite (ACTS) and the device compatibility test suite (DCTS) that will be supported in the future. | All systems |
-| System Apps | Provides system apps that are applicable to the OpenHarmony standard system, such as Launcher, SystemUI, and Settings. It also provides specific examples for you to build standard-system apps, which can be installed on all devices running the standard system. | Standard system |
-| DFX | Provides non-functional capabilities of OpenHarmony. It provides a logging system, app and system event logging APIs, the event log subscription service, and fault information generation and collection capabilities. | All systems |
-| Globalization | If OpenHarmony devices and apps need to be used globally, they must meet the requirements of users in different regions on languages and cultures. The Globalization subsystem provides multi-language and multi-cultural capabilities for global use, including resource management and internationalization (i18n). | All systems |
-| Security | Provides system, data, and app security capabilities to protect system and user data of OpenHarmony. Its functions include app integrity verification, app permission management, device authentication, and key management. | All systems |
-
-## Supported Development Boards
-
-Currently, OpenHarmony supports the development boards listed in the following table.
-
-| System Type| Board Model| Chip Model| Function Description| Application Scenario| Code Repository and Daily Build|
+| Kernel | Supports small-sized LiteOS kernels that provide high performance and low power consumption for embedded devices and devices with limited resources, and supports Linux kernels that are applicable to the standard system.| Small System Standard System|
+| Distributed File System | Provides APIs for synchronizing local JS files. | Standard system |
+| Graphics | Consists of user interface (UI) components, layout, animator, font, input event, window management, and rendering modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for IoT devices with limited hardware resources or on the standard OS to develop OpenHarmony applications for standard- and large-system devices (for example, tablet and lite smart devices).| All systems |
+| Driver | Constructed using the C object-oriented programming (OOP) language. It provides a unified driver platform and is compatible with different kernels by means of platform decoupling and kernel decoupling. This unified driver platform is designed to provide a more precise and efficient development environment, where you develop a driver that can be deployed on different systems supporting HDF.| All systems |
+| Power Management | Provides the following functions: restarting the system, managing running locks, managing and querying the system power status, querying and reporting the charging and battery status, and turning on/off the device screen, including adjusting the screen brightness.| Standard system |
+| Pan-sensor | Contains sensors and misc devices. A sensor is a device to detect events or changes in an environment and send messages about the events or changes to another electronic device. Misc devices, including vibrators and LED lights, are used to send signals externally. You can call APIs to control the vibration of vibrators and lighting-on and lighting-off of LED lights.| Small system |
+| Multimodal Input | OpenHarmony provides a Natural User Interface (NUI) for you to interact with your users. Unlike conventional categorization of input methods, OpenHarmony combines input methods of different dimensions into multimodal inputs, so you can easily arm your application with multi-dimensional, natural interaction features by using the application framework and system built-in UI components or APIs. Specifically, OpenHarmony currently supports traditional input methods such as key and touch inputs.| Standard system |
+| Startup | Starts the OS middle layer between the time the kernel is started and the time applications are started. In addition, you can query and modify system attributes and restore factory settings.| All systems |
+| Update | Supports over the air (OTA) update of OpenHarmony devices. | Standard system |
+| Account | Provides interconnection with vendors' cloud account applications on the device side, and query and update of the cloud account login status.| Standard system |
+| Build | Provides a compilation and building framework based on Generate Ninja (GN) and Ninja. | All systems |
+| Test | The test-driven development mode is used during the development process. You can develop new cases or modify existing cases to test new or enhanced system features. The test helps you develop high-quality code in the development phase.| All systems |
+| Data Management | Provides local data management and distributed data management: - Local application data management for lightweight preference databases and relational databases - Distributed data service to provide applications with the capability to store data in the databases of different devices| Standard system |
+| Programming Language Runtime| Provides the compilation and execution environment for programs developed with JavaScript or C/C++, basic libraries that support the runtime, and the runtime-associated APIs, compilers, and auxiliary tools.| All systems |
+| Distributed Scheduler| Starts, registers, queries, and manages system services. | All systems |
+| JS UI Framework | OpenHarmony JS UI framework supports web-development-like paradigm. | All systems |
+| Multimedia | Provides easy-to-use APIs for developing multimedia components such as audio, video, and camera, and enables applications to use multimedia resources of the system.| All systems |
+| Common Event and Notification | Provides the common event management capabilities that allow applications to subscribe to, unsubscribe from, publish, and receive common events (such as screen-on/off events and USB device attachment/detachment events).| Standard system |
+| Misc Services | Provides the function of setting the time. | Standard system |
+| Bundle Management | Provides bundle installation, uninstall, update, and query capabilities. | All systems |
+| Telephony | Provides basic communication capabilities of the cellular network, such as SIM cards, network search, cellular data, cellular calls, SMS, and MMS, as well as easy-to-use APIs for you to manage multiple types of calls and data network connections.| Standard system |
+| Utils | Stores basic components of OpenHarmony, which can be used by OpenHarmony subsystems and upper-layer applications.| All systems |
+| Development Tools | Provides a performance profiler platform for you to analyze system issues such as memory and performance, including hdc used for device debugging, APIs for performance tracing, and a performance profiler framework.| Standard system |
+| DSoftBus | Provides cross-process or cross-device communication capabilities for the OpenHarmony system and consists of the DSoftBus and IPC modules. The DSoftBus module enables distributed communication between near-field devices and provides device discovery, connection, networking, and data transmission functions, regardless of the communication mode. The IPC module enables communication between processes on a device or across devices.| All systems |
+| XTS | Provides a set of OpenHarmony compatibility test suites, including the currently supported application compatibility test suite (ACTS) and the device compatibility test suite (DCTS) that will be supported in the future.| All systems |
+| System Apps | Provides system apps that are applicable to the OpenHarmony standard system, such as Home Screen, SystemUI, and Settings. It also provides specific examples for you to build standard-system applications, which can be installed on all devices running the standard system.| Standard system |
+| DFX | Provides non-functional capabilities of OpenHarmony. It provides a logging system, application and system event logging APIs, the event log subscription service, and fault information generation and collection capabilities.| All systems |
+| Globalization | If OpenHarmony devices and applications need to be used globally, they must meet the requirements of users in different regions on languages and cultures. The Globalization subsystem provides multi-language and multi-cultural capabilities for global use, including resource management and internationalization (i18n).| All systems |
+| Security | Provides system, data, and application security capabilities to protect system and user data of OpenHarmony. Its functions include application integrity verification, application permission management, device authentication, and key management.| All systems |
+
+## Supported Development Boards
+
+Currently, the OpenHarmony community supports 17 types of development boards, which are listed in [Development Boards Supported](device-dev/dev-board-on-the-master.md). The following table describes three of them, which are the first three integrated into the OpenHarmony master. You can visit http://ci.openharmony.cn/dailys/dailybuilds to obtain daily builds.
+
+| System Type| Board Model| Chip Model|
Function Description and Use Case
| Application Scenario| Code Repository |
| -------- | -------- | -------- | -------- | -------- | -------- |
-| Standard system| Hi3516DV300 | Hi3516DV300 | Hi3516D V300 is a the next-generation system on chip (SoC) for smart HD IP cameras. It integrates the next-generation image signal processor (ISP), H.265 video compression encoder, and high-performance NNIE engine, and delivers exceptional performance in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.| Devices with screens, such as refrigerators and head units.| Code repositories: [device_soc_hisilicon](https://gitee.com/openharmony/device_soc_hisilicon) [device_board_hisilicon](https://gitee.com/openharmony/device_board_hisilicon) [vendor_hisilicon](https://gitee.com/openharmony/vendor_hisilicon) Daily build: http://ci.openharmony.cn/dailys/dailybuilds |
-| Standard system| Runhe HH-SCDAYU200| RK3568 | Bolstered by the Rockchip RK3568, the HH-SCDAYU200 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm fabrication process and is clocked at up to 2.0 GHz. The board is packed with Bluetooth, WiFi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as network video recorders (NVRs) and industrial gateways.| Video and audio entertainment, smart travel, and smart home, such as kitchen hoods, ovens, and treadmills.| Code repositories: [device_soc_rockchip](https://gitee.com/openharmony/device_soc_rockchip) [device_board_hihope](https://gitee.com/openharmony/device_board_hihope) [vendor_hihope](https://gitee.com/openharmony/vendor_hihope) Daily build: http://ci.openharmony.cn/dailys/dailybuilds |
-| Lightweight| Goodix GR5515-STARTER-KIT| GR5515 | The GR5515-STARTER-KIT development board is a Bluetooth 5.1-capable single-mode Bluetooth low energy (BLE) SoC and comes with multifunctional keys and LED indicators.| Smart hardware, such as watches, wristbands, and price tags.| Code repositories: [device_soc_goodix](https://gitee.com/openharmony/device_soc_goodix) [device_board_goodix](https://gitee.com/openharmony/device_board_goodix) Daily build: http://ci.openharmony.cn/dailys/dailybuilds |
-| Lightweight| Langguo LANGO200| ASR582X | The LANGO200 IoT development board integrates the high-performance WiFi-BLE dual-mode chip ASR5822, external storage chip, voice playing chip, and analog-to-digital converter. It supports common peripheral interfaces like SPI, and can be connected to an external OLED display and infrared remote control.| Connection modules for smart home products.| Code repositories: [device_soc_asrmicro](https://gitee.com/openharmony/device_soc_asrmicro) [device_board_lango](https://gitee.com/openharmony/device_board_lango) [vendor_asrmicro](https://gitee.com/openharmony/vendor_asrmicro) Daily build: http://ci.openharmony.cn/dailys/dailybuilds |
-| Lightweight| Fn-Link multi-modal V200ZR| BES2600 | The multi-modal V200Z-R development board is a high-performance, multi-functional, and cost-effective AIoT SoC powered by the BES2600WM chip of Bestechnic. It integrates a quad-core Arm processor with a frequency of up to 1 GHz as well as dual-mode WiFi and dual-mode Bluetooth. The board supports the 802.11 a/b/g/n/ and BT/BLE 5.2 standards. It is able to accommodate RAM of up to 42 MB and flash memory of up to 32 MB, and supports the MIPI display serial interface (DSI) and camera serial interface (CSI). It is applicable to various AIoT multi-modal VUI and GUI interaction scenarios.| Smart hardware with screens, such as speakers and watches.| Code repositories: [device_soc_bestechnic](https://gitee.com/openharmony/device_soc_bestechnic) [device_board_fnlink](https://gitee.com/openharmony/device_board_fnlink) [vendor_bestechnic](https://gitee.com/openharmony/vendor_bestechnic) Daily build: http://ci.openharmony.cn/dailys/dailybuilds |
-| Lightweight| BearPi-HM_Nano| Hi3861 | The BearPi-HM_Nano development board is specially designed for OpenHarmony. It is equipped with the highly integrated 2.4 GHz WiFi SoC chip Hi3861, near field communication (NFC) circuits, and standard E53 interfaces, which can be used to connect to smart humidifiers, smart desk lamps, smart security facilities, and intelligent smoke detectors.| Connection devices like smart street lamps, smart logistics sensors, and human body infrared sensors.| Code repositories: [device_soc_hisilicon](https://gitee.com/openharmony/device_soc_hisilicon) [device_board_bearpi](https://gitee.com/openharmony/device_board_bearpi) [vendor_bearpi](https://gitee.com/openharmony/vendor_bearpi) Daily build: http://ci.openharmony.cn/dailys/dailybuilds |
+| Standard system| Runhe HH-SCDAYU200| RK3568 |
Function description: Bolstered by the Rockchip RK3568, the HH-SCDAYU200 development board integrates the dual-core GPU and efficient NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm fabrication process and is clocked at up to 2.0 GHz. The board is packed with Bluetooth, Wi-Fi, audio, video, and camera features, with a wide range of expansion ports to accommodate various video input and outputs. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as network video recorders (NVRs) and industrial gateways. Use case: [DAYU200 Use Case](device-dev/porting/porting-dayu200-on_standard-demo.md)
| Entertainment, easy travel, and smart home, such as kitchen hoods, ovens, and treadmills.| [device_soc_rockchip](https://gitee.com/openharmony/device_soc_rockchip) [device_board_hihope](https://gitee.com/openharmony/device_board_hihope) [vendor_hihope](https://gitee.com/openharmony/vendor_hihope) |
+| Small system| Hispark_Taurus | Hi3516DV300 |
Function Description: Hi3516D V300 is the next-generation system on chip (SoC) for smart HD IP cameras. It integrates the next-generation image signal processor (ISP), H.265 video compression encoder, and high-performance NNIE engine, and delivers high performance in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
| Smart device with screens, such as refrigerators with screens and head units.| [device_soc_hisilicon](https://gitee.com/openharmony/device_soc_hisilicon) [device_board_hisilicon](https://gitee.com/openharmony/device_board_hisilicon) [vendor_hisilicon](https://gitee.com/openharmony/vendor_hisilicon) |
+| Mini system| Multi-modal V200Z-R | BES2600 |
Function description: The multi-modal V200Z-R development board is a high-performance, multi-functional, and cost-effective AIoT SoC powered by the BES2600WM chip of Bestechnic. It integrates a quad-core ARM processor with a frequency of up to 1 GHz as well as dual-mode Wi-Fi and dual-mode Bluetooth. The board supports the 802.11 a/b/g/n/ and BT/BLE 5.2 standards. It is able to accommodate RAM of up to 42 MB and flash memory of up to 32 MB, and supports the MIPI display serial interface (DSI) and camera serial interface (CSI). It is applicable to various AIoT multi-modal VUI and GUI interaction scenarios. Use case: [Multi-modal V200Z-R Use Case](device-dev/porting/porting-bes2600w-on-minisystem-display-demo.md)
| Smart hardware, and smart devices with screens, such as speakers and watches.| [device_soc_bestechnic](https://gitee.com/openharmony/device_soc_bestechnic) [device_board_fnlink](https://gitee.com/openharmony/device_board_fnlink) [vendor_bestechnic](https://gitee.com/openharmony/vendor_bestechnic) |
-## Getting Started
+## Getting Started
- [Getting Started for Device Development](device-dev/quick-start/quickstart-ide-lite-overview.md)
- [Getting Started for Application Development](application-dev/quick-start/start-overview.md)
-## Code Repository Addresses
-OpenHarmony project: [https://gitee.com/openharmony](https://gitee.com/openharmony)
-OpenHarmony SIG: [https://gitee.com/openharmony-sig](https://gitee.com/openharmony-sig)
+## Code Repository Addresses
+
+OpenHarmony project: [https://gitee.com/openharmony](https://gitee.com/openharmony)
+
+OpenHarmony SIGs: [https://gitee.com/openharmony-sig](https://gitee.com/openharmony-sig)
-OpenHarmony third-party components: [https://gitee.com/openharmony-tpc](https://gitee.com/openharmony-tpc)
+OpenHarmony third-party components: [https://gitee.com/openharmony-tpc](https://gitee.com/openharmony-tpc)
-OpenHarmony archived projects: [https://gitee.com/openharmony-retired](https://gitee.com/openharmony-retired)
+OpenHarmony archived projects: [https://gitee.com/openharmony-retired](https://gitee.com/openharmony-retired)
-## OpenHarmony Documentation
+## OpenHarmony Documentation
-[Chinese version](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme.md)
+[Chinese version](https://gitee.com/openharmony/docs/tree/master/zh-cn)
-[English version](https://gitee.com/openharmony/docs/blob/master/en/readme.md)
+[English version](https://gitee.com/openharmony/docs/tree/master/en)
-## Source Code Downloading
+## Source Code Downloading
-For details about how to obtain the source code of OpenHarmony, see [Source Code Acquisition](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/sourcecode-acquire.md).
+For details about how to obtain the source code of OpenHarmony, see [Source Code Acquisition](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/sourcecode-acquire.md)
-## Hands-On Tutorials
+## Hands-On Tutorials
[Samples](https://gitee.com/openharmony/app_samples)
[Codelabs](https://gitee.com/openharmony/codelabs)
-## How to Participate
+## How to Participate
-For details about how to join in the OpenHarmony community, see [OpenHarmony Community](https://gitee.com/openharmony/community/blob/master/README-EN.md).
+For details about how to join in the OpenHarmony community, see [OpenHarmony Community](https://gitee.com/openharmony/community/blob/master/README-EN.md)
-For details about how to contribute, see [How to Contribute](contribute/how-to-contribute.md).
+For details about how to contribute, see [How to contribute](contribute/how-to-contribute.md).
-## License Agreement
+## License Agreement
OpenHarmony complies with Apache License Version 2.0. For details, see the LICENSE in each repository.
-OpenHarmony uses third-party open-source software and licenses. For details, see [Third-Party Open-Source Software](https://gitee.com/openharmony/docs/blob/master/en/contribute/third-party-open-source-software-and-license-notice.md).
+OpenHarmony uses third-party open-source software and licenses. For details, see [Third-Party Open-Source Software](https://gitee.com/openharmony/docs/blob/master/en/contribute/third-party-open-source-software-and-license-notice.md).
-## Contact Info
+## Contact Info
Website:
diff --git a/en/application-dev/Readme-EN.md b/en/application-dev/Readme-EN.md
index fdc79edbcb58a00729b62b5e9f7d239b52cdbf59..8e42633391269303e5e8d888561281f57d1718ae 100644
--- a/en/application-dev/Readme-EN.md
+++ b/en/application-dev/Readme-EN.md
@@ -15,7 +15,6 @@
- Development Fundamentals
- [Application Package Structure Configuration File (FA Model)](quick-start/package-structure.md)
- [Application Package Structure Configuration File (Stage Model)](quick-start/stage-structure.md)
- - [Resource File Categories](quick-start/basic-resource-file-categories.md)
- [SysCap](quick-start/syscap.md)
- Development
- [Ability Development](ability/Readme-EN.md)
@@ -45,8 +44,5 @@
- [Component Reference (TypeScript-based Declarative Development Paradigm)](reference/arkui-ts/Readme-EN.md)
- APIs
- [JS and TS APIs](reference/apis/Readme-EN.md)
- - Native APIs
- - [Standard Library](reference/native-lib/third_party_libc/musl.md)
- - [Node_API](reference/native-lib/third_party_napi/napi.md)
- Contribution
- [How to Contribute](../contribute/documentation-contribution.md)
diff --git a/en/application-dev/ability/ability-brief.md b/en/application-dev/ability/ability-brief.md
index 187064a1c67d7bd21c823a945cca79366428d3f8..9943d4d697fa787db084fc14848d37abdad90fe9 100644
--- a/en/application-dev/ability/ability-brief.md
+++ b/en/application-dev/ability/ability-brief.md
@@ -4,8 +4,8 @@ An ability is the abstraction of a functionality that an application can provide
The ability framework model has two forms.
-- FA model, which applies to application development using API version 8 and earlier versions. In the FA model, there are Feature Ability (FA) and Particle Ability (PA). The FA supports Page abilities, and the PA supports Service, Data, and Form abilities.
-- Stage model, which is introduced since API version 9. In the stage model, there are Ability and ExtensionAbility. The ExtensionAbility is further extended to ServiceExtensionAbility, FormExtensionAbility, DataShareExtensionAbility, and more.
+- FA model, which applies to application development using API version 8 and earlier versions. In the FA model, there is Feature Ability (FA) and Particle Ability (PA). The FA supports Page abilities, and the PA supports Service, Data, and Form abilities.
+- Stage model, which is introduced since API version 9. In the stage model, there is `Ability` and `ExtensionAbility`. `ExtensionAbility` is further extended to `ServiceExtensionAbility`, `FormExtensionAbility`, `DataShareExtensionAbility`, and more.
The stage model is designed to make it easier to develop complex applications in the distributed environment. The table below lists the design differences between the two models.
diff --git a/en/application-dev/ability/figures/fa-package-info.png b/en/application-dev/ability/figures/fa-package-info.png
deleted file mode 100644
index 86da707408da8fdb149ea62d92298fed605132ca..0000000000000000000000000000000000000000
Binary files a/en/application-dev/ability/figures/fa-package-info.png and /dev/null differ
diff --git a/en/application-dev/ability/stage-ability.md b/en/application-dev/ability/stage-ability.md
index 5b61bcec4b25312f994ed94362339e601df5cd55..e1d67a295b673453d7340fb20a40c81d8c7a7855 100644
--- a/en/application-dev/ability/stage-ability.md
+++ b/en/application-dev/ability/stage-ability.md
@@ -78,29 +78,29 @@ To create Page abilities for an application in the stage model, you must impleme
onCreate(want, launchParam) {
console.log("MainAbility onCreate")
}
-
+
onDestroy() {
console.log("MainAbility onDestroy")
}
-
+
onWindowStageCreate(windowStage) {
console.log("MainAbility onWindowStageCreate")
-
+
windowStage.loadContent("pages/index").then((data) => {
console.log("MainAbility load content succeed with data: " + JSON.stringify(data))
}).catch((error) => {
console.error("MainAbility load content failed with error: " + JSON.stringify(error))
})
}
-
+
onWindowStageDestroy() {
console.log("MainAbility onWindowStageDestroy")
}
-
+
onForeground() {
console.log("MainAbility onForeground")
}
-
+
onBackground() {
console.log("MainAbility onBackground")
}
@@ -300,7 +300,7 @@ export default class MainAbility extends Ability {
Obtain the `want` parameter that contains the page information from the custom component and process the route based on the URI.
```ts
-import router from '@system.router'
+import router from '@ohos.router'
@Entry
@Component
diff --git a/en/application-dev/application-dev-guide-for-gitee.md b/en/application-dev/application-dev-guide-for-gitee.md
index 753b706605487dbe2cf5ebe0ce961b19d94e7ee0..e60f2c01333c1bef7324b3ef6cfe2c83821a95cd 100644
--- a/en/application-dev/application-dev-guide-for-gitee.md
+++ b/en/application-dev/application-dev-guide-for-gitee.md
@@ -54,8 +54,10 @@ To make you better understand how functions work together and jumpstart your app
API references encompass all components and APIs available in OpenHarmony, helping you use and integrate APIs more effectively.
They are organized as follows:
+
+- [Component Reference (TypeScript-based Declarative Development Paradigm)](reference/arkui-ts/Readme-EN.md)
+
- [Component Reference (JavaScript-based Web-like Development Paradigm)](reference/arkui-js/Readme-EN.md)
-- [Component Reference (TypeScript-based Declarative Development Paradigm)](reference/arkui-ts/Readme-EN.md)
- APIs
- [JS and TS APIs](reference/apis/Readme-EN.md)
- Native APIs
diff --git a/en/application-dev/application-dev-guide.md b/en/application-dev/application-dev-guide.md
index c07f787d38091637215907537e54812c397a417e..7065480d1c4a12bd0984f4916d678c1bed7a4997 100644
--- a/en/application-dev/application-dev-guide.md
+++ b/en/application-dev/application-dev-guide.md
@@ -54,8 +54,14 @@ To make you better understand how functions work together and jumpstart your app
API references encompass all components and APIs available in OpenHarmony, helping you use and integrate APIs more effectively.
They are organized as follows:
-- [JS and TS APIs](reference/apis/js-apis-DataUriUtils.md)
-- Native APIs
- - [Standard Library](reference/native-lib/third_party_libc/musl.md)
- - [Node_API](reference/native-lib/third_party_napi/napi.md)
+
+- [Component Reference (TypeScript-based Declarative Development Paradigm)](reference/arkui-ts/Readme-EN.md)
+
+- [Component Reference (JavaScript-based Web-like Development Paradigm)](reference/arkui-js/Readme-EN.md)
+
+- [JS and TS APIs](reference/apis/js-apis-DataUriUtils.md)
+
+- Native APIs
+ - [Standard Library](reference/native-lib/third_party_libc/musl.md)
+ - [Node_API](reference/native-lib/third_party_napi/napi.md)
diff --git a/en/application-dev/connectivity/ipc-rpc-development-guideline.md b/en/application-dev/connectivity/ipc-rpc-development-guideline.md
index 3d541e4832aa72a585972d327e2fb2f31a077fa6..1fddf868604e564e4b6a6701f8d3a8088c4d8326 100644
--- a/en/application-dev/connectivity/ipc-rpc-development-guideline.md
+++ b/en/application-dev/connectivity/ipc-rpc-development-guideline.md
@@ -8,37 +8,11 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
**Table 1** Native IPC APIs
-
-
Class/Interface
-
-
Function
-
-
Description
-
-
-
-
IRemoteBroker
-
-
sptr<IRemoteObject> AsObject()
-
-
Obtains the holder of a remote proxy object. This method must be implemented by the derived classes of IRemoteBroker. If you call this method on the stub, the RemoteObject is returned; if you call this method on the proxy, the proxy object is returned.
-
-
-
IRemoteStub
-
-
virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
-
-
Called to process a request from the proxy and return the result. Derived classes need to override this method.
-
-
-
IRemoteProxy
-
-
-
Service proxy classes are derived from the IRemoteProxy class.
-
-
-
-
+| Class/Interface | Function | Description |
+| --------------- | -------- | ----------- |
+| IRemoteBroker | sptr AsObject() | Obtains the holder of a remote proxy object. This method must be implemented by the derived classes of **IRemoteBroker**. If you call this method on the stub, the **RemoteObject** is returned; if you call this method on the proxy, the proxy object is returned. |
+| IRemoteStub | virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) | Called to process a request from the proxy and return the result. Derived classes need to override this method. |
+| IRemoteProxy | | Service proxy classes are derived from the **IRemoteProxy** class. |
## How to Develop
diff --git a/en/application-dev/connectivity/ipc-rpc-overview.md b/en/application-dev/connectivity/ipc-rpc-overview.md
index 19bbe8dc26871bec8b2f6f48273d90dacc148d70..e75536863b1ae1b5c5371f51b0d7e26e4db97ed6 100755
--- a/en/application-dev/connectivity/ipc-rpc-overview.md
+++ b/en/application-dev/connectivity/ipc-rpc-overview.md
@@ -19,4 +19,4 @@ In OpenHarmony documents, proxy represents the service requester, and stub repre
## Related Modules
-[Distributed Scheduler](https://gitee.com/openharmony/distributedschedule_dms_fwk)
+[Distributed Scheduler](https://gitee.com/openharmony/ability_dmsfwk)
diff --git a/en/application-dev/connectivity/subscribe-remote-state.md b/en/application-dev/connectivity/subscribe-remote-state.md
index fa70738556ec7992c33fd8bcf3e74fbd6145fcb6..8d9365d6bbba940bb85d9ac7493b7069c48845eb 100755
--- a/en/application-dev/connectivity/subscribe-remote-state.md
+++ b/en/application-dev/connectivity/subscribe-remote-state.md
@@ -1,25 +1,30 @@
-# Subscribing to State Changes of a Remote Object
+# Subscribing to State Changes of a Remote Object
-IPC/RPC allows you to subscribe to the state changes of a remote stub object. When the remote stub object dies, a death notification will be sent to your local proxy object. You can also unsubscribe from the state changes if they are no longer needed. Such subscription and unsubscription are controlled by APIs. To be specific, you need to implement the **IRemoteObject.DeathRecipient** interface and the **onRemoteDied** method to clear resources. This callback is invoked when the process accommodating the remote stub object dies, or the device accommodating the remote stub object leaves the network. It is worth noting that these APIs should be called in the following order: The proxy object must first subscribe to death notifications of the stub object. If the stub object is in the normal state, the proxy object can cancel the subscription as required. If the process of the stub object exits or the device hosting the stub object goes offline, subsequent operations customized by the proxy object will be automatically triggered.
+IPC/RPC allows you to subscribe to the state changes of a remote stub object. When the remote stub object dies, a death notification will be sent to your local proxy object. Such subscription and unsubscription are controlled by APIs. To be specific, you need to implement the **DeathRecipient** callback and the **onRemoteDied** method to clear resources. This callback is invoked when the process accommodating the remote stub object dies, or the device accommodating the remote stub object leaves the network.
-**Development Using Native APIs**
+Note that the proxy object must first subscribe to death notifications of the stub object. If the stub object is in the normal state, the proxy object can cancel the subscription as required. If the process of the stub object exits or the device hosting the stub object goes offline, subsequent operations customized by the proxy object will be automatically triggered.
-The following APIs are used to add a recipient for death notifications of a remote stub object, remove such a recipient, and perform subsequent operations upon receiving a death notification of the remote stub object:
-```
-bool AddDeathRecipient(const sptr &recipient);
-bool RemoveDeathRecipient(const sptr &recipient);
-void OnRemoteDied(const wptr &object);
-```
-The sample code is as follows:
+
+## **Development Using Native APIs**
+
+| API| Description|
+| -------- | -------- |
+| AddDeathRecipient(const sptr\ &recipient); | Adds a recipient for death notifications of a remote stub object.|
+| RemoveDeathRecipient(const sptr\ &recipient); | Removes the recipient for death notifications of a remote stub object.|
+| OnRemoteDied(const wptr\ &object); | Called when the remote stub object dies.|
+
+
+## Sample Code
+
```
class TestDeathRecipient : public IRemoteObject::DeathRecipient {
public:
virtual void OnRemoteDied(const wptr& remoteObject);
}
-sptr deathRecipient (new TestDeathRecipient()); // Construct a death notification recipient.
-bool result = proxy->AddDeathRecipient(deathRecipient); // Add the recipient to the proxy.
-result = proxy->RemoveDeathRecipient(deathRecipient); // Remove the recipient.
+sptr deathRecipient (new TestDeathRecipient());// Construct a death notification recipient.
+bool result = proxy->AddDeathRecipient(deathRecipient); // Add a recipient for death notifications.
+result = proxy->RemoveDeathRecipient(deathRecipient); // Remove the recipient for death notifications.
```
diff --git a/en/application-dev/connectivity/websocket-connection.md b/en/application-dev/connectivity/websocket-connection.md
index 01f5f38fad74e234c8a9fb483ee4a11ae2a8c7a7..b68d537fc5ad96f3ab60b53e2e75a96d7b555f76 100644
--- a/en/application-dev/connectivity/websocket-connection.md
+++ b/en/application-dev/connectivity/websocket-connection.md
@@ -3,7 +3,7 @@
## Use Cases
-You can use WebSocket to establish a bidirectional connection between a server and a client. Before doing this, you need to use the **createWebSocket** API to create a **WebSocket** object and then use the **connect** API to connect to the server. If the connection is successful, the client will receive a callback of the **open** event. Then, the client can communicate with the server using the **send** API. When the server sends a message to the client, the client will receive a callback of the **message** event. If the client no longer needs this connection, it can call the **close** API to disconnect from the server. Then, the client will receive a callback of the **close** event.
+You can use WebSocket to establish a bidirectional connection between a server and a client. Before doing this, you need to use the **createWebSocket()** API to create a **WebSocket** object and then use the **connect()** API to connect to the server. If the connection is successful, the client will receive a callback of the **open** event. Then, the client can communicate with the server using the **send()** API. When the server sends a message to the client, the client will receive a callback of the **message** event. If the client no longer needs this connection, it can call the **close()** API to disconnect from the server. Then, the client will receive a callback of the **close** event.
If an error occurs in any of the preceding processes, the client will receive a callback of the **error** event.
@@ -18,14 +18,14 @@ The WebSocket connection function is mainly implemented by the WebSocket module.
| connect() | Establishes a WebSocket connection to a given URL. |
| send() | Sends data through the WebSocket connection. |
| close() | Closes a WebSocket connection. |
-| on(type: 'open') | Enables listening for **open** events of a WebSocket connection. |
-| off(type: 'open') | Disables listening for **open** events of a WebSocket connection. |
-| on(type: 'message') | Enables listening for **message** events of a WebSocket connection. |
-| off(type: 'message') | Disables listening for **message** events of a WebSocket connection. |
-| on(type: 'close') | Enables listening for **close** events of a WebSocket connection. |
-| off(type: 'close') | Disables listening for **close** events of a WebSocket connection. |
-| on(type: 'error') | Enables listening for **error** events of a WebSocket connection. |
-| off(type: 'error') | Disables listening for **error** events of a WebSocket connection. |
+| on(type: 'open') | Enables listening for **open** events of a WebSocket connection. |
+| off(type: 'open') | Disables listening for **open** events of a WebSocket connection. |
+| on(type: 'message') | Enables listening for **message** events of a WebSocket connection. |
+| off(type: 'message') | Disables listening for **message** events of a WebSocket connection. |
+| on(type: 'close') | Enables listening for **close** events of a WebSocket connection. |
+| off(type: 'close') | Disables listening for **close** events of a WebSocket connection. |
+| on(type: 'error') | Enables listening for **error** events of a WebSocket connection. |
+| off(type: 'error') | Disables listening for **error** events of a WebSocket connection. |
## How to Develop
@@ -50,9 +50,9 @@ The WebSocket connection function is mainly implemented by the WebSocket module.
// When receiving the on('open') event, the client can use the send() API to communicate with the server.
ws.send("Hello, server!", (err, value) => {
if (!err) {
- console.log("send success");
+ console.log("Message sent successfully");
} else {
- console.log("send fail, err:" + JSON.stringify(err));
+ console.log("Failed to send the message. Err:" + JSON.stringify(err));
}
});
});
@@ -62,9 +62,9 @@ The WebSocket connection function is mainly implemented by the WebSocket module.
if (value === 'bye') {
ws.close((err, value) => {
if (!err) {
- console.log("close success");
+ console.log("Connection closed successfully");
} else {
- console.log("close fail, err is " + JSON.stringify(err));
+ console.log("Failed to close the connection. Err: " + JSON.stringify(err));
}
});
}
@@ -77,9 +77,9 @@ The WebSocket connection function is mainly implemented by the WebSocket module.
});
ws.connect(defaultIpAddress, (err, value) => {
if (!err) {
- console.log("connect success");
+ console.log("Connected successfully");
} else {
- console.log("connect fail, err:" + JSON.stringify(err));
+ console.log("Connection failed. Err:" + JSON.stringify(err));
}
});
```
diff --git a/en/application-dev/database/database-relational-guidelines.md b/en/application-dev/database/database-relational-guidelines.md
index 53bba062801ec1b8bcf1f65cdc4119fa53757f10..b56401dbedca72e76af3b15efdd63883885bf3d6 100644
--- a/en/application-dev/database/database-relational-guidelines.md
+++ b/en/application-dev/database/database-relational-guidelines.md
@@ -100,7 +100,7 @@ The RDB provides **RdbPredicates** for you to set database operation conditions.
| RdbPredicates | glob(field: string, value: string): RdbPredicates | Sets the **RdbPredicates** to match the specified string. - **field**: column name in the database table. - **value**: value specified. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
| RdbPredicates | between(field: string, low: ValueType, high: ValueType): RdbPredicates | Sets the **RdbPredicates** to match the field with data type **ValueType** and value within the specified range. - **field**: column name in the database table. - **low**: minimum value that matches the **RdbPredicates**. - **high**: maximum value that matches the **RdbPredicates**. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
| RdbPredicates | notBetween(field: string, low: ValueType, high: ValueType): RdbPredicates | Sets the **RdbPredicates** to match the field with data type **ValueType** and value out of the specified range. - **field**: column name in the database table. - **low**: minimum value that matches the **RdbPredicates**. - **high**: maximum value that matches the **RdbPredicates**. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
-| RdbPredicates | greaterThan(field: string, value: ValueType): RdbPredicatesgr | Sets the **RdbPredicates** to match the field with data type **ValueType** and value greater than the specified value. - **field**: column name in the database table. - **value**: value specified. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
+| RdbPredicates | greaterThan(field: string, value: ValueType): RdbPredicates | Sets the **RdbPredicates** to match the field with data type **ValueType** and value greater than the specified value. - **field**: column name in the database table. - **value**: value specified. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
| RdbPredicates | lessThan(field: string, value: ValueType): RdbPredicates | Sets the **RdbPredicates** to match the field with data type **ValueType** and value less than the specified value. - **field**: column name in the database table. - **value**: value specified. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
| RdbPredicates | greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicates | Sets the **RdbPredicates** to match the field with data type **ValueType** and value greater than or equal to the specified value. - **field**: column name in the database table. - **value**: value specified. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
| RdbPredicates | lessThanOrEqualTo(field: string, value: ValueType): RdbPredicates | Sets the **RdbPredicates** to match the field with data type **ValueType** and value less than or equal to the specified value. - **field**: column name in the database table. - **value**: value specified. - **RdbPredicates**: returns a **RdbPredicates** object that matches the specified field.|
diff --git a/en/application-dev/device/device-location-info.md b/en/application-dev/device/device-location-info.md
index dce40ff38546fe1b86a60bf670cb18adf9e15968..a32decd05ac0ba0d6db06749c18dcd31d3a7645b 100644
--- a/en/application-dev/device/device-location-info.md
+++ b/en/application-dev/device/device-location-info.md
@@ -14,49 +14,49 @@ The following table describes APIs available for obtaining device location infor
**Table 1** APIs for obtaining device location information
-| API | Description |
-| -------- | -------- |
-| on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>) : void | Registers a listener for location changes with a location request initiated. |
-| off(type: 'locationChange', callback?: Callback<Location>) : void | Unregisters the listener for location changes with the corresponding location request deleted. |
-| on(type: 'locationServiceState', callback: Callback<boolean>) : void | Registers a listener for location service status change events. |
-| off(type: 'locationServiceState', callback: Callback<boolean>) : void | Unregisters the listener for location service status change events. |
-| on(type: 'cachedGnssLocationsReporting', request: CachedGnssLoactionsRequest, callback: Callback<Array<Location>>) : void; | Registers a listener for cached GNSS location reports. |
-| off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>) : void; | Unregisters the listener for cached GNSS location reports. |
-| on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>) : void; | Registers a listener for satellite status change events. |
-| off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>) : void; | Unregisters the listener for satellite status change events. |
-| on(type: 'nmeaMessageChange', callback: Callback<string>) : void; | Registers a listener for GNSS NMEA message change events. |
-| off(type: 'nmeaMessageChange', callback?: Callback<string>) : void; | Unregisters the listener for GNSS NMEA message change events. |
-| on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Registers a listener for status change events of the specified geofence. |
-| off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Unregisters the listener for status change events of the specified geofence. |
-| getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>) : void | Obtains the current location. This function uses an asynchronous callback to return the result. |
-| getCurrentLocation(request?: CurrentLocationRequest) : Promise<Location> | Obtains the current location. This function uses a promise to return the result. |
-| getLastLocation(callback: AsyncCallback<Location>) : void | Obtains the previous location. This function uses an asynchronous callback to return the result. |
-| getLastLocation() : Promise<Location> | Obtains the previous location. This function uses a promise to return the result. |
-| isLocationEnabled(callback: AsyncCallback<boolean>) : void | Checks whether the location service is enabled. This function uses an asynchronous callback to return the result. |
-| isLocationEnabled() : Promise<boolean> | Checks whether the location service is enabled. This function uses a promise to return the result. |
-| requestEnableLocation(callback: AsyncCallback<boolean>) : void | Requests to enable the location service. This function uses an asynchronous callback to return the result. |
-| requestEnableLocation() : Promise<boolean> | Requests to enable the location service. This function uses a promise to return the result. |
-| enableLocation(callback: AsyncCallback<boolean>) : void | Enables the location service. This function uses an asynchronous callback to return the result. |
-| enableLocation() : Promise<boolean> | Enables the location service. This function uses a promise to return the result. |
-| disableLocation(callback: AsyncCallback<boolean>) : void | Disables the location service. This function uses an asynchronous callback to return the result. |
-| disableLocation() : Promise<boolean> | Disables the location service. This function uses a promise to return the result. |
-| getCachedGnssLocationsSize(callback: AsyncCallback<number>) : void; | Obtains the number of cached GNSS locations. This function uses an asynchronous callback to return the result. |
-| getCachedGnssLocationsSize() : Promise<number>; | Obtains the number of cached GNSS locations. This function uses a promise to return the result. |
-| flushCachedGnssLocations(callback: AsyncCallback<boolean>) : void; | Obtains all cached GNSS locations and clears the GNSS cache queue. This function uses an asynchronous callback to return the result. |
-| flushCachedGnssLocations() : Promise<boolean>; | Obtains all cached GNSS locations and clears the GNSS cache queue. This function uses a promise to return the result. |
-| sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>) : void; | Sends extended commands to the location subsystem. This function uses an asynchronous callback to return the result. |
-| sendCommand(command: LocationCommand) : Promise<boolean>; | Sends extended commands to the location subsystem. This function uses a promise to return the result. |
-| isLocationPrivacyConfirmed(type : LocationPrivacyType, callback: AsyncCallback<boolean>) : void; | Checks whether a user agrees with the privacy statement of the location service. This function uses an asynchronous callback to return the result. |
-| isLocationPrivacyConfirmed(type : LocationPrivacyType,) : Promise<boolean>; | Checks whether a user agrees with the privacy statement of the location service. This function uses a promise to return the result. |
-| setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean, callback: AsyncCallback<boolean>) : void; | Sets the user confirmation status for the privacy statement of the location service. This function uses an asynchronous callback to return the result. |
-| setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean) : Promise<boolean>; | Sets the user confirmation status for the privacy statement of the location service. This function uses a promise to return the result. |
+| API | Description |
+| ------------------------------------------------------------ | ------------------------------------------------------------ |
+| on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>) : void | Registers a listener for location changes with a location request initiated. |
+| off(type: 'locationChange', callback?: Callback<Location>) : void | Unregisters the listener for location changes with the corresponding location request deleted. |
+| on(type: 'locationServiceState', callback: Callback<boolean>) : void | Registers a listener for location service status change events. |
+| off(type: 'locationServiceState', callback: Callback<boolean>) : void | Unregisters the listener for location service status change events. |
+| on(type: 'cachedGnssLocationsReporting', request: CachedGnssLoactionsRequest, callback: Callback<Array<Location>>) : void; | Registers a listener for cached GNSS location reports. |
+| off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>) : void; | Unregisters the listener for cached GNSS location reports. |
+| on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>) : void; | Registers a listener for satellite status change events. |
+| off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>) : void; | Unregisters the listener for satellite status change events. |
+| on(type: 'nmeaMessageChange', callback: Callback<string>) : void; | Registers a listener for GNSS NMEA message change events. |
+| off(type: 'nmeaMessageChange', callback?: Callback<string>) : void; | Unregisters the listener for GNSS NMEA message change events. |
+| on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Registers a listener for status change events of the specified geofence. |
+| off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Unregisters the listener for status change events of the specified geofence. |
+| getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>) : void | Obtains the current location. This API uses an asynchronous callback to return the result. |
+| getCurrentLocation(request?: CurrentLocationRequest) : Promise<Location> | Obtains the current location. This API uses a promise to return the result. |
+| getLastLocation(callback: AsyncCallback<Location>) : void | Obtains the previous location. This API uses an asynchronous callback to return the result. |
+| getLastLocation() : Promise<Location> | Obtains the previous location. This API uses a promise to return the result. |
+| isLocationEnabled(callback: AsyncCallback<boolean>) : void | Checks whether the location service is enabled. This API uses an asynchronous callback to return the result. |
+| isLocationEnabled() : Promise<boolean> | Checks whether the location service is enabled. This API uses a promise to return the result. |
+| requestEnableLocation(callback: AsyncCallback<boolean>) : void | Requests to enable the location service. This API uses an asynchronous callback to return the result. |
+| requestEnableLocation() : Promise<boolean> | Requests to enable the location service. This API uses a promise to return the result. |
+| enableLocation(callback: AsyncCallback<boolean>) : void | Enables the location service. This API uses an asynchronous callback to return the result. |
+| enableLocation() : Promise<boolean> | Enables the location service. This API uses a promise to return the result. |
+| disableLocation(callback: AsyncCallback<boolean>) : void | Disables the location service. This API uses an asynchronous callback to return the result. |
+| disableLocation() : Promise<boolean> | Disables the location service. This API uses a promise to return the result. |
+| getCachedGnssLocationsSize(callback: AsyncCallback<number>) : void; | Obtains the number of cached GNSS locations. This API uses an asynchronous callback to return the result. |
+| getCachedGnssLocationsSize() : Promise<number>; | Obtains the number of cached GNSS locations. This API uses a promise to return the result. |
+| flushCachedGnssLocations(callback: AsyncCallback<boolean>) : void; | Obtains all cached GNSS locations and clears the GNSS cache queue. This API uses an asynchronous callback to return the result.|
+| flushCachedGnssLocations() : Promise<boolean>; | Obtains all cached GNSS locations and clears the GNSS cache queue. This API uses a promise to return the result.|
+| sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>) : void; | Sends extended commands to the location subsystem. This API uses an asynchronous callback to return the result.|
+| sendCommand(command: LocationCommand) : Promise<boolean>; | Sends extended commands to the location subsystem. This API uses a promise to return the result. |
+| isLocationPrivacyConfirmed(type : LocationPrivacyType, callback: AsyncCallback<boolean>) : void; | Checks whether a user agrees with the privacy statement of the location service. This API uses an asynchronous callback to return the result.|
+| isLocationPrivacyConfirmed(type : LocationPrivacyType,) : Promise<boolean>; | Checks whether a user agrees with the privacy statement of the location service. This API uses a promise to return the result.|
+| setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean, callback: AsyncCallback<boolean>) : void; | Sets the user confirmation status for the privacy statement of the location service. This API uses an asynchronous callback to return the result.|
+| setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean) : Promise<boolean>; | Sets the user confirmation status for the privacy statement of the location service. This API uses a promise to return the result.|
## How to Develop
To learn more about the APIs for obtaining device location information, see [Geolocation](../reference/apis/js-apis-geolocation.md).
-1. Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user. For details, see the following section.
+1. Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user as described below.
The system provides the following location permissions:
- ohos.permission.LOCATION
@@ -64,9 +64,9 @@ To learn more about the APIs for obtaining device location information, see [Geo
The **ohos.permission.LOCATION** permission is a must if your application needs to access the device location information.
- If your application needs to access the device location information when running on the background, it must be allowed to run on the background in the configuration file and also granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information even when your application moves to the background.
+ If your application needs to access the device location information when running on the background, it must be configured to be able to run on the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background.
- To allow your application to access device location information, you can declare the required permissions in the **config.json** file of your application. The sample code is as follows:
+ To allow your application to access device location information, declare the required permissions in the **module.json** file of your application. The sample code is as follows:
```
@@ -83,8 +83,8 @@ To learn more about the APIs for obtaining device location information, see [Geo
}
}
```
-
- For details about the fields, see .
+
+ For details about the fields, see [Application Package Structure Configuration File](../quick-start/stage-structure.md).
2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities.
@@ -92,7 +92,7 @@ To learn more about the APIs for obtaining device location information, see [Geo
import geolocation from '@ohos.geolocation';
```
-3. Instantiate the **LocationRequest** object. This object provides APIs to notify the system of the location service type and the interval of reporting location information.
+3. Instantiate the **LocationRequest** object. This object provides APIs to notify the system of the location service type and the interval of reporting location information.
**Method 1:**
To better serve your needs for using APIs, the system has categorized APIs into different packages to match your common use cases of the location function. In this way, you can directly use the APIs specific to a certain use case, making application development much easier. The following table lists the use cases currently supported.
@@ -112,15 +112,15 @@ To learn more about the APIs for obtaining device location information, see [Geo
**Table 2** Common use cases of the location function
- | Use Case | Constant | Description |
- | -------- | -------- | -------- |
- | Navigation | NAVIGATION | Applicable when your application needs to obtain the real-time location of a mobile device outdoors, such as navigation for driving or walking. In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy. However, due to its limitations, the technology may be unable to provide the location service when navigation is just started or when the user moves into a shielded environment such as indoors or a garage. To resolve this issue, the system uses the network positioning technology as an alternative to provide the location service for your application until the GNSS can provide stable location results. This helps achieve a smooth navigation experience for users. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization. |
- | Trajectory tracking | TRAJECTORY_TRACKING | Applicable when your application needs to record user trajectories, for example, the track recording function of sports applications. In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization. |
- | Ride hailing | CAR_HAILING | Applicable when your application needs to obtain the current location of a user who is hailing a taxi. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization. |
- | Life service | DAILY_LIFE_SERVICE | Applicable when your application only needs the approximate user location for recommendations and push notifications in scenarios such as when the user is browsing news, shopping online, and ordering food. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization. |
- | Power efficiency | NO_POWER | Applicable when your application does not proactively start the location service for a higher battery efficiency. When responding to another application requesting the same location service, the system marks a copy of the location result to your application. In this way, your application will not consume extra power for obtaining the user location. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization. |
-
- The following example instantiates the **RequestParam** object for navigation:
+ | Use Case | Constant | Description |
+ | ------------ | ------------------- | ------------------------------------------------------------ |
+ | Navigation | NAVIGATION | Applicable when your application needs to obtain the real-time location of a mobile device outdoors, such as navigation for driving or walking. In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy. However, due to its limitations, the technology may be unable to provide the location service when navigation is just started or when the user moves into a shielded environment such as indoors or a garage. To resolve this issue, the system uses the network positioning technology as an alternative to provide the location service for your application until the GNSS can provide stable location results. This helps achieve a smooth navigation experience for users. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
+ | Trajectory tracking| TRAJECTORY_TRACKING | Applicable when your application needs to record user trajectories, for example, the track recording function of sports applications. In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
+ | Ride hailing| CAR_HAILING | Applicable when your application needs to obtain the current location of a user who is hailing a taxi. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
+ | Life service| DAILY_LIFE_SERVICE | Applicable when your application only needs the approximate user location for recommendations and push notifications in scenarios such as when the user is browsing news, shopping online, and ordering food. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
+ | Power efficiency | NO_POWER | Applicable when your application does not proactively start the location service for a higher battery efficiency. When responding to another application requesting the same location service, the system marks a copy of the location result to your application. In this way, your application will not consume extra power for obtaining the user location. By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
+
+ Sample code for initializing **requestInfo** for navigation:
```
var requestInfo = {'scenario': geolocation.LocationRequestScenario.NAVIGATION, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
@@ -143,20 +143,20 @@ To learn more about the APIs for obtaining device location information, see [Geo
**Table 3** Location priority policies
- | Policy | Constant | Description |
- | -------- | -------- | -------- |
- | Location accuracy priority | ACCURACY | This policy mainly uses the GNSS positioning technology. In an open area, the technology can achieve the meter-level location accuracy, depending on the hardware performance of the device. However, in a shielded environment, the location accuracy may significantly decrease. To use this policy, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization. |
- | Fast location priority | FAST_FIRST_FIX | This policy uses the GNSS positioning, base station positioning, WLAN positioning, and Bluetooth positioning technologies simultaneously to obtain the device location in both the indoor and outdoor scenarios. When all positioning technologies provide a location result, the system provides the most accurate location result for your application. This policy can lead to significant hardware resource consumption and power consumption. To use this policy, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization. |
- | Power efficiency priority | LOW_POWER | This policy mainly uses the base station positioning, WLAN positioning, and Bluetooth positioning technologies to obtain device location in both indoor and outdoor scenarios. The location accuracy depends on the distribution of surrounding base stations, visible WLANs, and Bluetooth devices and therefore may fluctuate greatly. This policy is recommended and can reduce power consumption when your application does not require high location accuracy or when base stations, visible WLANs, and Bluetooth devices are densely distributed. To use this policy, you must declare at least the **ohos.permission.LOCATION** permission and obtain users' authorization. |
+ | Policy | Constant | Description |
+ | ------------------ | -------------- | ------------------------------------------------------------ |
+ | Location accuracy priority | ACCURACY | This policy mainly uses the GNSS positioning technology. In an open area, the technology can achieve the meter-level location accuracy, depending on the hardware performance of the device. However, in a shielded environment, the location accuracy may significantly decrease. To use this policy, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
+ | Fast location priority | FAST_FIRST_FIX | This policy uses the GNSS positioning, base station positioning, WLAN positioning, and Bluetooth positioning technologies simultaneously to obtain the device location in both the indoor and outdoor scenarios. When all positioning technologies provide a location result, the system provides the most accurate location result for your application. This policy can lead to significant hardware resource consumption and power consumption. To use this policy, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
+ | Power efficiency priority| LOW_POWER | This policy mainly uses the base station positioning, WLAN positioning, and Bluetooth positioning technologies to obtain device location in both indoor and outdoor scenarios. The location accuracy depends on the distribution of surrounding base stations, visible WLANs, and Bluetooth devices and therefore may fluctuate greatly. This policy is recommended and can reduce power consumption when your application does not require high location accuracy or when base stations, visible WLANs, and Bluetooth devices are densely distributed. To use this policy, you must declare at least the **ohos.permission.LOCATION** permission and obtain users' authorization.|
- The following example instantiates the **RequestParam** object for the location accuracy priority policy:
+ Sample code for initializing **requestInfo** for the location accuracy priority policy:
```
var requestInfo = {'priority': geolocation.LocationRequestPriority.ACCURACY, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
```
4. Instantiate the **Callback** object for the system to report location results.
- Your application needs to implement the callback interface defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic.
+ Your application needs to implement the callback defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic.
```
var locationChange = (location) => {
@@ -176,8 +176,8 @@ To learn more about the APIs for obtaining device location information, see [Geo
geolocation.off('locationChange', locationChange);
```
- If your application does not need the real-time device location, it can use the last known device location cached in the system instead.
-
+If your application does not need the real-time device location, it can use the last known device location cached in the system instead.
+
```
geolocation.getLastLocation((err, data) => {
if (err) {
diff --git a/en/application-dev/dfx/hiappevent-guidelines.md b/en/application-dev/dfx/hiappevent-guidelines.md
index e1d4cddeb2ff96c8a07a6df84382ad0b8d22464c..54199719cd93a523d8f2b0af14c12578997a02a2 100644
--- a/en/application-dev/dfx/hiappevent-guidelines.md
+++ b/en/application-dev/dfx/hiappevent-guidelines.md
@@ -2,13 +2,13 @@
## When to Use
-The event logging function helps applications log various information generated during running.
+The event logging function helps applications to log various information generated during running.
## Available APIs
JS application event logging APIs are provided by the **hiAppEvent** module.
-**APIs for Event Logging**
+**Table 1** APIs for event logging
| API | Return Value | Description |
| ------------------------------------------------------------ | -------------- | ------------------------------------------------------------ |
@@ -17,7 +17,7 @@ JS application event logging APIs are provided by the **hiAppEvent** module.
When an asynchronous callback is used, the return value can be processed directly in the callback. When a promise is used, the return value can also be processed in the promise in a similar way. For details about the result codes, see [Event Verification Result Codes](#event-verification-result-codes).
-**APIs for Event Logging Configuration**
+**Table 2** APIs for event logging configuration
| API | Return Value | Description |
| ------------------------------ | ------------ | ------------------------------------------------------------ |
diff --git a/en/application-dev/dfx/hiappevent-overview.md b/en/application-dev/dfx/hiappevent-overview.md
index 403aec02035c965da4633e8667be6803031ddf60..2a5e36f879a922f3d6bf845e700068c2a299b337 100644
--- a/en/application-dev/dfx/hiappevent-overview.md
+++ b/en/application-dev/dfx/hiappevent-overview.md
@@ -2,8 +2,10 @@
HiAppEvent provides event logging APIs for applications to log the fault, statistical, security, and user behavior events reported during running. Based on event information, you will be able to analyze the running status of your application.
+The HiAppEvent module of OpenHarmony can be used to develop application event services and provide functions related to application events, including flushing application events to a disk and querying historical application event data.
+
## Basic Concepts
-The HiAppEvent module of OpenHarmony can be used to develop application event services and provide functions related to application events, including flushing application events to a disk and querying historical application event data.
+- **Logging**
-**Logging**: Logs changes caused by user operations to provide service data for development, product, and O&M analysis.
+ Logs changes caused by user operations to provide service data for development, product, and O&M analysis.
diff --git a/en/application-dev/dfx/hitracemeter-guidelines.md b/en/application-dev/dfx/hitracemeter-guidelines.md
index e7e97631c240bb42358d3b0b630a92094f34bcfc..316ee1b07898a24721b81625c2e9193ae08aa85f 100644
--- a/en/application-dev/dfx/hitracemeter-guidelines.md
+++ b/en/application-dev/dfx/hitracemeter-guidelines.md
@@ -6,9 +6,9 @@ HiTraceMeter provides APIs for system performance tracing. You can call the APIs
## Available APIs
-The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference]( ../reference/apis/js-apis-hitracemeter.md).
+The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference](../reference/apis/js-apis-hitracemeter.md).
-**APIs for performance tracing**
+**Table 1** APIs for performance tracing
| API| Return Value| Description|
| ---------------------------------------------------------------------------- | --------- | ------------ |
diff --git a/en/application-dev/dfx/hitracemeter-overview.md b/en/application-dev/dfx/hitracemeter-overview.md
index 3683092b34fcd23a65245303406934b3fb8acad5..649fa7704dd566ab8bc02776de6f62756d7f26a6 100644
--- a/en/application-dev/dfx/hitracemeter-overview.md
+++ b/en/application-dev/dfx/hitracemeter-overview.md
@@ -15,4 +15,4 @@ hiTraceMeter is a tool for you to trace service processes and monitor system per
## Constraints
-- Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only asynchronous APIs.
+Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only asynchronous APIs.
diff --git a/en/application-dev/internationalization/i18n-guidelines.md b/en/application-dev/internationalization/i18n-guidelines.md
index 66b002200fc1c1965f1d3e741739685ae97236e6..0e34d66d523abea51e259bbcea5d7be08e755e3e 100644
--- a/en/application-dev/internationalization/i18n-guidelines.md
+++ b/en/application-dev/internationalization/i18n-guidelines.md
@@ -23,57 +23,64 @@ You can use APIs provided in the following table to obtain the system language a
### How to Develop
-1. Obtain the system language.
+1. Obtain the system language.
+
Call the **getSystemLanguage** method to obtain the system language (**i18n** is the name of the imported module).
- ```
+ ```js
var language = i18n.getSystemLanguage();
```
-2. Obtain the system region.
+2. Obtain the system region.
+
Call the **getSystemRegion** method to obtain the system region.
- ```
+ ```js
var region = i18n.getSystemRegion();
```
-3. Obtain the system locale.
+3. Obtain the system locale.
+
Call the **getSystemLocale** method to obtain the system locale.
- ```
+ ```js
var locale = i18n.getSystemLocale();
```
-4. Check whether the locale's language is RTL.
+4. Check whether the locale's language is RTL.
+
Call the **isRTL** method to check whether the locale's language is RTL.
- ```
+ ```js
var rtl = i18n.isRTL("zh-CN");
```
-5. Check whether the system uses a 24-hour clock.
+5. Check whether the system uses a 24-hour clock.
+
Call the **is24HourClock** method to check whether the system uses a 24-hour clock.
- ```
+ ```js
var hourClock = i18n.is24HourClock();
```
-6. Obtain the localized display of a language.
+6. Obtain the localized display of a language.
+
Call the **getDisplayLanguage** method to obtain the localized display of a language. **language** indicates the language to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
- ```
+ ```js
var language = "en";
var locale = "zh-CN";
var sentenceCase = false;
var localizedLanguage = i18n.getDisplayLanguage(language, locale, sentenceCase);
```
-7. Obtain the localized display of a country.
+7. Obtain the localized display of a country.
+
Call the **getDisplayCountry** method to obtain the localized display of a country name. **country** indicates the country code (a two-letter code in compliance with ISO-3166, for example, CN), **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
- ```
+ ```js
var country = "US";
var locale = "zh-CN";
var sentenceCase = false;
@@ -106,70 +113,78 @@ You can use APIs provided in the following table to obtain the system language a
### How to Develop
-1. Instantiate a **Calendar** object.
+1. Instantiate a **Calendar** object.
+
Call the **getCalendar** method to obtain the time zone object of a specific locale and type (**i18n** is the name of the imported module). **type** indicates the valid calendar type, for example, **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic_civil**, **islamic_tbla**, **islamic_umalqura**, **japanese**, and **persian**. If **type** is left unspecified, the default calendar type of the locale is used.
- ```
+ ```js
var calendar = i18n.getCalendar("zh-CN", "gregory);
```
-2. Set the time for the **Calendar** object.
+2. Set the time for the **Calendar** object.
+
Call the **setTime** method to set the time of the **Calendar** object. This method receives two types of parameters. One is a **Date** object, and the other is a value indicating the number of milliseconds elapsed since January 1, 1970, 00:00:00 GMT.
- ```
+ ```js
var date1 = new Date();
calendar.setTime(date1);
var date2 = 1000;
calendar.setTime(date2);
```
-3. Set the year, month, day, hour, minute, and second for the **Calendar** object.
+3. Set the year, month, day, hour, minute, and second for the **Calendar** object.
+
Call the **set** method to set the year, month, day, hour, minute, and second for the **Calendar** object.
- ```
+ ```js
calendar.set(2021, 12, 21, 6, 0, 0)
```
-4. Set and obtain the time zone for the **Calendar** object.
+4. Set and obtain the time zone for the **Calendar** object.
+
Call the **setTimeZone** and **getTimeZone** methods to set and obtain the time zone for the **Calendar** object. The **setTimeZone** method requires an input string to indicate the time zone to be set.
- ```
+ ```js
calendar.setTimeZone("Asia/Shanghai");
var timezone = calendar.getTimeZone();
```
-5. Set and obtain the first day of a week for the **Calendar** object.
+5. Set and obtain the first day of a week for the **Calendar** object.
+
Call the **setFirstDayOfWeek** and **getFirstDayOfWeek** methods to set and obtain the first day of a week for the **Calendar** object. **setFirstDayOfWeek** must be set to a value indicating the first day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.
- ```
+ ```js
calendar.setFirstDayOfWeek(1);
var firstDayOfWeek = calendar.getFirstDayOfWeek();
```
-6. Set and obtain the minimum count of days in the first week for the **Calendar** object.
+6. Set and obtain the minimum count of days in the first week for the **Calendar** object.
+
Call the **setMinimalDaysInFirstWeek** and **getMinimalDaysInFirstWeek** methods to set and obtain the minimum count of days in the first week for the **Calendar** object.
- ```
+ ```js
calendar.setMinimalDaysInFirstWeek(3);
var minimalDaysInFirstWeek = calendar.getMinimalDaysInFirstWeek();
```
-7. Obtain the localized display of the **Calendar** object.
+7. Obtain the localized display of the **Calendar** object.
+
Call the **getDisplayName** method to obtain the localized display of the **Calendar** object.
- ```
+ ```js
var localizedName = calendar.getDisplayName("zh-CN");
```
-8. Check whether a date is a weekend.
+8. Check whether a date is a weekend.
+
Call the **isWeekend** method to determine whether the input date is a weekend.
- ```
+ ```js
var date = new Date();
var weekend = calendar.isWeekend(date);
```
@@ -191,25 +206,26 @@ You can use APIs provided in the following table to obtain the system language a
### How to Develop
-1. Instantiate a **PhoneNumberFormat** object.
+1. Instantiate a **PhoneNumberFormat** object.
+
Call the **PhoneNumberFormat** constructor to instantiate a **PhoneNumberFormat** object. The country code and formatting options of the phone number need to be passed into this constructor. The formatting options are optional, including a style option. Values of this option include: **E164**, **INTERNATIONAL**, **NATIONAL**, and **RFC3966**.
- ```
+ ```js
var phoneNumberFormat = new i18n.PhoneNumberFormat("CN", {type: "E164"});
```
2. Check whether the phone number format is correct.
Call the **isValidNumber** method to check whether the format of the input phone number is correct.
- ```
+ ```js
var validNumber = phoneNumberFormat.isValidNumber("15812341234");
```
3. Format a phone number.
Call the **format** method of **PhoneNumberFormat** to format the input phone number.
- ```
+ ```js
var formattedNumber = phoneNumberFormat.format("15812341234");
```
@@ -232,7 +248,7 @@ The **unitConvert** API is provided to help you implement measurement conversion
Call the [unitConvert](../reference/apis/js-apis-intl.md) method to convert a measurement unit and format the display result.
- ```
+ ```js
var fromUnit = {unit: "cup", measureSystem: "US"};
var toUnit = {unit: "liter", measureSystem: "SI"};
var number = 1000;
@@ -259,32 +275,36 @@ The **unitConvert** API is provided to help you implement measurement conversion
### How to Develop
-1. Instantiate an **IndexUtil** object.
+1. Instantiate an **IndexUtil** object.
+
Call the **getInstance** method to instantiate an **IndexUtil** object for a specific locale. When the **locale** parameter is empty, instantiate an **IndexUtil** object of the default locale.
- ```
+ ```js
var indexUtil = getInstance("zh-CN");
```
-2. Obtain the index list.
+2. Obtain the index list.
+
Call the **getIndexList** method to obtain the alphabet index list of the current locale.
- ```
+ ```js
var indexList = indexUtil.getIndexList();
```
-3. Add an index.
+3. Add an index.
+
Call the **addLocale** method to add the alphabet index of a new locale to the current index list.
- ```
+ ```js
indexUtil.addLocale("ar")
```
-4. Obtain the index of a string.
+4. Obtain the index of a string.
+
Call the **getIndex** method to obtain the alphabet index of a string.
- ```
+ ```js
var text = "access index";
indexUtil.getIndex(text);
```
@@ -313,38 +333,42 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api
### How to Develop
-1. Instantiate a **BreakIterator** object.
+1. Instantiate a **BreakIterator** object.
+
Call the **getLineInstance** method to instantiate a **BreakIterator** object.
- ```
+ ```js
var locale = "en-US"
var breakIterator = i18n.getLineInstance(locale);
```
-2. Set and access the text that requires line breaking.
+2. Set and access the text that requires line breaking.
+
Call the **setLineBreakText** and **getLineBreakText** methods to set and access the text that requires line breaking.
- ```
+ ```js
var text = "Apple is my favorite fruit";
breakIterator.setLineBreakText(text);
var breakText = breakIterator.getLineBreakText();
```
-3. Obtain the current position of the **BreakIterator** object.
+3. Obtain the current position of the **BreakIterator** object.
+
Call the **current** method to obtain the current position of the **BreakIterator** object in the text being processed.
- ```
+ ```js
var pos = breakIterator.current();
```
-4. Set the position of a **BreakIterator** object.
+4. Set the position of a **BreakIterator** object.
+
The following APIs are provided to adjust the **first**, **last**, **next**, **previous**, or **following** position of the **BreakIterator** object in the text to be processed.
- ```
+ ```js
var firstPos = breakIterator.first(); // Set a BreakIterator object to the first break point, that is, the start position of the text.
var lastPos = breakIterator.last(); // Set a BreakIterator object to the last break point, that is, the position after the text end.
// Move a BreakIterator object forward or backward by a certain number of break points.
@@ -356,10 +380,11 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api
var followingPos = breakIterator.following(10);
```
-5. Determine whether a position is a break point.
+5. Determine whether a position is a break point.
+
Call the **isBoundary** method to determine whether a position is a break point. If yes, **true** is returned and the **BreakIterator** object is moved to this position. If no, **false** is returned and the **BreakIterator** object is moved to a break point after this position.
- ```
+ ```js
var isboundary = breakIterator.isBoundary(5);
```
diff --git a/en/application-dev/internationalization/intl-guidelines.md b/en/application-dev/internationalization/intl-guidelines.md
index 09bc3b733346db921cd04b76aff04b41d60af0b9..44748056f7886d4817cda2d9d0504f6966c32700 100644
--- a/en/application-dev/internationalization/intl-guidelines.md
+++ b/en/application-dev/internationalization/intl-guidelines.md
@@ -3,7 +3,8 @@
This module provides basic I18N capabilities, such as time and date formatting, number formatting, and string sorting, through the standard I18N interfaces defined in ECMA 402.
The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities through supplementary interfaces that are not defined in ECMA 402. It works with the Intl module to provide a complete suite of I18N capabilities.
-> **NOTE**
+> **NOTE**
+>
> In the code snippets in this document, **intl** refers to the name of the imported module.
## Setting Locale Information
@@ -24,7 +25,8 @@ Use [Locale](../reference/apis/js-apis-intl.md) APIs to maximize or minimize loc
### How to Develop
-1. Instantiate a **Locale** object.
+1. Instantiate a **Locale** object.
+
Create a **Locale** object by using the **Locale** constructor. This method receives a string representing the locale and an optional [Attributes](../reference/apis/js-apis-intl.md) list.
A **Locale** object consists of four parts: language, script, region, and extension, which are separated by using a hyphen (-).
@@ -42,30 +44,33 @@ Use [Locale](../reference/apis/js-apis-intl.md) APIs to maximize or minimize loc
| kf | Whether upper case or lower case is considered when sorting or comparing strings.|
- ```
+ ```js
var locale = "zh-CN";
var options = {caseFirst: false, calendar: "chinese", collation: pinyin};
var localeObj = new intl.Locale(locale, options);
```
-2. Obtain the string representing a **Locale** object.
+2. Obtain the string representing a **Locale** object.
+
Call the **toString** method to obtain the string representing a **Locale** object, which includes the language, region, and other options.
- ```
+ ```js
var localeStr = localeObj.toString();
```
-3. Maximize locale information.
+3. Maximize locale information.
+
Call the **maximize** method to maximize locale information; that is, supplement the missing script and region information.
- ```
+ ```js
var maximizedLocale = localeObj.maximize();
```
-4. Minimize locale information.
+4. Minimize locale information.
+
Call the **minimize** method to minimize locale information; that is, delete the unnecessary script and region information.
- ```
+ ```js
var minimizedLocale = localeObj.minimize();
```
@@ -88,42 +93,46 @@ Use [DateTimeFormat](../reference/apis/js-apis-intl.md) APIs to format the date
### How to Develop
-1. Instantiate a **DateTimeFormat** object.
+1. Instantiate a **DateTimeFormat** object.
+
Use the default constructor of **DateTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **DateTimeFormat** object.
- ```
+ ```js
var dateTimeFormat = new intl.DateTimeFormat();
```
Alternatively, use your own locale and formatting parameters to create a **DateTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [DateTimeOptions](../reference/apis/js-apis-intl.md).
- ```
+ ```js
var options = {dateStyle: "full", timeStyle: "full"};
var dateTimeFormat = new intl.DateTimeFormat("zh-CN", options);
```
-2. Format the date and time.
+2. Format the date and time.
+
Call the **format** method to format the date and time in the **DateTimeFormat** object. This method returns a string representing the formatting result.
- ```
+ ```js
Date date = new Date();
var formatResult = dateTimeFormat.format(date);
```
-3. Format a period.
+3. Format a period.
+
Call the **formatRange** method to format the period in the **DateTimeFormat** object. This method requires input of two **Date** objects, which respectively indicate the start date and end date of a period. This method returns a string representing the formatting result.
- ```
+ ```js
Date startDate = new Date();
Date endDate = new Date();
var formatResult = dateTimeFormat.formatRange(startDate, endDate);
```
-4. Obtain attributes of the **DateTimeFormat** object.
+4. Obtain attributes of the **DateTimeFormat** object.
+
Call the **resolvedOptions** method to obtain attributes of the **DateTimeFormat** object. This method will return an array that contains all attributes and values of the object.
- ```
+ ```js
var options = dateTimeFormat.resolvedOptions();
```
@@ -145,33 +154,36 @@ Use [NumberFormat](../reference/apis/js-apis-intl.md) APIs to format numbers for
### How to Develop
-1. Instantiate a **NumberFormat** object.
+1. Instantiate a **NumberFormat** object.
+
Use the default constructor of **NumberFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **NumberFormat** object.
- ```
+ ```js
var numberFormat = new intl.NumberFormat();
```
Alternatively, use your own locale and formatting parameters to create a **NumberFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [NumberOptions](../reference/apis/js-apis-intl.md).
- ```
+ ```js
var options = {compactDisplay: "short", notation: "compact"};
var numberFormat = new intl.NumberFormat("zh-CN", options);
```
-2. Format a number.
+2. Format a number.
+
Call the **format** method to format a number. A string is returned as the formatting result.
- ```
+ ```js
var number = 1234.5678
var formatResult = numberFormat.format(number);
```
-3. Obtain attributes of the **NumberFormat** object.
+3. Obtain attributes of the **NumberFormat** object.
+
Call the **resolvedOptions** method to obtain attributes of the **NumberFormat** object. This method will return an array that contains all attributes and values of the object.
- ```
+ ```js
var options = numberFormat.resolvedOptions();
```
@@ -193,33 +205,36 @@ Use [Collator](../reference/apis/js-apis-intl.md) APIs to sort strings based on
### How to Develop
-1. Instantiate a **Collator** object.
+1. Instantiate a **Collator** object.
+
Use the default constructor of **Collator** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **Collator** object.
- ```
+ ```js
var collator = new intl.Collator();
```
Alternatively, use your own locale and formatting parameters to create a **Collator** object. For a full list of parameters, see [CollatorOptions](../reference/apis/js-apis-intl.md).
+ ```js
+ var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"});
```
- var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"};
- ```
-2. Compare two strings.
+2. Compare two strings.
+
Call the **compare** method to compare two input strings. This method returns a value as the comparison result. The return value **-1** indicates that the first string is shorter than the second string, the return value **1** indicates that the first string is longer than the second string, and the return value **0** indicates that the two strings are of equal lengths.
- ```
+ ```js
var str1 = "first string";
var str2 = "second string";
var compareResult = collator.compare(str1, str2);
```
-3. Obtain attributes of the **Collator** object.
+3. Obtain attributes of the **Collator** object.
+
Call the **resolvedOptions** method to obtain attributes of the **Collator** object. This method will return an array that contains all attributes and values of the object.
- ```
+ ```js
var options = collator.resolvedOptions();
```
@@ -240,24 +255,26 @@ Use [PluralRules](../reference/apis/js-apis-intl.md) APIs to determine the singu
### How to Develop
-1. Instantiate a **PluralRules** object.
+1. Instantiate a **PluralRules** object.
+
Use the default constructor of **PluralRules** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **PluralRules** object.
- ```
+ ```js
var pluralRules = new intl.PluralRules();
```
Alternatively, use your own locale and formatting parameters to create a **PluralRules** object. For a full list of parameters, see [PluralRulesOptions](../reference/apis/js-apis-intl.md).
- ```
- var plurals = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"};
+ ```js
+ var plurals = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"});
```
-2. Determine the singular-plural type.
+2. Determine the singular-plural type.
+
Call the **select** method to determine the singular-plural type of an input number. This method will return a string representing the singular-plural type, which can be any of the following: **zero**, **one**, **two**, **few**, **many**, and **other**.
- ```
+ ```js
var number = 1234.5678
var categoryResult = plurals.select(number);
```
@@ -281,41 +298,45 @@ Use [RelativeTimeFormat](../reference/apis/js-apis-intl.md) APIs to format the r
### How to Develop
-1. Instantiate a **RelativeTimeFormat** object.
+1. Instantiate a **RelativeTimeFormat** object.
+
Use the default constructor of **RelativeTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **RelativeTimeFormat** object.
- ```
+ ```js
var relativeTimeFormat = new intl.RelativeTimeFormat();
```
Alternatively, use your own locale and formatting parameters to create a **RelativeTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [ RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md).
+ ```js
+ var relativeTimeFormat = new intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"});
```
- var relativeTimeFormat = new intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"};
- ```
-2. Format the relative time.
+2. Format the relative time.
+
Call the **format** method to format the relative time. This method receives a numeric value representing the time length and a string-form unit, like **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, and **second**. This method returns a string representing the formatting result.
- ```
+ ```js
var number = 2;
var unit = "year"
var formatResult = relativeTimeFormat.format(number, unit);
```
-3. Obtain each part of the relative time format.
+3. Obtain each part of the relative time format.
+
Upon obtaining each part of the relative time format, customize the relative time formatting result.
- ```
+ ```js
var number = 2;
var unit = "year"
var formatResult = relativeTimeFormat.formatToParts(number, unit);
```
-4. Obtain attributes of the **RelativeTimeFormat** object.
+4. Obtain attributes of the **RelativeTimeFormat** object.
+
Call the **resolvedOptions** method to obtain attributes of the **RelativeTimeFormat** object. This method will return an array that contains all attributes and values of the object. For a full list of attributes, see [ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md).
- ```
+ ```js
var options = numberFormat.resolvedOptions();
```
diff --git a/en/application-dev/media/Readme-EN.md b/en/application-dev/media/Readme-EN.md
index b9f7b63d5b451da5213a8c282d52865d48c4e3eb..677e70f6e3b7eee215530cd15e7ab1b42676866c 100755
--- a/en/application-dev/media/Readme-EN.md
+++ b/en/application-dev/media/Readme-EN.md
@@ -1,7 +1,6 @@
# Media
- Audio
-
- [Audio Overview](audio-overview.md)
- [Audio Playback Development](audio-playback.md)
- [Audio Recording Development](audio-recorder.md)
@@ -15,9 +14,9 @@
- [Video Playback Development](video-playback.md)
- [Video Recording Development](video-recorder.md)
-- Image
+- Image
- [Image Development](image.md)
-- Camera
+- Camera
- [Camera Development](camera.md)
diff --git a/en/application-dev/media/audio-interruptmode.md b/en/application-dev/media/audio-interruptmode.md
index 9f9355f68c326ec9b6ae8140a6579114bfaefcc3..8be8a00cedd10ff4ecd08ee46d746d9803b3c71a 100644
--- a/en/application-dev/media/audio-interruptmode.md
+++ b/en/application-dev/media/audio-interruptmode.md
@@ -48,7 +48,7 @@ For details about the APIs, see [AudioRenderer in Audio Management](../reference
```js
var mode_ = audio.InterruptMode.SHARE_MODE;
- await this.audioRenderer.setInterruptMode(mode_).then(()=>{
+ await this.audioRenderer.setInterruptMode(mode_).then(() => {
console.log('[JSAR] [SetInterruptMode] Setting: '+ (mode_ == 0? " share mode":"independent mode") + "success");
});
```
diff --git a/en/application-dev/media/audio-playback.md b/en/application-dev/media/audio-playback.md
index 2b0f260908c9e2986269601e588659ce6ce119fc..d65d0abfc4d4649f7f1847abdbe6fb0a832e194e 100644
--- a/en/application-dev/media/audio-playback.md
+++ b/en/application-dev/media/audio-playback.md
@@ -39,38 +39,38 @@ function printfDescription(obj) {
// Set the player callbacks.
function setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the `dataLoad` event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
- audioPlayer.play(); // The play() API can be invoked only after the 'dataLoad' event callback is complete. The 'play' event callback is then triggered.
+ audioPlayer.play(); // The play() API can be invoked only after the 'dataLoad' event callback is complete. The 'play' event callback is then triggered.
});
- audioPlayer.on('play', () => { // Set the 'play' event callback.
+ audioPlayer.on('play', () => { // Set the `play` event callback.
console.info('audio play success');
- audioPlayer.pause(); // Trigger the 'pause' event callback and pause the playback.
+ audioPlayer.pause(); // Trigger the 'pause' event callback and pause the playback.
});
- audioPlayer.on('pause', () => { // Set the 'pause' event callback.
+ audioPlayer.on('pause', () => { // Set the `pause` event callback.
console.info('audio pause success');
- audioPlayer.seek(5000); // Trigger the 'timeUpdate' event callback, and seek to 5000 ms for playback.
+ audioPlayer.seek(5000); // Trigger the 'timeUpdate' event callback, and seek to 5000 ms for playback.
});
- audioPlayer.on('stop', () => { // Set the 'stop' event callback.
+ audioPlayer.on('stop', () => { // Set the `stop` event callback.
console.info('audio stop success');
- audioPlayer.reset(); // Trigger the 'reset' event callback, and reconfigure the src attribute to switch to the next song.
+ audioPlayer.reset(); // Trigger the 'reset' event callback, and reconfigure the src attribute to switch to the next song.
});
- audioPlayer.on('reset', () => { // Set the 'reset' event callback.
+ audioPlayer.on('reset', () => { // Set the `reset` event callback.
console.info('audio reset success');
- audioPlayer.release(); // Release the AudioPlayer instance.
+ audioPlayer.release(); // Release the AudioPlayer instance.
audioPlayer = undefined;
});
- audioPlayer.on('timeUpdate', (seekDoneTime) => {// Set the 'timeUpdate' event callback.
+ audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the `timeUpdate` event callback.
if (typeof(seekDoneTime) == 'undefined') {
console.info('audio seek fail');
return;
}
console.info('audio seek success, and seek time is ' + seekDoneTime);
- audioPlayer.setVolume(0.5); // Trigger the 'volumeChange' event callback.
+ audioPlayer.setVolume(0.5); // Trigger the 'volumeChange' event callback.
});
- audioPlayer.on('volumeChange', () => { // Set the 'volumeChange' event callback.
+ audioPlayer.on('volumeChange', () => { // Set the `volumeChange` event callback.
console.info('audio volumeChange success');
- audioPlayer.getTrackDescription((error, arrlist) => { // Obtain the audio track information in callback mode.
+ audioPlayer.getTrackDescription((error, arrlist) => { // Obtain the audio track information in callback mode.
if (typeof (arrlist) != 'undefined') {
for (let i = 0; i < arrlist.length; i++) {
printfDescription(arrlist[i]);
@@ -78,13 +78,13 @@ function setCallBack(audioPlayer) {
} else {
console.log(`audio getTrackDescription fail, error:${error.message}`);
}
- audioPlayer.stop(); // Trigger the 'stop' event callback to stop the playback.
+ audioPlayer.stop(); // Trigger the 'stop' event callback to stop the playback.
});
});
- audioPlayer.on('finish', () => { // Set the 'finish' event callback, which is triggered when the playback is complete.
+ audioPlayer.on('finish', () => { // Set the 'finish' event callback, which is triggered when the playback is complete.
console.info('audio play finish');
});
- audioPlayer.on('error', (error) => { // Set the 'error' event callback.
+ audioPlayer.on('error', (error) => { // Set the 'error' event callback.
console.info(`audio error called, errName is ${error.name}`);
console.info(`audio error called, errCode is ${error.code}`);
console.info(`audio error called, errMessage is ${error.message}`);
@@ -94,7 +94,7 @@ function setCallBack(audioPlayer) {
async function audioPlayerDemo() {
// 1. Create an AudioPlayer instance.
let audioPlayer = media.createAudioPlayer();
- setCallBack(audioPlayer); // Set the event callbacks.
+ setCallBack(audioPlayer); // Set the event callbacks.
// 2. Set the URI of the audio file.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
@@ -107,7 +107,7 @@ async function audioPlayerDemo() {
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = fdPath; // Set the src attribute and trigger the `dataLoad` event callback.
}
```
@@ -119,23 +119,23 @@ import fileIO from '@ohos.fileio'
export class AudioDemo {
// Set the player callbacks.
setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the `dataLoad` event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
- audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
+ audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
});
- audioPlayer.on('play', () => { // Set the 'play' event callback.
+ audioPlayer.on('play', () => { // Set the `play` event callback.
console.info('audio play success');
});
- audioPlayer.on('finish', () => { // Set the 'finish' event callback, which is triggered when the playback is complete.
+ audioPlayer.on('finish', () => { // Set the 'finish' event callback, which is triggered when the playback is complete.
console.info('audio play finish');
- audioPlayer.release(); // Release the AudioPlayer instance.
+ audioPlayer.release(); // Release the AudioPlayer instance.
audioPlayer = undefined;
});
}
async audioPlayerDemo() {
- let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
- this.setCallBack(audioPlayer); // Set the event callbacks.
+ let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
+ this.setCallBack(audioPlayer); // Set the event callbacks.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
@@ -147,7 +147,7 @@ export class AudioDemo {
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = fdPath; // Set the src attribute and trigger the `dataLoad` event callback.
}
}
```
@@ -161,20 +161,20 @@ export class AudioDemo {
// Set the player callbacks.
private isNextMusic = false;
setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the `dataLoad` event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
- audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
+ audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
});
- audioPlayer.on('play', () => { // Set the 'play' event callback.
+ audioPlayer.on('play', () => { // Set the `play` event callback.
console.info('audio play success');
- audioPlayer.reset(); // Call the reset() API and trigger the 'reset' event callback.
+ audioPlayer.reset(); // Call the reset() API and trigger the 'reset' event callback.
});
- audioPlayer.on('reset', () => { // Set the 'reset' event callback.
+ audioPlayer.on('reset', () => { // Set the `reset` event callback.
console.info('audio play success');
- if (!this.isNextMusic) { // When isNextMusic is false, changing songs is implemented.
- this.nextMusic(audioPlayer); // Changing songs is implemented.
+ if (!this.isNextMusic) { // When isNextMusic is false, changing songs is implemented.
+ this.nextMusic(audioPlayer); // Changing songs is implemented.
} else {
- audioPlayer.release(); // Release the AudioPlayer instance.
+ audioPlayer.release(); // Release the AudioPlayer instance.
audioPlayer = undefined;
}
});
@@ -197,8 +197,8 @@ export class AudioDemo {
}
async audioPlayerDemo() {
- let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
- this.setCallBack(audioPlayer); // Set the event callbacks.
+ let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
+ this.setCallBack(audioPlayer); // Set the event callbacks.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
@@ -223,19 +223,19 @@ import fileIO from '@ohos.fileio'
export class AudioDemo {
// Set the player callbacks.
setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the `dataLoad` event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
- audioPlayer.loop = true; // Set the loop playback attribute.
- audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
+ audioPlayer.loop = true; // Set the loop playback attribute.
+ audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
});
- audioPlayer.on('play', () => { // Set the 'play' event callback to start loop playback.
+ audioPlayer.on('play', () => { // Set the 'play' event callback to start loop playback.
console.info('audio play success');
});
}
async audioPlayerDemo() {
- let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
- this.setCallBack(audioPlayer); // Set the event callbacks.
+ let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
+ this.setCallBack(audioPlayer); // Set the event callbacks.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
@@ -247,7 +247,7 @@ export class AudioDemo {
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = fdPath; // Set the src attribute and trigger the `dataLoad` event callback.
}
}
```
diff --git a/en/application-dev/quick-start/Readme-EN.md b/en/application-dev/quick-start/Readme-EN.md
index f44905cb2c2d33a8efb52f80d01e199e674e2c5b..77038cc101186059e9377c85d8e5b880784c2b9e 100644
--- a/en/application-dev/quick-start/Readme-EN.md
+++ b/en/application-dev/quick-start/Readme-EN.md
@@ -9,6 +9,5 @@
- Development Fundamentals
- [Application Package Structure Configuration File (FA Model)](package-structure.md)
- [Application Package Structure Configuration File (Stage Model)](stage-structure.md)
- - [Resource File Categories](basic-resource-file-categories.md)
- [SysCap](syscap.md)
- [HarmonyAppProvision Configuration File](app-provision-structure.md)
diff --git a/en/application-dev/quick-start/basic-resource-file-categories.md b/en/application-dev/quick-start/basic-resource-file-categories.md
deleted file mode 100644
index e37a24074d5396103b9204f3c6ab20a745de2616..0000000000000000000000000000000000000000
--- a/en/application-dev/quick-start/basic-resource-file-categories.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# Resource File Categories
-
-
-## resources Directory
-
-All the application resource files, such as strings, images, and audio files, are stored in the **resources** directory, allowing you to easily access, use, and maintain them. The **resources** directory consists of two types of sub-directories: the **base** sub-directory and qualifiers sub-directories, and the **rawfile** sub-directory. For details, see Categories of the **resources** directory.
-
-Example of the **resources** directory:
-
-```
-resources
-|---base // Default sub-directory
-| |---element
-| | |---string.json
-| |---media
-| | |---icon.png
-|---en_GB-vertical-car-mdpi // Example of a qualifiers sub-directory, which needs to be created on your own
-| |---element
-| | |---string.json
-| |---media
-| | |---icon.png
-|---rawfile // Default sub-directory
-```
-
-**Table 1** Categories of the **resources** directory
-
-| Category | base and Qualifiers Sub-directories | rawfile Sub-directory |
-| ----------- | ---------------------------------------- | ---------------------------------------- |
-| Structure | Sub-directories are structured in two levels. The directory name must comply with specified naming conventions so that its target resource file in the correct directory can be matched based on the device status. The **base** sub-directory and qualifiers sub-directories are the first level of sub-directories under **resources**. - The **base** sub-directory is generated by default. If no qualifiers sub-directories in the **resources** directory of the application match the device status, the resource file in the **base** sub-directory will be automatically referenced. - You need to create qualifiers sub-directories on your own. Each directory name consists of one or more qualifiers that represent the application scenarios or device characteristics. For details, see [Qualifiers Sub-directories](#qualifiers-sub-directories). Resource group sub-directories are located at the second level of sub-directories to store basic elements such as strings, colors, and boolean values, as well as resource files such as media, animations, and layouts. For details, see [Resource Group Sub-directories](#resource-group-sub-directories). | You can create multiple levels of sub-directories with custom directory names. They can be used to store various resource files. However, resource files in the **rawfile** sub-directory will not be matched based on the device status. |
-| Compilation | Resource files in the sub-directories are compiled into binary files, and each resource file is assigned an ID. | Resource files in the sub-directory are directly packed into the application without being compiled, and no IDs will be assigned to the resource files. |
-| Reference | Resource files in the sub-directories are referenced based on the resource type and resource name. | Resource files in the sub-directories are referenced based on the specified file path and file name. |
-
-
-## Qualifiers Sub-directories
-
-The name of a qualifiers sub-directory consists of one or more qualifiers that represent the application scenarios or device characteristics, covering the mobile country code (MCC), mobile network code (MNC), language, script, country or region, screen orientation, device type, color mode, and screen density. The qualifiers are separated using underscores (_) or hyphens (-). When creating a qualifiers sub-directory, you need to understand the directory naming conventions and the rules for matching qualifiers sub-directories and the device status.
-
-**Naming Conventions for Qualifiers Sub-directories**
-
-- Qualifiers are ordered in the following sequence: _MCC_MNC-language_script_country/region-screen orientation-device type-color mode-screen density_. You can select one or multiple qualifiers to name your sub-directory based on your application scenarios and device characteristics.
-
-- Separation between qualifiers: The language, script, and country/region qualifiers are separated using underscores (\_); the MNC and MCC qualifiers are also separated using underscores (\_); other qualifiers are separated using hyphens (-). For example, **zh_Hant_CN** and **zh_CN-car-ldpi**.
-
-- Value range of qualifiers: The value of each qualifier must meet the requirements. Otherwise, the resource files in the sub-directory cannot be matched.
-
- **Table 2** Requirements for qualifier values
-
- | Qualifier Type | Description and Value Range |
- | ------------------ | ---------------------------------------- |
- | MCC&MNC | Indicates the MCC and MNC, which are obtained from the network where the device is registered. The MCC can be either followed by the MNC with an underscore (_) in between or be used independently. For example, **mcc460** represents China, and **mcc460_mnc00** represents China Mobile. For details about the value range, refer to **ITU-T E.212** (the international identification plan for public networks and subscriptions). |
- | Language | Indicates the language used by the device. The value consists of two or three lowercase letters, for example, **zh** indicates Chinese, **en** indicates English, and **mai** indicates Maithili. For details about the value range, refer to **ISO 639** (codes for the representation of names of languages). |
- | Script | Indicates the script type used by the device. The value starts with one uppercase letter followed by three lowercase letters, for example, **Hans** indicates simplified Chinese and **Hant** indicates traditional Chinese. For details about the value range, refer to **ISO 15924** (codes for the representation of names of scripts). |
- | Country/Region | Indicates the country or region where a user is located. The value consists of two or three uppercase letters or three digits, for example, **CN** indicates China and **GB** indicates the United Kingdom. For details about the value range, refer to **ISO 3166-1** (codes for the representation of names of countries and their subdivisions). |
- | Screen orientation | Indicates the screen orientation of the device. The value can be: - **vertical**: portrait orientation - **horizontal**: landscape orientation |
- | Device type | Indicates the device type. The value can be: - **car**: head units - **tv**: smart TVs - **wearable**: wearables |
- | Color mode | Indicates the color mode of the device. The value can be: - **dark**: dark mode - **light**: light mode |
- | Screen density | Indicates the screen density of the device, in dpi. The value can be: - **sdpi**: screen density with small-scale dots per inch (SDPI). This value is applicable for devices with a DPI range of (0, 120]. - **mdpi**: screen density with medium-scale dots per inch (MDPI). This value is applicable for devices with a DPI range of (120, 160]. - **ldpi**: screen density with large-scale dots per inch (LDPI). This value is applicable for devices with a DPI range of (160, 240]. - **xldpi**: screen density with extra-large-scale dots per inch (XLDPI). This value is applicable for devices with a DPI range of (240, 320]. - **xxldpi**: screen density with extra-extra-large-scale dots per inch (XXLDPI). This value is applicable for devices with a DPI range of (320, 480]. - **xxxldpi**: screen density with extra-extra-extra-large-scale dots per inch (XXXLDPI). This value is applicable for devices with a DPI range of (480, 640]. |
-
-**Rules for Matching Qualifiers Sub-directories and Device Resources**
-
-- Qualifiers are matched with the device resources in the following priorities: MCC&MNC > locale (options: language, language_script, language_country/region, and language_script_country/region) > screen orientation > device type > color mode > screen density
-
-- If the qualifiers sub-directories contain the **MCC, MNC, language, script, screen orientation, device type, and color mode** qualifiers, their values must be consistent with the current device status so that the sub-directories can be used for matching the device resources. For example, the qualifiers sub-directory **zh_CN-car-ldpi** cannot be used for matching the resource files labeled **en_US**.
-
-
-## Resource Group Sub-directories
-
-You can create resource group sub-directories (including element, media, animation, layout, graphic, and profile) in the **base** and qualifiers sub-directories to store resource files of specific types. For details, see Resource group sub-directories.
-
-**Table 3** Resource group sub-directories
-
-| Resource Group Sub-directory | Description | Resource File |
-| ---------------------------- | ---------------------------------------- | ---------------------------------------- |
-| element | Indicates element resources. Each type of data is represented by a JSON file. The options are as follows: - **boolean**: boolean data - **color**: color data - **float**: floating-point data - **intarray**: array of integer - **integer**: integer data - **pattern**: pattern data - **plural**: plural form data - **strarray**: array of strings - **string**: string data | It is recommended that files in the **element** sub-directory be named the same as the following files, each of which can contain only data of the same type: - boolean.json - color.json - float.json - intarray.json - integer.json - pattern.json - plural.json - strarray.json - string.json |
-| media | Indicates media resources, including non-text files such as images, audios, and videos. | The file name can be customized, for example, **icon.png**. |
-| animation | Indicates animation resources, in XML format. | The file name can be customized, for example, **zoom_in.xml**. |
-| layout | Indicates layout resources, in XML format. | The file name can be customized, for example, **home_layout.xml**. |
-| graphic | Indicates graphic resources, in XML format. | The file name can be customized, for example, **notifications_dark.xml**. |
-| profile | Indicates other types of files, which are stored in their raw formats. | The file name can be customized. |
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655128646.png b/en/application-dev/quick-start/figures/en-us_image_0000001655128646.png
new file mode 100644
index 0000000000000000000000000000000000000000..048b8e07817272b759781df104c1dd4526685d61
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655128646.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655128939.png b/en/application-dev/quick-start/figures/en-us_image_0000001655128939.png
new file mode 100644
index 0000000000000000000000000000000000000000..606ce3a0eab0a39f166029182bcc2f70291740d6
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655128939.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655128998.png b/en/application-dev/quick-start/figures/en-us_image_0000001655128998.png
new file mode 100644
index 0000000000000000000000000000000000000000..d044d5d829ab1ad805f4ffcda19837f867b976fc
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655128998.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655129041.png b/en/application-dev/quick-start/figures/en-us_image_0000001655129041.png
new file mode 100644
index 0000000000000000000000000000000000000000..2dd664a2b25751cc32bd81927b30036d5cc4f351
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655129041.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655129232.png b/en/application-dev/quick-start/figures/en-us_image_0000001655129232.png
new file mode 100644
index 0000000000000000000000000000000000000000..7d3222667d7bffe89a148dc3b08861a86c43713e
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655129232.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655129264.png b/en/application-dev/quick-start/figures/en-us_image_0000001655129264.png
new file mode 100644
index 0000000000000000000000000000000000000000..c188c864c051f68984ecc0c4c64be83f0dd6e1e9
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655129264.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655129333.png b/en/application-dev/quick-start/figures/en-us_image_0000001655129333.png
new file mode 100644
index 0000000000000000000000000000000000000000..b42f2e3896d334d86e89b867cf3428782f88d600
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655129333.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655129372.png b/en/application-dev/quick-start/figures/en-us_image_0000001655129372.png
new file mode 100644
index 0000000000000000000000000000000000000000..8541c80810d3f3dfb7180fede34a51221dc56106
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655129372.png differ
diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001655129398.png b/en/application-dev/quick-start/figures/en-us_image_0000001655129398.png
new file mode 100644
index 0000000000000000000000000000000000000000..2dda1a5cfca8d75d70e40b8bc0d555faade04583
Binary files /dev/null and b/en/application-dev/quick-start/figures/en-us_image_0000001655129398.png differ
diff --git a/en/application-dev/quick-start/full-sdk-switch-guide.md b/en/application-dev/quick-start/full-sdk-switch-guide.md
new file mode 100644
index 0000000000000000000000000000000000000000..4c20e429bdef97ab0503614d01f1807e56eedb13
--- /dev/null
+++ b/en/application-dev/quick-start/full-sdk-switch-guide.md
@@ -0,0 +1,98 @@
+# Guide to Switching to Full SDK
+
+Both the public SDK and full SDK are toolkits for application development.
+
+The public SDK is intended for application developers and provided as standard in DevEco Studio. It does not contain system APIs – APIs required by system applications.
+
+The full SDK is intended for original equipment manufacturers (OEMs) and provided separately. It contains system APIs.
+
+The SDK of API version 8 provided in DevEco Studio is a public SDK. If your project depends on any system API, such as the **animator** component, **xcomponent** component, or APIs in **@ohos.application.abilityManager.d.ts**, **@ohos.application.formInfo.d.ts**, or **@ohos.bluetooth.d.ts**, switch to the full SDK by performing the following steps.
+
+## Downloading the Full SDK (of 3.1.1 Release in this example)
+
+Manually download the full SDK. For details, see the source code acquisition section in [OpenHarmony 3.1.1 Release](https://gitee.com/openharmony/docs/blob/master/en/release-notes/OpenHarmony-v3.1.1-release.md).
+
+
+
+
+
+
+## Checking the Local SDK Location In this example, an eTS project is used. For a JS project, replace **ets** with **js**.
+
+In DevEco Studio, choose **Tools** > **OpenHarmony SDK Manager** to check the location of the local SDK.
+
+
+
+
+
+
+## Replacing the SDK
+
+1. Make sure the downloaded SDK is a full SDK.
+
+ a. Verify that the name of the downloaded file contains **sdk-full**.
+
+ 
+
+ b. Verify that the SDK contains system APIs (such as APIs defined in **@ohos.application.abilityManager.d.ts**, **@ohos.application.formInfo.d.ts**, and **@ohos.bluetooth.d.ts**).
+
+ Note: The criteria for identifying system APIs are subject to the released API documentation.
+
+
+
+2. Replace the SDK. The following uses full SDK 3.1.6.6 for Windows as an example.
+
+
+
+ a. Decompress the downloaded full SDK file: `ets-windows-3.1.6.5-Release.zip`
+
+ 
+
+ b. Replace the SDK files.
+
+ Back up the local SDK files. (Copy and rename the version number directory in the **ets** directory, or copy the entire **ets** directory to another local path.)
+
+ Go to the obtained location of the local installed SDK and back up the files therein.
+
+ 
+
+ Note: The name of the backup version number directory must be different from the value of **version** field in the **oh-uni-package.json** file. In the example below, the name of the backup version number directory is **3.1.6.6_backup**.
+
+ 
+
+ The configuration in the **oh-uni-package.json** file is as follows:
+
+ ```
+ {
+ "apiVersion": "8",
+ "displayName": "Ets",
+ "meta": {
+ "metaVersion": "3.0.0"
+ },
+ "path": "ets",
+ "releaseType": "Release",
+ "version": "3.1.6.6"
+ }
+ ```
+
+ **Delete all files in the original SDK (3.1.6.6) directory.** Failure to do so may result in some files being unable to be overwritten.
+
+
+
+ Copy the full SDK to the location of the local SDK.
+
+ Copy all files in the **ets** directory in the full SDK to the **ets\3.1.6.6** directory in the location of the local SDK.
+
+ Change the value of **version** in the **oh-uni-package.json** file to the current SDK version number.
+
+
+
+ In the **3.1.6.6\build-tools\ets-loader** directory, open the **cmd/powerShell** window and run the **npm install** command to download the **node_modules** dependency package.
+
+ 
+
+
+
+ c. Check for system APIs.
+
+ 
diff --git a/en/application-dev/reference/Readme-EN.md b/en/application-dev/reference/Readme-EN.md
index 30bb3aacd85d9e11012fb66dc276a88476139126..f2ee2ee4ab190bcd3487aaca974a153c0aed914e 100644
--- a/en/application-dev/reference/Readme-EN.md
+++ b/en/application-dev/reference/Readme-EN.md
@@ -1,9 +1,9 @@
# Development References
-- [JavaScript-based Web-like Development Paradigm](arkui-js/Readme-EN.md)
-- [TypeScript-based Declarative Development Paradigm](arkui-ts/Readme-EN.md)
+- [Component Reference(TypeScript-based Declarative Development Paradigm)](arkui-ts/Readme-EN.md)
+- [Component Reference(JavaScript-based Web-like Development Paradigm)](arkui-js/Readme-EN.md)
- [APIs](apis/Readme-EN.md)
-
+
- [JS (eTS Included) APIs](apis/Readme-EN.md)
- Native APIs
- [Standard Library](native-lib/third_party_libc/musl.md)
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index 7a7288f485c659e1ec964584865d346b4c297064..6b5bbc8aa3d671c4cf0b01316db441d33c0f189f 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -4,53 +4,58 @@
- Ability Framework
- - [@ohos.ability.dataUriUtils](js-apis-DataUriUtils.md)
- - [@ohos.ability.errorCode](js-apis-ability-errorCode.md)
- - [@ohos.ability.wantConstant](js-apis-ability-wantConstant.md)
- - [@ohos.application.Ability](js-apis-application-ability.md)
- - [@ohos.application.AbilityConstant](js-apis-application-abilityConstant.md)
- - [@ohos.application.abilityDelegatorRegistry](js-apis-abilityDelegatorRegistry.md)
- - [@ohos.application.AbilityStage ](js-apis-application-abilitystage.md)
- - [@ohos.application.abilityLifecycleCallback](js-apis-application-abilityLifecycleCallback.md)
- - [@ohos.application.appManager](js-apis-appmanager.md)
- - [@ohos.application.Configuration](js-apis-configuration.md)
- - [@ohos.application.ConfigurationConstant](js-apis-configurationconstant.md)
- - [@ohos.application.DataShareExtensionAbility](js-apis-application-DataShareExtensionAbility.md)
- - [@ohos.ability.featureAbility](js-apis-featureAbility.md)
- - [@ohos.application.formBindingData](js-apis-formbindingdata.md)
- - [@ohos.application.FormExtension](js-apis-formextension.md)
- - [@ohos.application.formError](js-apis-formerror.md)
- - [@ohos.application.formHost](js-apis-formhost.md)
- - [@ohos.application.formInfo](js-apis-formInfo.md)
- - [@ohos.application.missionManager](js-apis-missionManager.md)
- - [@ohos.application.formProvider](js-apis-formprovider.md)
- - [@ohos.ability.particleAbility](js-apis-particleAbility.md)
- - [@ohos.application.ServiceExtensionAbility](js-apis-service-extension-ability.md)
- - [@ohos.application.StartOptions](js-apis-application-StartOptions.md)
- - [@ohos.application.StaticSubscriberExtensionAbility](js-apis-application-staticSubscriberExtensionAbility.md)
- - [@ohos.application.uriPermissionManager](js-apis-uripermissionmanager.md)
- - [@ohos.application.Want](js-apis-application-Want.md)
- - [@ohos.wantAgent](js-apis-wantAgent.md)
- - ability/[dataAbilityHelper](js-apis-dataAbilityHelper.md)
- - app/[context](js-apis-Context.md)
- - application/[AbilityContext](js-apis-ability-context.md)
- - application/[ApplicationContext](js-apis-application-applicationContext.md)
- - application/[abilityDelegator](js-apis-application-abilityDelegator.md)
- - application/[abilityDelegatorArgs](js-apis-application-abilityDelegatorArgs.md)
- - application/[abilityMonitor](js-apis-application-abilityMonitor.md)
- - application/[AbilityRunningInfo](js-apis-abilityrunninginfo.md)
- - application/[AbilityStageContext](js-apis-abilitystagecontext.md)
- - application/[Context](js-apis-application-context.md)
- - application/[ExtensionContext](js-apis-extension-context.md)
- - application/[ExtensionRunningInfo](js-apis-extensionrunninginfo.md)
- - application/[FormExtensionContext](js-apis-formextensioncontext.md)
- - application/[MissionSnapshot](js-apis-application-MissionSnapshot.md)
- - application/[PermissionRequestResult](js-apis-permissionrequestresult.md)
- - application/[ProcessRunningInfo](js-apis-processrunninginfo.md)
- - application/[ServiceExtensionContext](js-apis-service-extension-context.md)
- - application/[shellCmdResult](js-apis-application-shellCmdResult.md)
- - application/[MissionInfo](js-apis-application-missionInfo.md)
-
+ - FA Model
+ - [@ohos.ability.featureAbility](js-apis-featureAbility.md)
+ - [@ohos.ability.particleAbility](js-apis-particleAbility.md)
+ - ability/[dataAbilityHelper](js-apis-dataAbilityHelper.md)
+ - app/[context](js-apis-Context.md)
+ - Stage Model
+ - [@ohos.application.Ability](js-apis-application-ability.md)
+ - [@ohos.application.AbilityConstant](js-apis-application-abilityConstant.md)
+ - [@ohos.application.AbilityStage](js-apis-application-abilitystage.md)
+ - [@ohos.application.abilityLifecycleCallback](js-apis-application-abilityLifecycleCallback.md)
+ - [@ohos.application.DataShareExtensionAbility](js-apis-application-DataShareExtensionAbility.md)
+ - [@ohos.application.FormExtension](js-apis-formextension.md)
+ - [@ohos.application.ServiceExtensionAbility](js-apis-service-extension-ability.md)
+ - [@ohos.application.StartOptions](js-apis-application-StartOptions.md)
+ - [@ohos.application.StaticSubscriberExtensionAbility](js-apis-application-staticSubscriberExtensionAbility.md)
+ - application/[AbilityContext](js-apis-ability-context.md)
+ - application/[ApplicationContext](js-apis-application-applicationContext.md)
+ - application/[AbilityStageContext](js-apis-abilitystagecontext.md)
+ - application/[Context](js-apis-application-context.md)
+ - application/[ExtensionContext](js-apis-extension-context.md)
+ - application/[FormExtensionContext](js-apis-formextensioncontext.md)
+ - application/[PermissionRequestResult](js-apis-permissionrequestresult.md)
+ - application/[ServiceExtensionContext](js-apis-service-extension-context.md)
+ - FA and Stage Models
+ - [@ohos.ability.dataUriUtils](js-apis-DataUriUtils.md)
+ - [@ohos.ability.errorCode](js-apis-ability-errorCode.md)
+ - [@ohos.ability.wantConstant](js-apis-ability-wantConstant.md)
+ - [@ohos.application.abilityDelegatorRegistry](js-apis-abilityDelegatorRegistry.md)
+ - [@ohos.application.abilityManager](js-apis-application-abilityManager.md)
+ - [@ohos.application.appManager](js-apis-appmanager.md)
+ - [@ohos.application.Configuration](js-apis-configuration.md)
+ - [@ohos.application.ConfigurationConstant](js-apis-configurationconstant.md)
+ - [@ohos.application.EnvironmentCallback](js-apis-application-EnvironmentCallback.md)
+ - [@ohos.application.formBindingData](js-apis-formbindingdata.md)
+ - [@ohos.application.formError](js-apis-formerror.md)
+ - [@ohos.application.formHost](js-apis-formhost.md)
+ - [@ohos.application.formInfo](js-apis-formInfo.md)
+ - [@ohos.application.formProvider](js-apis-formprovider.md)
+ - [@ohos.application.missionManager](js-apis-missionManager.md)
+ - [@ohos.application.Want](js-apis-application-Want.md)
+ - [@ohos.continuation.continuationManager](js-apis-continuation-continuationExtraParams.md)
+ - [@ohos.continuation.continuationManager](js-apis-continuation-continuationManager.md)
+ - [@ohos.wantAgent](js-apis-wantAgent.md)
+ - application/[abilityDelegator](js-apis-application-abilityDelegator.md)
+ - application/[abilityDelegatorArgs](js-apis-application-abilityDelegatorArgs.md)
+ - application/[abilityMonitor](js-apis-application-abilityMonitor.md)
+ - application/[AbilityRunningInfo](js-apis-abilityrunninginfo.md)
+ - application/[ExtensionRunningInfo](js-apis-extensionrunninginfo.md)
+ - application/[MissionSnapshot](js-apis-application-MissionSnapshot.md)
+ - application/[ProcessRunningInfo](js-apis-processrunninginfo.md)
+ - application/[shellCmdResult](js-apis-application-shellCmdResult.md)
+ - continuation/[ContinuationResult](js-apis-continuation-continuationResult.md)
- Common Event and Notification
- [@ohos.commonEvent](js-apis-commonEvent.md)
@@ -58,7 +63,7 @@
- [@ohos.notification](js-apis-notification.md)
- [@ohos.reminderAgent](js-apis-reminderAgent.md)
- application/[EventHub](js-apis-eventhub.md)
-
+
- Bundle Management
- [@ohos.bundle](js-apis-Bundle.md)
@@ -69,26 +74,30 @@
- bundle/[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)
- bundle/[BundleInfo](js-apis-bundle-BundleInfo.md)
- bundle/[CustomizeData](js-apis-bundle-CustomizeData.md)
+ - bundle/[ElementName](js-apis-bundle-ElementName.md)
- bundle/[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)
- bundle/[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)
- bundle/[Metadata](js-apis-bundle-Metadata.md)
- bundle/[ModuleInfo](js-apis-bundle-ModuleInfo.md)
-
+
- UI Page
- [@ohos.animator](js-apis-animator.md)
- [@ohos.mediaquery](js-apis-mediaquery.md)
- [@ohos.prompt](js-apis-prompt.md)
- [@ohos.router](js-apis-router.md)
-
+ - [@ohos.uiAppearance](js-apis-uiappearance.md)
+
- Graphics
- [@ohos.display ](js-apis-display.md)
+ - [@ohos.effectKit](js-apis-effectKit.md)
+ - [@ohos.screen](js-apis-screen.md)
- [@ohos.screenshot](js-apis-screenshot.md)
- [@ohos.window](js-apis-window.md)
- [webgl](js-apis-webgl.md)
- [webgl2](js-apis-webgl2.md)
-
+
- Media
- [@ohos.multimedia.audio](js-apis-audio.md)
@@ -96,32 +105,33 @@
- [@ohos.multimedia.image](js-apis-image.md)
- [@ohos.multimedia.media](js-apis-media.md)
- [@ohos.multimedia.medialibrary](js-apis-medialibrary.md)
-
+
- Resource Management
- [@ohos.i18n](js-apis-i18n.md)
- [@ohos.intl](js-apis-intl.md)
- [@ohos.resourceManager](js-apis-resource-manager.md)
-
+
- Resource Scheduling
- [@ohos.backgroundTaskManager](js-apis-backgroundTaskManager.md)
- [@ohos.workScheduler ](js-apis-workScheduler.md)
- [@ohos.WorkSchedulerExtensionAbility](js-apis-WorkSchedulerExtensionAbility.md)
-
+
- Custom Management
- [@ohos.configPolicy](js-apis-config-policy.md)
- [@ohos.enterpriseDeviceManager](js-apis-enterprise-device-manager.md)
- [@ohos.EnterpriseAdminExtensionAbility](js-apis-EnterpriseAdminExtensionAbility.md)
-
+
- Security
- [@ohos.abilityAccessCtrl](js-apis-abilityAccessCtrl.md)
+ - [@ohos.privacyManager](js-apis-privacyManager.md)
- [@ohos.security.huks ](js-apis-huks.md)
- [@ohos.userIAM.userAuth ](js-apis-useriam-userauth.md)
- [@system.cipher](js-apis-system-cipher.md)
-
+
- Data Management
- [@ohos.data.dataAbility ](js-apis-data-ability.md)
@@ -134,7 +144,7 @@
- [@ohos.data.rdb](js-apis-data-rdb.md)
- [@ohos.data.ValuesBucket](js-apis-data-ValuesBucket.md)
- data/rdb/[resultSet](js-apis-data-resultset.md)
-
+
- File Management
- [@ohos.document](js-apis-document.md)
@@ -145,7 +155,7 @@
- [@ohos.storageStatistics](js-apis-storage-statistics.md)
- [@ohos.volumeManager](js-apis-volumemanager.md)
- [@ohos.securityLabel](js-apis-securityLabel.md)
-
+
- Telephony Service
- [@ohos.contact](js-apis-contact.md)
@@ -155,7 +165,7 @@
- [@ohos.telephony.sim](js-apis-sim.md)
- [@ohos.telephony.sms](js-apis-sms.md)
- [@ohos.telephony.data](js-apis-telephony-data.md)
-
+
- Network Management
- [@ohos.net.connection](js-apis-net-connection.md)
@@ -163,7 +173,7 @@
- [@ohos.request](js-apis-request.md)
- [@ohos.net.socket](js-apis-socket.md)
- [@ohos.net.webSocket](js-apis-webSocket.md)
-
+
- Connectivity
- [@ohos.bluetooth](js-apis-bluetooth.md)
@@ -174,7 +184,7 @@
- [@ohos.rpc](js-apis-rpc.md)
- [@ohos.wifi](js-apis-wifi.md)
- [@ohos.wifiext](js-apis-wifiext.md)
-
+
- Basic Features
- [@ohos.accessibility](js-apis-accessibility.md)
@@ -193,7 +203,7 @@
- [@ohos.systemTime](js-apis-system-time.md)
- [@ohos.wallpaper](js-apis-wallpaper.md)
- [Timer](js-apis-timer.md)
-
+
- Device Management
- [@ohos.batteryInfo ](js-apis-battery-info.md)
@@ -219,13 +229,13 @@
- [@ohos.update](js-apis-update.md)
- [@ohos.usb](js-apis-usb.md)
- [@ohos.vibrator](js-apis-vibrator.md)
-
+
- Account Management
- [@ohos.account.appAccount](js-apis-appAccount.md)
- [@ohos.account.distributedAccount](js-apis-distributed-account.md)
- [@ohos.account.osAccount](js-apis-osAccount.md)
-
+
- Language Base Class Library
- [@ohos.convertxml](js-apis-convertxml.md)
@@ -249,12 +259,12 @@
- [@ohos.util.Vector](js-apis-vector.md)
- [@ohos.worker](js-apis-worker.md)
- [@ohos.xml](js-apis-xml.md)
-
+
- Test
- [@ohos.application.testRunner](js-apis-testRunner.md)
- [@ohos.uitest](js-apis-uitest.md)
-
+
- APIs No Longer Maintained
- [@ohos.bytrace](js-apis-bytrace.md)
diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md
index 20e8f1573b48402b5561e69c1a67ac0c6a1dd9ea..409cb84c143a04dc46ec010fe9323f009b66c7ab 100644
--- a/en/application-dev/reference/apis/js-apis-Bundle.md
+++ b/en/application-dev/reference/apis/js-apis-Bundle.md
@@ -1,14 +1,14 @@
# Bundle
-The **Bundle** module provides APIs for querying bundle information, application information, abilities, Extension abilities, and application states.
+The **Bundle** module provides APIs for querying the information about bundles, applications, abilities, Extension abilities, and application states.
> **NOTE**
->
+>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> API version 9 is a canary version for trial use. The APIs of this version may be unstable.
## Modules to Import
-```
+```js
import bundle from '@ohos.bundle';
```
@@ -23,8 +23,9 @@ SystemCapability.BundleManager.BundleFramework
| ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about a specified application. |
| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all applications.|
| ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall applications. |
+| ohos.permission.MANAGE_DISPOSED_APP_STATUS | system_core | Permission to set and query the application disposal status. |
-For details, see “Permission Levels” in [Access Control Overview](../../security/accesstoken-overview.md).
+For details, see "Permission Levels" in [Access Control Overview](../../security/accesstoken-overview.md).
## bundle.getApplicationInfo
@@ -44,7 +45,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
@@ -68,8 +69,6 @@ bundle.getApplicationInfo(bundleName, bundleFlags, userId)
})
```
-
-
## bundle.getApplicationInfo
getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback\): void
@@ -88,7 +87,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | --------------------------------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. |
@@ -108,7 +107,6 @@ bundle.getApplicationInfo(bundleName, bundleFlags, userId, (err, data) => {
})
```
-
## bundle.getApplicationInfo
getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\): void
@@ -127,7 +125,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | --------------------------------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. |
@@ -145,7 +143,6 @@ bundle.getApplicationInfo(bundleName, bundleFlags, (err, data) => {
})
```
-
## bundle.getAllBundleInfo
getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise>
@@ -186,8 +183,6 @@ bundle.getAllBundleInfo(bundleFlag, userId)
})
```
-
-
## bundle.getAllBundleInfo
getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback>): void
@@ -222,7 +217,6 @@ bundle.getAllBundleInfo(bundleFlag, (err, data) => {
})
```
-
## bundle.getAllBundleInfo
getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback>): void
@@ -259,8 +253,6 @@ bundle.getAllBundleInfo(bundleFlag, userId, (err, data) => {
})
```
-
-
## bundle.getBundleInfo
getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise\
@@ -279,7 +271,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------- | ---- | --------------------------------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| options | [BundleOptions](#bundleoptions) | No | Includes **userId**. |
@@ -305,8 +297,6 @@ bundle.getBundleInfo(bundleName, bundleFlags, options)
})
```
-
-
## bundle.getBundleInfo
getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\): void
@@ -325,7 +315,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | --------------------------------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. |
@@ -362,7 +352,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | --------------------------------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| options | [BundleOptions](#bundleoptions) | Yes | Includes **userId**. |
| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. |
@@ -384,6 +374,466 @@ bundle.getBundleInfo(bundleName, bundleFlags, options, (err, data) => {
})
```
+## bundle.getBundleInstaller
+
+getBundleInstaller(): Promise<BundleInstaller>;
+
+Obtains the installation package information. This API uses a promise to return the result.
+
+**Required permissions**
+
+ohos.permission.INSTALL_BUNDLE
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Return value**
+
+| Type | Description |
+| ------------------------------------------------------------ | -------------------------------------------- |
+| Promise<[BundleInstaller](js-apis-bundle-BundleInstaller.md)> | Promise used to return the installation package information.|
+
+## bundle.getBundleInstaller
+
+getBundleInstaller(callback: AsyncCallback<BundleInstaller>): void;
+
+Obtains the installation package information. This API uses an asynchronous callback to return the result.
+
+**Required permissions**
+
+ohos.permission.INSTALL_BUNDLE
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ---------------- |
+| callback | AsyncCallback<[BundleInstaller](js-apis-bundle-BundleInstaller.md)> | Yes | Callback used to return the installation package information.|
+
+## bundle.cleanBundleCacheFiles8+
+
+cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback<void>): void;
+
+Clears the cache data of an application. This API uses an asynchronous callback to return the result.
+
+**Required permissions**
+
+ohos.permission.REMOVE_CACHE_FILES
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------------------- | ---- | ------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application.|
+| callback | AsyncCallback\ | Yes | Callback used to return the result. |
+
+## bundle.cleanBundleCacheFiles8+
+
+cleanBundleCacheFiles(bundleName: string): Promise<void>
+
+Clears the cache data of an application. This API uses a promise to return the result.
+
+**Required permissions**
+
+ohos.permission.REMOVE_CACHE_FILES
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------ | ---- | ------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application.|
+
+**Return value**
+
+| Type | Description |
+| ------------- | ------------------------------------ |
+| Promise\ | Promise that returns no value.|
+
+## bundle.setApplicationEnabled8+
+
+setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback<void>): void;
+
+Sets whether to enable an application. This API uses an asynchronous callback to return the result.
+
+**Required permissions**
+
+ohos.permission.CHANGE_ABILITY_ENABLED_STATE
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------------------- | ---- | ----------------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.|
+| callback | AsyncCallback\ | Yes | Callback used to return the result. |
+
+## bundle.setApplicationEnabled8+
+
+setApplicationEnabled(bundleName: string, isEnable: boolean): Promise<void>
+
+Sets whether to enable an application. This API uses a promise to return the result.
+
+**Required permissions**
+
+ohos.permission.CHANGE_ABILITY_ENABLED_STATE
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------- | ---- | ----------------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ------------- | ------------------------------------ |
+| Promise\ | Promise that returns no value.|
+
+## bundle.setAbilityEnabled8+
+
+setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback<void>): void;
+
+Sets whether to enable an ability. This API uses an asynchronous callback to return the result.
+
+**Required permissions**
+
+ohos.permission.CHANGE_ABILITY_ENABLED_STATE
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | -------------------------------------------- | ---- | ----------------------------------------------- |
+| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information. |
+| isEnable | boolean | Yes | Whether to enable the ability. The value **true** means to enable the ability, and **false** means the opposite.|
+| callback | AsyncCallback\ | Yes | Callback used to return the result. |
+
+## bundle.setAbilityEnabled8+
+
+setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise<void>
+
+Sets whether to enable an ability. This API uses a promise to return the result.
+
+**Required permissions**
+
+ohos.permission.CHANGE_ABILITY_ENABLED_STATE
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | -------------------------------------------- | ---- | ----------------------------------------------- |
+| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information. |
+| isEnable | boolean | Yes | Whether to enable the ability. The value **true** means to enable the ability, and **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ------------- | ------------------------------------ |
+| Promise\ | Promise that returns no value.|
+
+## bundle.getPermissionDef8+
+
+getPermissionDef(permissionName: string, callback: AsyncCallback<PermissionDef>): void;
+
+Obtains the permission details by permission name. This API uses an asynchronous callback to return the result.
+
+**Required permissions**
+
+ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------ |
+| permissionName | string | Yes | Name of the permission. |
+| callback | AsyncCallback<[PermissionDef](js-apis-bundle-PermissionDef)> | Yes | Callback used to return the permission details.|
+
+## bundle.getPermissionDef8+
+
+getPermissionDef(permissionName: string): Promise<PermissionDef>
+
+Obtains the permission details by permission name. This API uses a promise to return the result.
+
+**Required permissions**
+
+ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------------- | ------ | ---- | ---------------- |
+| permissionName | string | Yes | Name of the permission.|
+
+**Return value**
+
+| Type | Description |
+| ------------------------------------------------------ | ------------------------------------------------------ |
+| Promise<[PermissionDef](js-apis-bundle-PermissionDef)> | Promise used to return the permission details.|
+
+## bundle.setModuleUpgradeFlag9+
+
+setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback<void>):void;
+
+Sets whether the module needs an upgrade. This API uses an asynchronous callback to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | ---------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| moduleName | string | Yes | Module name of the application. |
+| upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes | Upgrade flag, which is used only by the internal system. |
+| callback | AsyncCallback\ | Yes | Callback used to return the result.|
+
+## bundle.setModuleUpgradeFlag9+
+
+setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag): Promise<void>
+
+Sets whether the module needs an upgrade. This API uses a promise to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | ---------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| moduleName | string | Yes | Module name of the application. |
+| upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes | Upgrade flag, which is used only by the internal system.|
+
+**Return value**
+
+| Type | Description |
+| ------------- | ------------------------------------ |
+| Promise\ | Promise that returns no value.|
+
+## bundle.isModuleRemovable9+
+
+isModuleRemovable(bundleName: string, moduleName: string, callback: AsyncCallback<boolean>): void;
+
+Checks whether a module is removable. This API uses an asynchronous callback to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ---------------------- | ---- | --------------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| moduleName | string | Yes | Module name of the application. |
+| callback | AsyncCallback | Yes | Callback used to return the result. If the module is removable, **true** is returned. Otherwise, **false** is returned.|
+
+## bundle.isModuleRemovable9+
+
+isModuleRemovable(bundleName: string, moduleName: string): Promise<boolean>
+
+Checks whether a module is removable. This API uses a promise to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------ | ---- | ------------------ |
+| bundleName | string | Yes | Bundle name of an application. |
+| moduleName | string | Yes | Module name of the application.|
+
+**Return value**
+
+| Type | Description |
+| ---------------- | ---------------------------- |
+| Promise | Promise used to return the result. If the module is removable, **true** is returned. Otherwise, **false** is returned.|
+
+## bundle.getBundlePackInfo9+
+
+getBundlePackInfo(bundleName: string, bundlePackFlag : pack.BundlePackFlag, callback: AsyncCallback<pack.BundlePackInfo>): void;
+
+Obtains the bundle package information based on a given bundle name and bundle flags. This API uses an asynchronous callback to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------------- | ---------------------------------- | ---- | ---------------------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| bundlePackFlag | pack.BundlePackFlag | Yes | Flags of the bundle package. |
+| callback | AsyncCallback | Yes | Callback used to return the bundle package information.|
+
+## bundle.getBundlePackInfo9+
+
+getBundlePackInfo(bundleName: string, bundlePackFlag : pack.BundlePackFlag): Promise<pack.BundlePackInfo>;
+
+Obtains the bundle package information based on a given bundle name and bundle flags. This API uses a promise to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------------- | ------------------- | ---- | ---------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| bundlePackFlag | pack.BundlePackFlag | Yes | Flags of the bundle package.|
+
+**Return value**
+
+| Type | Description |
+| ---------------------------- | ----------------------------------- |
+| Promise | Promise used to return the bundle package information.|
+
+## bundle.getDispatcherVersion9+
+
+getDispatcherVersion(callback: AsyncCallback<DispatchInfo>): void;
+
+Obtains the dispatcher version. This API uses an asynchronous callback to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| callback | AsyncCallback<[DispatchInfo](js-apis-dispatchInfo.md)> | Yes | Callback used to return the [DispatchInfo](js-apis-dispatchInfo.md).|
+
+## bundle.getDispatcherVersion9+
+
+getDispatcherVersion(): Promise<DispatchInfo>;
+
+Obtains the dispatcher version. This API uses a promise to return the result.
+
+**System capability**
+
+SystemCapability.BundleManager.BundleFramework
+
+**System API**
+
+This is a system API and cannot be called by third-party applications.
+
+**Return value**
+
+| Type | Description |
+| ------------------------------------------------ | ------------------------------------------------------------ |
+| Promise<[DispatchInfo](js-apis-dispatchInfo.md)> | Promise used to return the [DispatchInfo](js-apis-dispatchInfo.md).|
## bundle.getAllApplicationInfo
@@ -584,7 +1034,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.|
**Return value**
@@ -624,7 +1074,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------ | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.|
@@ -659,7 +1109,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| moduleName | string | Yes | Module name of the application. |
| abilityName | string | Yes | Ability name.|
@@ -701,7 +1151,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------ | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| moduleName | string | Yes | Module name of the application. |
| abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.|
@@ -739,7 +1189,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.|
**Return value**
@@ -779,7 +1229,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ---------------------- | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\ | Yes | Callback used to return the application name. |
@@ -814,7 +1264,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| moduleName | string | Yes | Module name of the application. |
| abilityName | string | Yes | Ability name.|
@@ -856,7 +1306,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ---------------------- | ---- | ---------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| moduleName | string | Yes | Module name of the application. |
| abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\ | Yes | Callback used to return the application name. |
@@ -959,7 +1409,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------ |
-| bundleName | string | Yes | Bundle name of the application.|
+| bundleName | string | Yes | Bundle name of an application.|
**Return value**
@@ -993,7 +1443,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | ----------------------- | ---- | --------------- |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| callback | AsyncCallback\ | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example**
@@ -1156,7 +1606,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------ |
-| bundleName | string | Yes | Bundle name of the application.|
+| bundleName | string | Yes | Bundle name of an application.|
**Return value**
| Type | Description |
@@ -1193,7 +1643,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | -------------------- | ---- | ------------------------------ |
-| bundleName | string | Yes | Bundle name of the application. |
+| bundleName | string | Yes | Bundle name of an application. |
| callback | AsyncCallback\<[Want](js-apis-application-Want.md)> | Yes | Callback used to return the **Want** object.|
**Example**
@@ -1278,7 +1728,7 @@ bundle.getNameForUid(uid, (err, data) => {
getAbilityIcon(bundleName: string, abilityName: string): Promise\;
-Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result.
+Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result.
**Required permissions**
@@ -1298,7 +1748,7 @@ SystemCapability.BundleManager.BundleFramework
**Return value**
| Type | Description |
| --------------------- | ------------------------------------------------------------ |
-| Promise\ | Promise used to return the [PixelMap](js-apis-image.md).|
+| Promise\ | Promise used to return the [pixel map](js-apis-image.md).|
**Example**
@@ -1317,7 +1767,7 @@ bundle.getAbilityIcon(bundleName, abilityName)
getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\): void;
-Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result.
+Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result.
**Required permissions**
@@ -1333,7 +1783,7 @@ SystemCapability.BundleManager.BundleFramework
| ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. |
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain. |
-| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](js-apis-image.md).|
+| callback | AsyncCallback\ | Yes | Callback used to return the [pixel map](js-apis-image.md).|
**Example**
@@ -1353,11 +1803,11 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => {
getAbilityIcon(bundleName: string, moduleName: string, abilityName: string): Promise\;
-Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name, module name, and ability name. This API uses a promise to return the result.
+Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name, module name, and ability name. This API uses a promise to return the result.
**Required permissions**
-ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
+ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**
@@ -1374,7 +1824,7 @@ SystemCapability.BundleManager.BundleFramework
**Return value**
| Type | Description |
| --------------------- | ------------------------------------------------------------ |
-| Promise\ | Promise used to return the [PixelMap](js-apis-image.md).|
+| Promise\ | Promise used to return the [pixel map](js-apis-image.md).|
**Example**
@@ -1394,11 +1844,11 @@ bundle.getAbilityIcon(bundleName, moduleName, abilityName)
getAbilityIcon(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback\): void;
-Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name, module name, and ability name. This API uses an asynchronous callback to return the result.
+Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name, module name, and ability name. This API uses an asynchronous callback to return the result.
**Required permissions**
-ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
+ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**
@@ -1411,7 +1861,7 @@ SystemCapability.BundleManager.BundleFramework
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. |
| moduleName | string | Yes | Module name based on which the pixel map is to obtain. |
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain. |
-| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](js-apis-image.md).|
+| callback | AsyncCallback\ | Yes | Callback used to return the [pixel map](js-apis-image.md).|
**Example**
@@ -1528,7 +1978,7 @@ Obtains the Extension ability information based on a given want. This API uses a
**Required permissions**
-ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
+ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**
@@ -1693,6 +2143,142 @@ bundle.getProfileByExtensionAbility(moduleName, extensionAbilityName, metadataNa
})
```
+## bundle.setDisposedStatus9+
+
+setDisposedStatus(bundleName: string, status: number, callback: AsyncCallback\): void;
+
+Sets the disposal status for an application based on a given bundle name. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.MANAGE_DISPOSED_APP_STATUS
+
+**System capability**: SystemCapability.BundleManager.BundleFramework
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---------------- | ---------------------------------- | ---- | ---------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| status | number | Yes | Disposal status to set. This parameter is reserved for the application market. The default value is **0**, indicating that no disposal is performed. |
+| callback | AsyncCallback\ | Yes | Callback that returns no value. |
+
+**Example**
+
+```js
+let bundleName = 'com.ohos.camera';
+let status = 1;
+const caller = function callback(err, data) {
+ console.error('Operation err is: ' + err);
+ console.error('Operation result is: ' + data);
+}
+bundle.setDisposedStatus(bundleName, status, caller)
+```
+
+## bundle.setDisposedStatus9+
+
+setDisposedStatus(bundleName: string, status: number): Promise\;
+
+Sets the disposal status for an application based on a given bundle name. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.MANAGE_DISPOSED_APP_STATUS
+
+**System capability**: SystemCapability.BundleManager.BundleFramework
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---------------- | ---------------------------------- | ---- | ---------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| status | number | Yes | Disposal status to set. This parameter is reserved for the application market. The default value is **0**, indicating that no disposal is performed. |
+
+**Return value**
+
+| Type | Description |
+| ------------------------------------- | ------------------------------ |
+| Promise\ | Promise that returns no value.|
+
+**Example**
+
+```js
+let bundleName = 'com.ohos.camera';
+let status = 1;
+
+bundle.setDisposedStatus(bundleName, status).then(data=>{
+ console.error('Operation result is: ' + data);
+}).catch(err=>{
+ console.error('Operation err is: ' + err);
+})
+```
+
+## bundle.getDisposedStatus9+
+
+getDisposedStatus(bundleName: string, callback: AsyncCallback\): void;
+
+Obtains the disposal status of an application based on a given bundle name. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.MANAGE_DISPOSED_APP_STATUS
+
+**System capability**: SystemCapability.BundleManager.BundleFramework
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---------------- | ---------------------------------- | ---- | ---------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+| callback | AsyncCallback\ | Yes | Callback used to return the disposal status. |
+
+**Example**
+
+```js
+let bundleName = 'com.ohos.camera';
+const caller = function callback(err, data) {
+ console.error('Operation err is: ' + err);
+ console.error('Operation result is: ' + data);
+}
+bundle.getDisposedStatus(bundleName, caller)
+```
+
+## bundle.getDisposedStatus9+
+
+getDisposedStatus(bundleName: string): Promise\;
+
+Obtains the disposal status of an application based on a given bundle name. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.MANAGE_DISPOSED_APP_STATUS
+
+**System capability**: SystemCapability.BundleManager.BundleFramework
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---------------- | ---------------------------------- | ---- | ---------------------------------------- |
+| bundleName | string | Yes | Bundle name of an application. |
+
+**Return value**
+
+| Type | Description |
+| ------------------------------------- | ------------------------------ |
+| Promise\ | Promise used to return the disposal status.|
+
+**Example**
+
+```js
+let bundleName = 'com.ohos.camera';
+
+bundle.getDisposedStatus(bundleName).then(data=>{
+ console.error('Operation result is: ' + data);
+}).catch(err=>{
+ console.error('Operation err is: ' + err);
+})
+```
+
## InstallErrorCode
**System capability**: SystemCapability.BundleManager.BundleFramework
@@ -1779,15 +2365,15 @@ Enumerates display orientations.
| LANDSCAPE | None | Landscape orientation. |
| PORTRAIT | None | Portrait orientation. |
| FOLLOW_RECENT | None | Orientation same as that of the nearest ability in the stack.|
-| LANDSCAPE_INVERTED |None | Reverse landscape orientation. |
-| PORTRAIT_INVERTED |None | Reverse portrait orientation. |
-| AUTO_ROTATION |None | Orientation determined by the sensor. |
-| AUTO_ROTATION_LANDSCAPE |None | Orientation determined by the sensor in the horizontal direction, including landscape and reverse landscape. |
-| AUTO_ROTATION_PORTRAIT |None | Orientation determined by the sensor in the vertical direction, including portrait and reverse portrait. |
-| AUTO_ROTATION_RESTRICTED |None | Orientation determined by the sensor when the sensor switch is enabled. |
-| AUTO_ROTATION_LANDSCAPE_RESTRICTED |None | Orientation determined by the sensor in the horizontal direction, including landscape and reverse landscape, when the sensor switch is enabled. |
-| AUTO_ROTATION_PORTRAIT_RESTRICTED |None | Orientation determined by the sensor in the vertical direction, including portrait and reverse portrait, when the sensor switch is enabled. |
-| LOCKED |None | Auto rotate locked. |
+| LANDSCAPE_INVERTED9+ |None | Reverse landscape orientation. |
+| PORTRAIT_INVERTED9+ |None | Reverse portrait orientation. |
+| AUTO_ROTATION9+ |None | Orientation determined by the sensor. |
+| AUTO_ROTATION_LANDSCAPE9+ |None | Orientation determined by the sensor in the horizontal direction, including landscape and reverse landscape. |
+| AUTO_ROTATION_PORTRAIT9+ |None | Orientation determined by the sensor in the vertical direction, including portrait and reverse portrait. |
+| AUTO_ROTATION_RESTRICTED9+ |None | Orientation determined by the sensor when the sensor switch is enabled. |
+| AUTO_ROTATION_LANDSCAPE_RESTRICTED9+ |None | Orientation determined by the sensor in the horizontal direction, including landscape and reverse landscape, when the sensor switch is enabled. |
+| AUTO_ROTATION_PORTRAIT_RESTRICTED9+ |None | Orientation determined by the sensor in the vertical direction, including portrait and reverse portrait, when the sensor switch is enabled. |
+| LOCKED9+ |None | Auto rotate disabled. |
## LaunchMode
Enumerates launch modes.
@@ -1827,9 +2413,12 @@ Enumerates Extension ability types.
| FILE_SHARE9+ | 6 | File sharing included.|
| STATIC_SUBSCRIBER9+ | 7 | Subscribers included. |
| WALLPAPER9+ | 8 | Wallpaper included. |
-| BACKUP9+ | 9 | Data backup and restore included.|
+| BACKUP9+ | 9 | Data backup and restore included.|
+| WINDOW9+ | 10 | Window type extension information included.|
| ENTERPRISE_ADMIN9+ | 11 | Enterprise administrators included. |
-| UNSPECIFIED9+ | 20 | Unspecified type. |
+| THUMBNAIL9+ | 13 | Thumbnails included.|
+| PREVIEW9+ | 14 | Preview included.|
+| UNSPECIFIED9+ | 255 | Unspecified type. |
## ExtensionFlag9+
@@ -1876,6 +2465,20 @@ Enumerates window modes.
| Name | Type | Description |
| ------------------ | ---- | ---- |
-| FULLSCREEN | None | Full screen.|
-| SPLIT | None | Split-screen. |
-| FLOATING | None | Floating. |
+| FULL_SCREEN9+ | 0 | Full screen.|
+| SPLIT9+ | 1 | Split-screen. |
+| FLOATING9+ | 2 | Floating. |
+
+## UpgradeFlag
+
+Enumerates the upgrade flags, which are for internal use only.
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**System capability**: SystemCapability.BundleManager.BundleFramework
+
+| Name | Value | Description |
+| ----------------------------- | ---- | ---------------- |
+| NOT_UPGRADE9+ | 0 | No module needs an upgrade. |
+| SINGLE_UPGRADE9+ | 1 | A single module needs an upgrade.|
+| RELATION_UPGRADE9+ | 2 | The module that has a relationship with the current one needs an upgrade.|
diff --git a/en/application-dev/reference/apis/js-apis-Context.md b/en/application-dev/reference/apis/js-apis-Context.md
index 7e947ddbe0194fabeb31d1c10c44eab0dcfe1550..ce415ad942510c481755380bdd90adb7eb1c75ae 100644
--- a/en/application-dev/reference/apis/js-apis-Context.md
+++ b/en/application-dev/reference/apis/js-apis-Context.md
@@ -1,19 +1,16 @@
# Context
+The **Context** module provides context for abilities or applications. It allows access to application-specific resources, as well as permission requests and verification.
+
> **NOTE**
->
-> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+>
+> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+>
> The APIs of this module can be used only in the FA model.
-## Modules to Import
-
-```js
-import featureAbility from '@ohos.ability.featureAbility'
-```
-
## Usage
-The **Context** object is created in a **featureAbility** and returned through its **getContext()** API. Therefore, you must import the **@ohos.ability.featureAbility** package before using the Context module. An example is as follows:
+The **Context** object is created in a **featureAbility** and returned through its **getContext()** API. Therefore, you must import the **@ohos.ability.featureAbility** package before using the **Context** module. An example is as follows:
```js
import featureAbility from '@ohos.ability.featureAbility'
@@ -91,7 +88,7 @@ Verifies whether a specific PID and UID have the given permission. This API uses
| ---------- | --------------------------------------- | ---- | ------------------------------------- |
| permission | string | Yes | Name of the permission to verify. |
| options | [PermissionOptions](#permissionoptions) | Yes | Permission options. |
-| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.|
+| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.|
**Example**
@@ -119,7 +116,7 @@ Verifies whether the current PID and UID have the given permission. This API use
| Name | Type | Mandatory| Description |
| ---------- | ---------------------- | ---- | ------------------------------------- |
| permission | string | Yes | Name of the permission to verify. |
-| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.|
+| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.|
**Example**
@@ -148,7 +145,7 @@ Verifies whether a specific PID and UID have the given permission. This API uses
| Type | Description |
| ---------------- | ----------------------------------------------------------- |
-| Promise\ | Promise used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.|
+| Promise\ | Promise used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.|
**Example**
@@ -255,7 +252,7 @@ context.getApplicationInfo().then((data) => {
getBundleName(callback: AsyncCallback\): void
-Obtains the bundle name of the current ability. This API uses an asynchronous callback to return the result.
+Obtains the bundle name of this ability. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -279,7 +276,7 @@ context.getBundleName()
getBundleName(): Promise\
-Obtains the bundle name of the current ability. This API uses a promise to return the result.
+Obtains the bundle name of this ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -300,6 +297,225 @@ context.getBundleName().then((data) => {
});
```
+## Context.getDisplayOrientation7+
+
+getDisplayOrientation(callback: AsyncCallback\): void
+
+Obtains the display orientation of this ability. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ----------------------------- |
+| callback | AsyncCallback\<[bundle.DisplayOrientation](js-apis-bundle.md#displayorientation)> | Yes | Callback used to return the display orientation.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+context.getDisplayOrientation()
+```
+
+## Context.getDisplayOrientation7+
+
+getDisplayOrientation(): Promise\;
+
+Obtains the display orientation of this ability. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Return value**
+
+| Type | Description |
+| ---------------- | ------------------------- |
+| Promise\<[bundle.DisplayOrientation](js-apis-bundle.md#displayorientation)> | Promise used to return the display orientation.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+context.getDisplayOrientation().then((data) => {
+ console.info("=======================>getDisplayOrientationCallback====================>");
+ console.info("====>data====>" + JSON.stringify(data));
+});
+```
+
+## Context.setDisplayOrientation7+
+
+setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback\): void
+
+Obtains the display orientation for this ability. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ----------------------------- |
+| orientation | [bundle.DisplayOrientation](js-apis-bundle.md#displayorientation) | Yes | Display orientation to set.|
+| callback | AsyncCallback\<[bundle.DisplayOrientation](js-apis-bundle.md#displayorientation)> | Yes | Callback used to return the display orientation.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+import bundle from '@ohos.bundle'
+var context = featureAbility.getContext();
+var orientation=bundle.DisplayOrientation.UNSPECIFIED
+context.setDisplayOrientation(orientation, (err) => {
+ console.log('---------- setDisplayOrientation fail, err: -----------', err);
+});
+```
+
+## Context.setDisplayOrientation7+
+
+setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise\;
+
+Obtains the display orientation for this ability. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Return value**
+
+| Type | Description |
+| ---------------- | ------------------------- |
+| orientation | [bundle.DisplayOrientation](js-apis-bundle.md#displayorientation) | Yes | Display orientation to set.|
+| Promise\<[bundle.DisplayOrientation](js-apis-bundle.md#displayorientation)> | Promise used to return the display orientation.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+import bundle from '@ohos.bundle'
+var context = featureAbility.getContext();
+var orientation=bundle.DisplayOrientation.UNSPECIFIED
+context.setDisplayOrientation(orientation).then((data) => {
+ console.info("=======================>setDisplayOrientationCallback====================>");
+ console.info("====>data====>" + JSON.stringify(data));
+});
+```
+
+## Context.setShowOnLockScreen7+
+
+setShowOnLockScreen(show: boolean, callback: AsyncCallback\): void
+
+Sets whether to show this feature at the top of the lock screen each time the lock screen is displayed so that the feature remains activated. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ----------------------------- |
+| show | boolean | Yes | Whether to show this feature at the top of the lock screen. The value **true** means to show this feature at the top of the lock screen, and **false** means the opposite.|
+| callback | AsyncCallback\ | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+var show=true
+context.setShowOnLockScreen(show, (err) => {
+ console.log('---------- setShowOnLockScreen fail, err: -----------', err);
+});
+```
+
+## Context.setShowOnLockScreen7+
+
+setShowOnLockScreen(show: boolean): Promise\;
+
+Sets whether to show this feature at the top of the lock screen each time the lock screen is displayed so that the feature remains activated. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ----------------------------- |
+| show | boolean | Yes | Whether to show this feature at the top of the lock screen. The value **true** means to show this feature at the top of the lock screen, and **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ---------------- | ------------------------- |
+| Promise\| Promise used to return the result.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+var show=true
+context.setShowOnLockScreen(show).then((data) => {
+ console.info("=======================>setShowOnLockScreenCallback====================>");
+ console.info("====>data====>" + JSON.stringify(data));
+});
+```
+
+## Context.setWakeUpScreen7+
+
+setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback\): void
+
+Sets whether to wake up the screen when this feature is restored. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ----------------------------- |
+| wakeUp | boolean | Yes | Whether to wake up the screen. The value **true** means to wake up the screen, and **false** means the opposite.|
+| callback | AsyncCallback\ | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+var wakeUp=true
+context.setWakeUpScreen(wakeUp, (err) => {
+ console.log('---------- setWakeUpScreen fail, err: -----------', err);
+});
+```
+
+## Context.setWakeUpScreen7+
+
+setWakeUpScreen(wakeUp: boolean): Promise\;
+
+Sets whether to wake up the screen when this feature is restored. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ----------------------------- |
+| wakeUp | boolean | Yes | Whether to wake up the screen. The value **true** means to wake up the screen, and **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ---------------- | ------------------------- |
+| Promise\| Promise used to return the result.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+var wakeUp=true
+context.setWakeUpScreen(wakeUp).then((data) => {
+ console.info("=======================>setWakeUpScreenCallback====================>");
+ console.info("====>data====>" + JSON.stringify(data));
+});
+```
+
+
## Context.getProcessInfo7+
@@ -357,7 +573,7 @@ context.getProcessInfo().then((data) => {
getElementName(callback: AsyncCallback\): void
-Obtains the **ohos.bundle.ElementName** object of the current ability. This API uses an asynchronous callback to return the result.
+Obtains the **ohos.bundle.ElementName** object of this ability. This API uses an asynchronous callback to return the result.
This API is available only to Page abilities.
@@ -383,7 +599,7 @@ context.getElementName()
getElementName(): Promise\
-Obtains the **ohos.bundle.ElementName** object of the current ability. This API uses a promise to return the result.
+Obtains the **ohos.bundle.ElementName** object of this ability. This API uses a promise to return the result.
This API is available only to Page abilities.
@@ -510,7 +726,7 @@ context.getCallingBundle().then((data) => {
getCacheDir(callback: AsyncCallback\): void
-Obtains the cache directory of the application on the internal storage. This API uses an asynchronous callback to return the result.
+Obtains the cache directory of the application in the internal storage. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -538,7 +754,7 @@ context.getCacheDir((err, data) => {
getCacheDir(): Promise\
-Obtains the cache directory of the application on the internal storage. This API uses a promise to return the result.
+Obtains the cache directory of the application in the internal storage. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -563,7 +779,7 @@ context.getCacheDir().then((data) => {
getFilesDir(callback: AsyncCallback\): void
-Obtains the file directory of the application on the internal storage. This API uses an asynchronous callback to return the result.
+Obtains the file directory of the application in the internal storage. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -591,7 +807,7 @@ context.getFilesDir((err, data) => {
getFilesDir(): Promise\
-Obtains the file directory of the application on the internal storage. This API uses a promise to return the result.
+Obtains the file directory of the application in the internal storage. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -732,7 +948,7 @@ Obtains the **ModuleInfo** object of the application. This API uses an asynchron
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object.|
+| callback | AsyncCallback\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | Yes | Callback used to return the **ModuleInfo** object.|
**Example**
@@ -760,7 +976,7 @@ Obtains the **ModuleInfo** object of the application. This API uses a promise to
| Type | Description |
| --------------- | ------------------------- |
-| Promise\<[HapModuleInfo](#hapmoduleinfo)> | Promise used to return the **ModuleInfo** object.|
+| Promise\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | Promise used to return the **ModuleInfo** object.|
**Example**
@@ -774,9 +990,9 @@ context.getHapModuleInfo().then((data) => {
## Context.getAppVersionInfo7+
-getAppVersionInfo(callback: AsyncCallback\): void
+getAppVersionInfo(callback: AsyncCallback\): void
-Obtains the version information of the application. This API uses an asynchronous callback to return the result.
+Obtains the version information of this application. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -804,7 +1020,7 @@ context.getAppVersionInfo((err, data) => {
getAppVersionInfo(): Promise\
-Obtains the version information of the application. This API uses a promise to return the result.
+Obtains the version information of this application. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -828,7 +1044,7 @@ context.getAppVersionInfo().then((data) => {
getAbilityInfo(callback: AsyncCallback\): void
-Obtains information of the current ability. This API uses an asynchronous callback to return the result.
+Obtains information about this ability. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -856,7 +1072,7 @@ context.getAbilityInfo((err, data) => {
getAbilityInfo(): Promise\
-Obtains information of the current ability. This API uses a promise to return the result.
+Obtains information about this ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -897,6 +1113,111 @@ import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext().getApplicationContext();
```
+## Context.isUpdatingConfigurations7+
+
+isUpdatingConfigurations(callback: AsyncCallback\): void;
+
+Checks whether the configuration of this ability is being changed. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ------------------------- |
+| callback | AsyncCallback\ | Yes | Returns **true** if the configuration of the capability is being changed; returns **false** otherwise.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+context.isUpdatingConfigurations((err, data) => {
+ if (err) {
+ console.error('Operation failed. Cause: ' + JSON.stringify(err));
+ return;
+ }
+ console.info('Operation successful. Data:' + JSON.stringify(data));
+});
+```
+
+## Context.isUpdatingConfigurations7+
+
+isUpdatingConfigurations(): Promise\;
+
+Checks whether the configuration of this ability is being changed. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Return value**
+
+| Type | Description |
+| --------------- | ------------------------- |
+|Promise\ | Returns **true** if the configuration of the capability is being changed; returns **false** otherwise.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+context.isUpdatingConfigurations().then((data) => {
+ console.info("====>data====>" + JSON.stringify(data));
+});
+```
+
+## Context.printDrawnCompleted7+
+
+printDrawnCompleted(callback: AsyncCallback\): void;
+
+Notifies the system of the time required to draw this page function. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ------------------------- |
+| callback | AsyncCallback\ | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+context.printDrawnCompleted((err, data) => {
+ if (err) {
+ console.error('Operation failed. Cause: ' + JSON.stringify(err));
+ return;
+ }
+ console.info('Operation successful. Data:' + JSON.stringify(data));
+});
+```
+
+## Context.printDrawnCompleted7+
+
+printDrawnCompleted(): Promise\;
+
+Notifies the system of the time required to draw this page function. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Return value**
+
+| Type | Description |
+| --------------- | ------------------------- |
+|Promise\ | Promise used to return the result.|
+
+**Example**
+
+```js
+import featureAbility from '@ohos.ability.featureAbility'
+var context = featureAbility.getContext();
+context.printDrawnCompleted().then((data) => {
+ console.info("====>data====>" + JSON.stringify(data));
+});
+```
+
+
## PermissionOptions7+
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -916,31 +1237,10 @@ var context = featureAbility.getContext().getApplicationContext();
| permissions | Read-only | Array\ | Yes | Permissions requested. |
| authResults | Read-only | Array\ | Yes | Permission request result. |
-## HapModuleInfo7+
-
-Describes the HAP module information.
-
-| Name | Type| Readable| Writable| Description|
-| ------ | ------ | ------ | ------ | ------ |
-| name | string | Yes | No | Module name. |
-| description | string | Yes | No | Module description. |
-| descriptionId | number | Yes | No | Module description ID. |
-| icon | string | Yes | No | Module icon. |
-| label | string | Yes | No | Module label. |
-| labelId | number | Yes | No | Module label ID. |
-| iconId | number | Yes | No | Module icon ID. |
-| backgroundImg | string | Yes | No | Module background image. |
-| supportedModes | number | Yes | No | Running modes supported by the module. |
-| reqCapabilities | Array\ | Yes | No | Capabilities required for module running.|
-| deviceTypes | Array\ | Yes | No | Device types supported by the module.|
-| abilityInfo | Array\ | Yes | No | Ability information. |
-| moduleName | string | Yes | No | Module name. |
-| mainAbilityName | string | Yes | No | Name of the main ability. |
-| installationFree | boolean | Yes | No | Whether installation-free is supported. |
-| mainElementName | string | Yes| No| Information about the main ability.|
-
## AppVersionInfo7+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
| Name | Type| Readable | Writable | Description|
| ------ | ------ | ------| ------ | ------ |
| appName | string | Yes | No | Module name. |
diff --git a/en/application-dev/reference/apis/js-apis-DataUriUtils.md b/en/application-dev/reference/apis/js-apis-DataUriUtils.md
index 584b7e1285c0087bc1109bd32d50eb1143360df1..18cfa0cdc0c54ea8e8aa85fc43fcf61b3d63fc7a 100644
--- a/en/application-dev/reference/apis/js-apis-DataUriUtils.md
+++ b/en/application-dev/reference/apis/js-apis-DataUriUtils.md
@@ -1,4 +1,6 @@
-# DataUriUtils Module
+# DataUriUtils
+
+The **DataUriUtils** module provides APIs to handle utility classes for objects using the **DataAbilityHelper** schema. You can use the APIs to attach an ID to the end of a given URI and obtain, delete, or update the ID attached to the end of a given URI.
> **NOTE**
>
diff --git a/en/application-dev/reference/apis/js-apis-EnterpriseAdminExtensionAbility.md b/en/application-dev/reference/apis/js-apis-EnterpriseAdminExtensionAbility.md
index 5b7866478f7f527ceb806b2aec083bd21835800a..06cac3878b46d62fdc09e6a342bdcc9340714c4f 100644
--- a/en/application-dev/reference/apis/js-apis-EnterpriseAdminExtensionAbility.md
+++ b/en/application-dev/reference/apis/js-apis-EnterpriseAdminExtensionAbility.md
@@ -1,18 +1,22 @@
-# EnterpriseAdminExtentionAbility
+# EnterpriseAdminExtensionAbility
-The **EnterpriseAdminExtentionAbility** module provides APIs for Extension abilities of enterprise administrators.
+The **EnterpriseAdminExtensionAbility** module provides Extension abilities for enterprise administrators.
+
+To have the capabilities provided by the module, for example, receiving the application activation or deactivation notification sent by the system, an enterprise administrator application must have an **EnterpriseAdminExtensionAbility** instance and override the APIs in it.
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+>
> The APIs of this module can be used only in the stage model.
+
## Modules to Import
```ts
-import EnterpriseAdminExtentionAbility from '@ohos.EnterpriseAdminExtentionAbility'
+import EnterpriseAdminExtensionAbility from '@ohos.EnterpriseAdminExtensionAbility'
```
-## EnterpriseAdminExtentionAbility.onAdminEnabled
+## EnterpriseAdminExtensionAbility.onAdminEnabled
onAdminEnabled(): void
@@ -22,14 +26,14 @@ Called when an enterprise administrator is enabled.
**Example**
- ```ts
+```ts
export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility {
- onAdminEnabled() {
- }
+ onAdminEnabled() {
+ }
};
- ```
+```
-## EnterpriseAdminExtentionAbility.onAdminDisabled
+## EnterpriseAdminExtensionAbility.onAdminDisabled
onAdminDisabled(): void
@@ -38,11 +42,10 @@ Called when an enterprise administrator is disabled.
**System capability**: SystemCapability.Customization.EnterpriseDeviceManager
**Example**
-
- ```ts
+```ts
export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility {
- onAdminDisabled() {
- }
+ onAdminDisabled() {
+ }
};
- ```
+```
diff --git a/en/application-dev/reference/apis/js-apis-ability-context.md b/en/application-dev/reference/apis/js-apis-ability-context.md
index b858d93cbd061d4f1df583ac9d4045e152105b7a..e2333a523a918e229c6a35c4e341df9383bfb26a 100644
--- a/en/application-dev/reference/apis/js-apis-ability-context.md
+++ b/en/application-dev/reference/apis/js-apis-ability-context.md
@@ -1,17 +1,14 @@
# AbilityContext
+The **AbilityContext** module, inherited from **Context**, implements the context for abilities.
+
+This module provides APIs for accessing ability-specific resources. You can use the APIs to start and terminate an ability, obtain the caller interface, and request permissions from users by displaying a pop-up window.
+
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
-Implements the ability context. This module is inherited from **Context**.
-
-## Modules to Import
-
-```js
-import Ability from '@ohos.application.Ability'
-```
## Usage
Before using the **AbilityContext** module, you must define a child class that inherits from **Ability**.
@@ -25,7 +22,6 @@ class MainAbility extends Ability {
}
```
-
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -34,16 +30,18 @@ class MainAbility extends Ability {
| -------- | -------- | -------- | -------- | -------- |
| abilityInfo | AbilityInfo | Yes| No| Ability information.|
| currentHapModuleInfo | HapModuleInfo | Yes| No| Information about the current HAP.|
-
+| config | [Configuration](js-apis-configuration.md) | Yes| No| Configuration information.|
## AbilityContext.startAbility
startAbility(want: Want, callback: AsyncCallback<void>): void
-Starts an ability. This API uses a callback to return the result.
+Starts an ability. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+**System API**: This is a system API and cannot be called by third-party applications.
+
**Parameters**
| Name| Type| Mandatory| Description|
@@ -69,10 +67,12 @@ Starts an ability. This API uses a callback to return the result.
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void
-Starts an ability. This API uses a callback to return the result.
+Starts an ability with start options specified. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+**System API**: This is a system API and cannot be called by third-party applications.
+
**Parameters**
| Name| Type| Mandatory| Description|
@@ -106,6 +106,8 @@ Starts an ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+**System API**: This is a system API and cannot be called by third-party applications.
+
**Parameters**
| Name| Type| Mandatory| Description|
@@ -143,7 +145,7 @@ Starts an ability. This API uses a promise to return the result.
startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
-Starts an ability. This API uses a callback to return the result when the ability is terminated.
+Starts an ability. This API uses an asynchronous callback to return the result when the ability is terminated.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -171,7 +173,7 @@ Starts an ability. This API uses a callback to return the result when the abilit
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
-Starts an ability. This API uses a callback to return the result when the ability is terminated.
+Starts an ability with start options specified. This API uses an asynchronous callback to return the result when the ability is terminated.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -235,12 +237,134 @@ Starts an ability. This API uses a promise to return the result when the ability
})
```
+## AbilityContext.startAbilityForResultWithAccount
+
+startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void;
+
+Starts an ability. This API uses an asynchronous callback to return the result when the account of the ability is destroyed.
+
+**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| accountId | number | Yes| ID of the account.|
+| callback | AsyncCallback\ | Yes| Callback used to return the result.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var accountId = 100;
+ this.context.startAbilityWithAccount(want, accountId, (err, data) => {
+ console.log('---------- startAbilityWithAccount fail, err: -----------', err);
+ console.log('---------- startAbilityWithAccount success, data: -----------', data);
+ });
+ ```
+
+
+## AbilityContext.startAbilityForResultWithAccount
+
+startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
+
+Starts an ability with start options specified. This API uses an asynchronous callback to return the result when the account of the ability is destroyed.
+
+**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| accountId | number | Yes| ID of the account.|
+| options | [StartOptions](js-apis-application-StartOptions.md) | Yes| Parameters used for starting the ability.|
+| callback | AsyncCallback\ | Yes| Callback used to return the result.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var accountId = 100;
+ var options = {
+ windowMode: 0,
+ };
+ this.context.startAbilityForResultWithAccount(want, accountId, options, (err) => {
+ console.log('---------- startAbilityForResultWithAccount fail, err: -----------', err);
+ });
+ ```
+
+
+ ## AbilityContext.startAbilityForResultWithAccount
+
+startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\;
+
+Starts an ability with start options specified. This API uses a promise to return the result when the account of the ability is destroyed.
+
+**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| accountId | number | Yes| ID of the account.|
+| options | [StartOptions](js-apis-application-StartOptions.md) | No| Parameters used for starting the ability.|
+
+**Return value**
+
+| Type| Description|
+| -------- | -------- |
+| Promise<AbilityResult> | Promise used to return the result.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var accountId = 100;
+ var options = {
+ windowMode: 0,
+ };
+ this.context.startAbilityForResultWithAccount(want, accountId, options)
+ .then((data) => {
+ console.log('---------- startAbilityForResultWithAccount success, data: -----------', data);
+ })
+ .catch((err) => {
+ console.log('---------- startAbilityForResultWithAccount fail, err: -----------', err);
+ })
+ ```
+
## AbilityContext.terminateSelf
terminateSelf(callback: AsyncCallback<void>): void;
-Terminates this ability. This API uses a callback to return the result.
+Terminates this ability. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -248,7 +372,7 @@ Terminates this ability. This API uses a callback to return the result.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<void> | Yes| Callback used to return the result indicating whether the API is successfully called.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
@@ -271,12 +395,12 @@ Terminates this ability. This API uses a promise to return the result.
| Type| Description|
| -------- | -------- |
-| Promise<void> | Promise used to return the result indicating whether the API is successfully called.|
+| Promise<void> | Promise used to return the result.|
**Example**
```js
- this.context.terminateSelf(want).then((data) => {
+ this.context.terminateSelf().then((data) => {
console.log('success:' + JSON.stringify(data));
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
@@ -288,7 +412,7 @@ Terminates this ability. This API uses a promise to return the result.
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
-Terminates this ability. This API uses a callback to return the information to the caller of **startAbilityForResult**.
+Terminates this ability. This API uses an asynchronous callback to return the information to the caller of **startAbilityForResult**.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -346,6 +470,149 @@ Terminates this ability. This API uses a promise to return information to the ca
)
```
+## AbilityContext.connectAbility
+
+connectAbility(want: Want, options: ConnectOptions): number;
+
+Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to another ability.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| options | [ConnectOptions](js-apis-featureAbility.md#connectoptions) | No| Remote object instance.|
+
+**Return value**
+
+| Type| Description|
+| -------- | -------- |
+| number | Result code of the ability connection.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var options = {
+ onConnect(elementName, remote) { console.log('----------- onConnect -----------') },
+ onDisconnect(elementName) { console.log('----------- onDisconnect -----------') },
+ onFailed(code) { console.log('----------- onFailed -----------') }
+ }
+ const result = this.context.connectAbility(want, options);
+ console.log('----------- connectAbilityResult: ------------', result);
+ ```
+
+
+## AbilityContext.connectAbilityWithAccount
+
+connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number;
+
+Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect this ability to another ability.
+
+**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| accountId | number | Yes| ID of the account.|
+| options | [ConnectOptions](js-apis-featureAbility.md#connectoptions) | No| Parameters for the connection.|
+
+**Return value**
+
+| Type| Description|
+| -------- | -------- |
+| number | Result code of the ability connection.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var accountId = 100;
+ var options = {
+ onConnect(elementName, remote) { console.log('----------- onConnect -----------') },
+ onDisconnect(elementName) { console.log('----------- onDisconnect -----------') },
+ onFailed(code) { console.log('----------- onFailed -----------') }
+ }
+ const result = this.context.connectAbilityWithAccount(want, accountId, options);
+ console.log('----------- connectAbilityResult: ------------', result);
+ ```
+
+## AbilityContext.disconnectAbility
+
+disconnectAbility(connection: number): Promise\;
+
+Disconnects a connection. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| connection | number | Yes| Result code of the ability connection.|
+
+**Return value**
+
+| Type| Description|
+| -------- | -------- |
+| Promise\ | Promise used to return the result.|
+
+**Example**
+
+ ```js
+ var connectionNumber = 0;
+ this.context.disconnectAbility(connectionNumber).then((data) => {
+ console.log('disconnectAbility success, data: ', data);
+ }).catch((err) => {
+ console.log('disconnectAbility fail, err: ', err);
+ });
+ ```
+
+## AbilityContext.disconnectAbility
+
+disconnectAbility(connection: number, callback:AsyncCallback\): void;
+
+Disconnects a connection. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| connection | number | Yes| Result code of the ability connection.|
+| callback | AsyncCallback\ | Yes| Callback used to return the result.|
+
+**Example**
+
+ ```js
+ var connectionNumber = 0;
+ this.context.disconnectAbility(connectionNumber, (err) => {
+ console.log('---------- disconnectAbility fail, err: -----------', err);
+ });
+ ```
## AbilityContext.startAbilityByCall
@@ -388,12 +655,126 @@ Obtains the caller interface of the specified ability, and if the specified abil
}
```
+## AbilityContext.startAbilityWithAccount
+
+startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
+
+Starts an ability with the account ID specified. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| accountId | number | Yes| ID of the account.|
+| callback | AsyncCallback\ | Yes| Callback used to return the result.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var accountId = 100;
+ this.context.startAbilityWithAccount(want, accountId, (err) => {
+ console.log('---------- startAbilityWithAccount fail, err: -----------', err);
+ });
+ ```
+
+
+## AbilityContext.startAbilityWithAccount
+
+startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
+
+Starts an ability with the account ID and start options specified. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| accountId | number | Yes| ID of the account.|
+| options | [StartOptions](js-apis-application-StartOptions.md) | No| Parameters used for starting the ability.|
+| callback | AsyncCallback\ | Yes| Callback used to return the result.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var accountId = 100;
+ var options = {
+ windowMode: 0,
+ };
+ this.context.startAbilityWithAccount(want, accountId, options, (err) => {
+ console.log('---------- startAbilityWithAccount fail, err: -----------', err);
+ });
+ ```
+
+
+## AbilityContext.startAbilityWithAccount
+
+startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\;
+
+Starts an ability with the account ID specified. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
+| accountId | number | Yes| ID of the account.|
+| options | [StartOptions](js-apis-application-StartOptions.md) | No| Parameters used for starting the ability.|
+
+**Example**
+
+ ```js
+ var want = {
+ "deviceId": "",
+ "bundleName": "com.extreme.test",
+ "abilityName": "MainAbility"
+ };
+ var accountId = 100;
+ var options = {
+ windowMode: 0,
+ };
+ this.context.startAbilityWithAccount(want, accountId, options)
+ .then((data) => {
+ console.log('---------- startAbilityWithAccount success, data: -----------', data);
+ })
+ .catch((err) => {
+ console.log('---------- startAbilityWithAccount fail, err: -----------', err);
+ })
+ ```
## AbilityContext.requestPermissionsFromUser
requestPermissionsFromUser(permissions: Array<string>, requestCallback: AsyncCallback<PermissionRequestResult>) : void;
-Requests permissions from the user by displaying a pop-up window. This API uses a callback to return the result.
+Requests permissions from the user by displaying a pop-up window. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -402,7 +783,7 @@ Requests permissions from the user by displaying a pop-up window. This API uses
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| permissions | Array<string> | Yes| Permissions to request.|
-| callback | AsyncCallback<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | Yes| Callback used to return the result indicating whether the API is successfully called.|
+| callback | AsyncCallback<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | Yes| Callback used to return the permission request result.|
**Example**
@@ -433,7 +814,7 @@ Requests permissions from the user by displaying a pop-up window. This API uses
| Type| Description|
| -------- | -------- |
-| Promise<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | Promise used to return the result indicating whether the API is successfully called.|
+| Promise<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | Promise used to return the permission request result.|
**Example**
@@ -452,7 +833,7 @@ Requests permissions from the user by displaying a pop-up window. This API uses
setMissionLabel(label: string, callback:AsyncCallback<void>): void;
-Sets the label of the ability in the mission. This API uses an asynchronous callback to return the result.
+Sets a label for this ability in the mission. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -461,7 +842,7 @@ Sets the label of the ability in the mission. This API uses an asynchronous call
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| label | string | Yes| Label of the ability to set.|
-| callback | AsyncCallback<void> | Yes| Callback used to return the result indicating whether the API is successfully called.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
@@ -476,7 +857,7 @@ Sets the label of the ability in the mission. This API uses an asynchronous call
setMissionLabel(label: string): Promise<void>
-Sets the label of the ability in the mission. This API uses a promise to return the result.
+Sets a label for this ability in the mission. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
@@ -490,7 +871,7 @@ Sets the label of the ability in the mission. This API uses a promise to return
| Type| Description|
| -------- | -------- |
-| Promise<void> | Promise used to return the result indicating whether the API is successfully called.|
+| Promise<void> | Promise used to return the result.|
**Example**
@@ -501,6 +882,117 @@ Sets the label of the ability in the mission. This API uses a promise to return
console.log('failed:' + JSON.stringify(error));
});
```
+## AbilityContext.setMissionIcon
+
+setMissionIcon(icon: image.PixelMap, callback:AsyncCallback\): void;
+
+Sets an icon for this ability in the mission. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| icon | image.PixelMap | Yes| Icon of the ability to set.|
+| callback | AsyncCallback\ | Yes| Callback used to return the result.|
+
+**Example**
+
+ ```js
+ import image from '@ohos.multimedia.image'
+ var imagePixelMap;
+ var color = new ArrayBuffer(0);
+ var initializationOptions = {
+ size: {
+ height: 100,
+ width: 100
+ }
+ };
+ image.createPixelMap(color, initializationOptions)
+ .then((data) => {
+ imagePixelMap = data;
+ })
+ .catch((err) => {
+ console.log('--------- createPixelMap fail, err: ---------', err)
+ });
+ this.context.setMissionIcon(imagePixelMap, (err) => {
+ console.log('---------- setMissionIcon fail, err: -----------', err);
+ })
+ ```
+
+
+## AbilityContext.setMissionIcon
+
+setMissionIcon(icon: image.PixelMap): Promise\;
+
+Sets an icon for this ability in the mission. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| icon | image.PixelMap | Yes| Icon of the ability to set.|
+
+**Return value**
+
+| Type| Description|
+| -------- | -------- |
+| Promise<void> | Promise used to return the result.|
+
+**Example**
+
+ ```js
+ import image from '@ohos.multimedia.image'
+ var imagePixelMap;
+ var color = new ArrayBuffer(0);
+ var initializationOptions = {
+ size: {
+ height: 100,
+ width: 100
+ }
+ };
+ image.createPixelMap(color, initializationOptions)
+ .then((data) => {
+ imagePixelMap = data;
+ })
+ .catch((err) => {
+ console.log('--------- createPixelMap fail, err: ---------', err)
+ });
+ this.context.setMissionIcon(imagePixelMap)
+ .then((data) => {
+ console.log('-------------- setMissionIcon success, data: -------------', data);
+ })
+ .catch((err) => {
+ console.log('-------------- setMissionIcon fail, err: -------------', err);
+ });
+ ```
+## AbilityContext.restoreWindowStage
+
+restoreWindowStage(localStorage: LocalStorage) : void;
+
+Restores the window stage data for this ability.
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**Parameters**
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| localStorage | image.LocalStorage | Yes| Storage used to store the restored window stage.|
+
+**Example**
+
+ ```js
+ var storage = new LocalStorage();
+ this.context.restoreWindowStage(storage);
+ ```
## AbilityContext.isTerminating
diff --git a/en/application-dev/reference/apis/js-apis-ability-errorCode.md b/en/application-dev/reference/apis/js-apis-ability-errorCode.md
index cc0197f022957aadb0dd784c1d4ae8c6e0c50005..6a131521d3c447cfb2df65b53a592c5be89678be 100644
--- a/en/application-dev/reference/apis/js-apis-ability-errorCode.md
+++ b/en/application-dev/reference/apis/js-apis-ability-errorCode.md
@@ -1,8 +1,10 @@
# ErrorCode
+The **ErrorCode** module defines the error codes that can be used when the ability is started.
+
> **NOTE**
>
-> The initial APIs of this module are supported since API 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -12,7 +14,7 @@ import errorCode from '@ohos.ability.errorCode'
## ErrorCode
-Defines the error code used when the ability is started.
+Defines the error codes used when the ability is started.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
diff --git a/en/application-dev/reference/apis/js-apis-ability-wantConstant.md b/en/application-dev/reference/apis/js-apis-ability-wantConstant.md
index e1d57d47b1b77f1695f8ec79ac49bfbb22422d05..c2bb08c5314a44dcf6f4ad9246e6ee08a313ecd8 100644
--- a/en/application-dev/reference/apis/js-apis-ability-wantConstant.md
+++ b/en/application-dev/reference/apis/js-apis-ability-wantConstant.md
@@ -1,8 +1,10 @@
# wantConstant
+The **wantConstant** module provides the action, entity, and flags used in **Want** objects.
+
> **NOTE**
>
-> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+> The initial APIs of this module are supported since API 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -12,73 +14,75 @@ import wantConstant from '@ohos.ability.wantConstant'
## wantConstant.Action
-**System capability**: SystemCapability.Ability.AbilityBase
+Enumerates the action constants of the **Want** object.
-Lists the permissions.
+**System capability**: SystemCapability.Ability.AbilityBase
-| Common Event Macro | Common Event Name | Subscriber Permission |
+| Name | Value | Description |
| ------------ | ------------------ | ---------------------- |
-| ACTION_HOME | ohos.want.action.home | None |
-| ACTION_DIAL | ohos.want.action.dial | None |
-| ACTION_SEARCH | ohos.want.action.search | None |
-| ACTION_WIRELESS_SETTINGS | ohos.settings.wireless | None |
-| ACTION_MANAGE_APPLICATIONS_SETTINGS | ohos.settings.manage.applications | None |
-| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | None |
-| ACTION_SET_ALARM | ohos.want.action.setAlarm | None |
-| ACTION_SHOW_ALARMS | ohos.want.action.showAlarms | None |
-| ACTION_SNOOZE_ALARM | ohos.want.action.snoozeAlarm | None |
-| ACTION_DISMISS_ALARM | ohos.want.action.dismissAlarm | None |
-| ACTION_DISMISS_TIMER | ohos.want.action.dismissTimer | None |
-| ACTION_SEND_SMS | ohos.want.action.sendSms | None |
-| ACTION_CHOOSE | ohos.want.action.choose | None |
-| ACTION_IMAGE_CAPTURE8+ | ohos.want.action.imageCapture | None |
-| ACTION_VIDEO_CAPTUR8+ | ohos.want.action.videoCapture | None |
-| ACTION_SELECT | ohos.want.action.select | None |
-| ACTION_SEND_DATA | ohos.want.action.sendData | None |
-| ACTION_SEND_MULTIPLE_DATA | ohos.want.action.sendMultipleData | None |
-| ACTION_SCAN_MEDIA_FILE | ohos.want.action.scanMediaFile | None |
-| ACTION_VIEW_DATA | ohos.want.action.viewData | None |
-| ACTION_EDIT_DATA | ohos.want.action.editData | None |
-| INTENT_PARAMS_INTENT | ability.want.params.INTENT | None |
-| INTENT_PARAMS_TITLE | ability.want.params.TITLE | None |
-| ACTION_FILE_SELECT7+ | ohos.action.fileSelect | None |
-| PARAMS_STREAM7+ | ability.params.stream | None |
-| ACTION_APP_ACCOUNT_OAUTH 8+ | ohos.account.appAccount.action.oauth | None |
+| ACTION_HOME | ohos.want.action.home | Action of returning to the home page. |
+| ACTION_DIAL | ohos.want.action.dial | Action of launching the numeric keypad. |
+| ACTION_SEARCH | ohos.want.action.search | Action of launching the search function. |
+| ACTION_WIRELESS_SETTINGS | ohos.settings.wireless | Action of launching the UI that provides radio network settings, for example, Wi-Fi option. |
+| ACTION_MANAGE_APPLICATIONS_SETTINGS | ohos.settings.manage.applications | Action of launching the UI for managing installed applications. |
+| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | Action of launching the UI that displays the details of an application. |
+| ACTION_SET_ALARM | ohos.want.action.setAlarm | Action of launching the UI for setting the alarm clock. |
+| ACTION_SHOW_ALARMS | ohos.want.action.showAlarms | Action of launching the UI that displays all clock alarms. |
+| ACTION_SNOOZE_ALARM | ohos.want.action.snoozeAlarm | Action of launching the UI for snoozing an alarm. |
+| ACTION_DISMISS_ALARM | ohos.want.action.dismissAlarm | Action of launching the UI for deleting an alarm. |
+| ACTION_DISMISS_TIMER | ohos.want.action.dismissTimer | Action of launching the UI for dismissing a timer. |
+| ACTION_SEND_SMS | ohos.want.action.sendSms | Action of launching the UI for sending an SMS. |
+| ACTION_CHOOSE | ohos.want.action.choose | Action of launching the UI for openning a contact or picture. |
+| ACTION_IMAGE_CAPTURE8+ | ohos.want.action.imageCapture | Action of launching the UI for photographing. |
+| ACTION_VIDEO_CAPTURE8+ | ohos.want.action.videoCapture | Action of launching the UI for shooting a video. |
+| ACTION_SELECT | ohos.want.action.select | Action of launching the UI for application selection. |
+| ACTION_SEND_DATA | ohos.want.action.sendData | Action of launching the UI for sending a single data record. |
+| ACTION_SEND_MULTIPLE_DATA | ohos.want.action.sendMultipleData | Action of launching the UI for sending multiple data records. |
+| ACTION_SCAN_MEDIA_FILE | ohos.want.action.scanMediaFile | Action of requesting a media scanner to scan a file and add the file to the media library. |
+| ACTION_VIEW_DATA | ohos.want.action.viewData | Action of viewing data. |
+| ACTION_EDIT_DATA | ohos.want.action.editData | Action of editing data. |
+| INTENT_PARAMS_INTENT | ability.want.params.INTENT | Action of displaying selection options with an action selector. |
+| INTENT_PARAMS_TITLE | ability.want.params.TITLE | Title of the character sequence dialog box used with the action selector. |
+| ACTION_FILE_SELECT7+ | ohos.action.fileSelect | Action of selecting a file. |
+| PARAMS_STREAM7+ | ability.params.stream | URI of the data stream associated with the target when the data is sent. |
+| ACTION_APP_ACCOUNT_OAUTH 8+ | ohos.account.appAccount.action.oauth | Action of providing the OAuth service. |
+| ACTION_MARKER_DOWNLOAD 9+ | ohos.want.action.marketDownload | Action of downloading an application from the application market. **System API**: This is a system API and cannot be called by third-party applications. |
## wantConstant.Entity
-**System capability**: SystemCapability.Ability.AbilityBase
+Enumerates the entity constants of the **Want** object.
-Lists the permissions.
+**System capability**: SystemCapability.Ability.AbilityBase
-| Common Event Macro | Common Event Name | Subscriber Permission |
+| Name | Value | Description |
| ------------ | ------------------ | ---------------------- |
-| ENTITY_DEFAULT | entity.system.default | None |
-| ENTITY_HOME | entity.system.homel | None |
-| ENTITY_VOICE | ENTITY_VOICE | None |
-| ENTITY_BROWSABLE | entity.system.browsable | None |
-| ENTITY_VIDEO | entity.system.video | None |
-| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | None |
+| ENTITY_DEFAULT | entity.system.default | Default entity. The default entity is used if no entity is specified. |
+| ENTITY_HOME | entity.system.home | Home screen entity. |
+| ENTITY_VOICE | entity.system.voice | Voice interaction entity. |
+| ENTITY_BROWSABLE | entity.system.browsable | Browser type entity. |
+| ENTITY_VIDEO | entity.system.video | Video type entity. |
+
+## wantConstant.Flags
-## flags
+Describes flags.
**System capability**: SystemCapability.Ability.AbilityBase
| Name | Value | Description |
| ------------------------------------ | ---------- | ------------------------------------------------------------ |
| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | Indicates the permission to read the URI. |
-| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | Indicates the permission to write the URI. |
+| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | Indicates the permission to write data to the URI. |
| FLAG_ABILITY_FORWARD_RESULT | 0x00000004 | Returns the result to the ability. |
| FLAG_ABILITY_CONTINUATION | 0x00000008 | Indicates whether the ability on the local device can be continued on a remote device. |
| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | Indicates that a component does not belong to OHOS. |
| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | Indicates that an ability is enabled. |
-| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | Indicates the permission to make the URI persistent. |
-| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | Indicates the permission to verify URIs by prefix matching. |
+| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | Indicates the permission to make the URI persistent. **System API**: This is a system API and cannot be called by third-party applications. |
+| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | Indicates the permission to verify URIs by prefix matching. **System API**: This is a system API and cannot be called by third-party applications.|
| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | Supports cross-device startup in a distributed scheduler. |
| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | Indicates that the Service ability is started regardless of whether the host application has been started. |
-| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that ability continuation is reversible. |
+| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that ability continuation is reversible. **System API**: This is a system API and cannot be called by third-party applications. |
| FLAG_INSTALL_ON_DEMAND | 0x00000800 | Indicates that the specific ability will be installed if it has not been installed. |
| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | Indicates that the specific ability will be installed in the background if it has not been installed. |
| FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | Clears other operation missions. This flag can be set for the **Want** object in the **startAbility** API passed to [ohos.app.Context](js-apis-ability-context.md) and must be used together with **flag_ABILITY_NEW_MISSION**.|
diff --git a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
index 5a21d564110cdf922e344c52ded3bd8d44604b2f..2b17d252af9d09d5519f36ece4306834e8085c5a 100644
--- a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
+++ b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
@@ -1,6 +1,6 @@
# Ability Access Control
-Provides program permission management capabilities, including authentication, authorization, and revocation.
+The **AbilityAccessCtrl** module provides APIs for application permission management, including authentication, authorization, and revocation.
> **NOTE**
>
@@ -69,6 +69,36 @@ promise.then(data => {
});
```
+### verifyAccessTokenSync9+
+
+verifyAccessTokenSync(tokenID: number, permissionName: string): GrantStatus
+
+Checks whether an application has been granted the specified permission. This API synchronously returns the result.
+
+**System capability**: SystemCapability.Security.AccessToken
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------- | ---- | ------------------------------------------ |
+| tokenID | number | Yes | ID of the application. |
+| permissionName | string | Yes | Name of the permission to verify.|
+
+**Return value**
+
+| Type | Description |
+| :------------ | :---------------------------------- |
+| [GrantStatus](#grantstatus) | Permission grant state.|
+
+**Example**
+
+```js
+var AtManager = abilityAccessCtrl.createAtManager();
+let tokenID = 0;
+let data = verifyAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+console.log(`data->${JSON.stringify(data)}`);
+```
+
### grantUserGrantedPermission
grantUserGrantedPermission(tokenID: number, permissionName: string, permissionFlag: number): Promise<number>
diff --git a/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md b/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md
index a609e0df688e7a9cc5b32ea25907eda95ab14c47..d30dce2a75e700019c9f44ce1c918a9574f3cea7 100644
--- a/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md
+++ b/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md
@@ -1,5 +1,7 @@
# AbilityDelegatorRegistry
+The **AbilityDelegatorRegistry** module provides APIs for storing the global registers of the registered **AbilityDelegator** and **AbilityDelegatorArgs** objects. You can use the APIs to obtain the **AbilityDelegator** and **AbilityDelegatorArgs** objects of an application.
+
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -24,8 +26,6 @@ Enumerates the ability lifecycle states.
| BACKGROUND | 3 | The ability is running in the background. |
| DESTROY | 4 | The ability is destroyed.|
-
-
## AbilityDelegatorRegistry.getAbilityDelegator
getAbilityDelegator(): AbilityDelegator
diff --git a/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md b/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md
index 508463e3a428fffe336de4ae2c986623fb54d3b1..098f4ebba840a13d1f37d6e14256fcc9695f2a8d 100644
--- a/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md
+++ b/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md
@@ -1,17 +1,11 @@
# AbilityRunningInfo
+The **AbilityRunningInfo** module implements ability running information and ability states.
+
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-Provides ability running information.
-
-## Modules to Import
-
-```js
-import abilitymanager from '@ohos.application.abilityManager';
-```
-
## Usage
The ability running information is obtained by using the **getAbilityRunningInfos** API in **abilityManager**.
@@ -27,26 +21,13 @@ abilitymanager.getAbilityRunningInfos((err,data) => {
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+**System API**: This is a system API and cannot be called by third-party applications.
+
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
-| ability | ElementName | Yes| No| Information that matches an ability. |
-| pid | number | Yes| No| Process ID.|
-| uid | number | Yes| No| User ID. |
-| processName | string | Yes| No| Process name. |
-| startTime | number | Yes| No| Ability start time. |
-| abilityState | [abilityManager.AbilityState](#abilitymanagerabilitystate) | Yes| No| Ability state. |
-
-
-## abilityManager.AbilityState
-
-Enumerates the ability states.
-
-**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-
-| Name| Value| Description|
-| -------- | -------- | -------- |
-| INITIAL | 0 | The ability is in the initial state.|
-| FOREGROUND | 9 | The ability is in the foreground state. |
-| BACKGROUND | 10 | The ability is in the background state. |
-| FOREGROUNDING | 11 | The ability is in the foregrounding state. |
-| BACKGROUNDING | 12 | The ability is in the backgrounding state. |
+| ability | ElementName | Yes| No| Information that matches an ability. |
+| pid | number | Yes| No| Process ID.|
+| uid | number | Yes| No| User ID. |
+| processName | string | Yes| No| Process name. |
+| startTime | number | Yes| No| Ability start time. |
+| abilityState | [abilityManager.AbilityState](js-apis-application-abilityManager.md#abilitystate) | Yes| No| Ability state. |
diff --git a/en/application-dev/reference/apis/js-apis-abilitystagecontext.md b/en/application-dev/reference/apis/js-apis-abilitystagecontext.md
index 65705aae3936cc2c9e9643f6142be6de6564124b..5475dc51466d01d8eadef472248cce237f1b6241 100644
--- a/en/application-dev/reference/apis/js-apis-abilitystagecontext.md
+++ b/en/application-dev/reference/apis/js-apis-abilitystagecontext.md
@@ -1,18 +1,14 @@
# AbilityStageContext
+The **AbilityStageContext** module, inherited from [Context](js-apis-application-context.md), implements the context of an ability stage.
+
+This module provides APIs for accessing a specific ability stage. You can use the APIs to obtain the **ModuleInfo** object and environment configuration of an ability stage.
+
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
-Implements the context of an ability stage. This module is inherited from [Context](js-apis-application-context.md).
-
-## Modules to Import
-
-```js
-import AbilityStage from '@ohos.application.AbilityStage';
-```
-
## Usage
The ability stage context is obtained through an **AbilityStage** instance.
diff --git a/en/application-dev/reference/apis/js-apis-accessibility.md b/en/application-dev/reference/apis/js-apis-accessibility.md
index 17ef631d0f7207b676177a59d0903cc77dcd1045..f9d286cbd34296fa43596032fe89f2ecdd6e5d93 100644
--- a/en/application-dev/reference/apis/js-apis-accessibility.md
+++ b/en/application-dev/reference/apis/js-apis-accessibility.md
@@ -1,6 +1,9 @@
# Accessibility
-> **NOTE**
+The **Accessibility** module implements the accessibility functions, including obtaining the accessibility application list, accessibility application enabled status, and captions configuration.
+
+> **NOTE**
+>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -13,162 +16,162 @@ import accessibility from '@ohos.accessibility';
Enumerates the states of an accessibility application.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- | Name | Description |
- | -------- | -------- |
- | enable | The accessibility application is enabled. |
- | disable | The accessibility application is disabled. |
- | install | The accessibility application has been installed. |
+| Name| Description|
+| -------- | -------- |
+| enable | The accessibility application is enabled.|
+| disable | The accessibility application is disabled.|
+| install | The accessibility application has been installed.|
## AbilityType
Enumerates the types of accessibility applications.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- | Name | Description |
- | -------- | -------- |
- | audible | The accessibility application provides audible feedback. |
- | generic | The accessibility application provides generic feedback. |
- | haptic | The accessibility application provides haptic feedback. |
- | spoken | The accessibility application provides spoken feedback. |
- | visual | The accessibility application provides visual feedback. |
+| Name| Description|
+| -------- | -------- |
+| audible | The accessibility application provides audible feedback.|
+| generic | The accessibility application provides generic feedback.|
+| haptic | The accessibility application provides haptic feedback.|
+| spoken | The accessibility application provides spoken feedback.|
+| visual | The accessibility application provides visual feedback.|
+| all9+ | All the preceding types.|
## AccessibilityAbilityInfo
Provides information about an accessibility application.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
### Attributes
- | Name | Type | Readable | Writable | Description |
- | -------- | -------- | -------- | -------- | -------- |
- | id | number | Yes | No | Ability ID. |
- | name | string | Yes | No | Ability name. |
- | bundleName | string | Yes | No | Bundle name. |
- | abilityTypes | Array<[AbilityType](#abilitytype)> | Yes | No | Accessibility application type. |
- | capabilities | Array<[Capability](#capability)> | Yes | No | Capabilities list of the accessibility application. |
- | description | string | Yes | No | Description of the accessibility application. |
- | eventTypes | Array<[EventType](#eventtype)> | Yes | No | List of events that the accessibility application focuses on. |
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| id | number | Yes| No| Ability ID.|
+| name | string | Yes| No| Ability name.|
+| bundleName | string | Yes| No| Bundle name.|
+| targetBundleNames9+ | Array<string> | Yes| No| Name of the target bundle.|
+| abilityTypes | Array<[AbilityType](#abilitytype)> | Yes| No| Accessibility application type.|
+| capabilities | Array<[Capability](#capability)> | Yes| No| Capabilities list of the accessibility application.|
+| description | string | Yes| No| Description of the accessibility application.|
+| eventTypes | Array<[EventType](#eventtype)> | Yes| No| List of events that the accessibility application focuses on.|
## Action
Describes the target action supported by an accessibility application.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-
- | Name | Description |
- | -------- | -------- |
- | click | Clicking. |
- | longClick | Long pressing. |
- | scrollForward | Scrolling forward. |
- | scrollBackward | Scrolling backward. |
- | focus | Obtaining focus. |
- | clearFocus | Clearing focus. |
- | clearSelection | Clearing selection. |
- | accessibilityFocus | Obtaining the accessibility focus. |
- | clearAccessibilityFocus | Clearing the accessibility focus. |
- | cut | Cut. |
- | copy | Copy. |
- | paste | Paste. |
- | select | Select. |
- | setText | Setting the text. |
- | delete | Delete. |
- | setSelection | Setting the selection. |
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
+
+| Name| Description|
+| -------- | -------- |
+| click | Clicking.|
+| longClick | Long pressing.|
+| scrollForward | Scrolling forward.|
+| scrollBackward | Scrolling backward.|
+| focus | Obtaining focus.|
+| clearFocus | Clearing focus.|
+| clearSelection | Clearing selection.|
+| accessibilityFocus | Obtaining the accessibility focus.|
+| clearAccessibilityFocus | Clearing the accessibility focus.|
+| cut | Cut.|
+| copy | Copy.|
+| paste | Paste.|
+| select | Select.|
+| setText | Setting the text.|
+| delete | Delete.|
+| setSelection | Setting the selection.|
## Capability
Enumerates the capabilities of an auxiliary application.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- | Name | Description |
- | -------- | -------- |
- | retrieve | Capability to retrieve the window content. |
- | touchGuide | Capability of touch guide mode. |
- | keyEventObserver | Capability to filter key events. |
- | zoom | Capability to control the display zoom level. |
- | gesture | Capability to perform gesture actions. |
+| Name| Description|
+| -------- | -------- |
+| retrieve | Capability to retrieve the window content.|
+| touchGuide | Capability of touch guide mode.|
+| keyEventObserver | Capability to filter key events.|
+| zoom | Capability to control the display zoom level.|
+| gesture | Capability to perform gesture actions.|
## CaptionsFontEdgeType8+
-Enumerates the caption font edge type.
+Enumerates the font edge types of captions.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
- | Name | Description |
- | -------- | -------- |
- | none | No effect. |
- | raised | Raised effect. |
- | depressed | Depressed effect. |
- | uniform | Uniform effect. |
- | dropShadow | Drop shadow effect. |
+| Name| Description|
+| -------- | -------- |
+| none | No effect.|
+| raised | Raised effect.|
+| depressed | Depressed effect.|
+| uniform | Uniform effect.|
+| dropShadow | Drop shadow effect.|
## CaptionsFontFamily8+
-Enumerates the caption font families.
+Enumerates the font families of captions.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
- | Name | Description |
- | -------- | -------- |
- | default | Default font family. |
- | monospacedSerif | Monospaced Serif fonts, which use the same width for each character. |
- | serif | Serif fonts. |
- | monospacedSansSerif | Monospaced Sans Serif fonts, which use the same width for each character. |
- | sansSerif | Sans Serif fonts. |
- | casual | Casual fonts. |
- | cursive | Cursive fonts. |
- | smallCapitals | Small caps fonts. |
+| Name| Description|
+| -------- | -------- |
+| default | Default font family.|
+| monospacedSerif | Monospaced Serif fonts, which use the same width for each character.|
+| serif | Serif fonts.|
+| monospacedSansSerif | Monospaced Sans Serif fonts, which use the same width for each character.|
+| sansSerif | Sans Serif fonts.|
+| casual | Casual fonts.|
+| cursive | Cursive fonts.|
+| smallCapitals | Small caps fonts.|
## CaptionsStyle8+
-Describes the caption style.
+Describes the style of captions.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
- | Name | Type | Readable | Writable | Description |
- | -------- | -------- | -------- | -------- | -------- |
- | fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes | No | Font family of the captions. |
- | fontScale | number | Yes | No | Font scale of the captions. |
- | fontColor | number \ | string | Yes | No | Font color of the captions. |
- | fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes | No | Font edge type of the captions. |
- | backgroundColor | number \ | string | Yes | No | Background color of the captions. |
- | windowColor | number \ | string | Yes | No | Window color of the captions. |
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes| No| Font family of captions.|
+| fontScale | number | Yes| No| Font scale of captions.|
+| fontColor | number \| string | Yes| No| Font color of captions.|
+| fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes| No| Font edge type of captions.|
+| backgroundColor | number \| string | Yes| No| Background color of captions.|
+| windowColor | number \| string | Yes| No| Window color of captions.|
## CaptionsManager8+
-Implements caption configuration management.
+Implements configuration management for captions.
-### Attributes
+**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
- | Name | Type | Readable | Writable | Description |
- | -------- | -------- | -------- | -------- | -------- |
- | enabled | boolean | Yes | No | Whether to enable caption configuration. |
- | style | [CaptionsStyle](#captionsstyle8) | Yes | No | Caption style. |
+### Attributes
-### Methods
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| enabled | boolean | Yes| No| Whether to enable captions configuration.|
+| style | [CaptionsStyle](#captionsstyle8) | Yes| No| Style of captions.|
-In the following API examples, you must first use the [accessibility.getCaptionsManager()](#accessibilitygetcaptionsmanager8) method to obtain a **captionsManager** instance, and then call the methods using the obtained instance.
+In the following API examples, you must first use the [accessibility.getCaptionsManager()](#accessibilitygetcaptionsmanager8) API to obtain a **captionsManager** instance, and then call the methods using the obtained instance.
-#### on('enableChange')
+### on('enableChange')
on(type: 'enableChange', callback: Callback<boolean>): void;
-Enables listening for enable status changes of caption configuration.
-
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+Enables listening for enabled status changes of captions configuration.
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | type | string | Yes | Type of the event to listen for, which is set to **enableChange** in this API. |
- | callback | Callback<boolean> | Yes | Callback invoked when the enable status of caption configuration changes. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Type of the event to listen for, which is set to **enableChange** in this API.|
+ | callback | Callback<boolean> | Yes| Callback invoked when the enabled status of captions configuration changes.|
-- Example
+- **Example**
```typescript
captionsManager.on('enableChange',(data) => {
@@ -176,22 +179,20 @@ Enables listening for enable status changes of caption configuration.
})
```
-#### on('styleChange')
+### on('styleChange')
on(type: 'styleChange', callback: Callback<CaptionsStyle>): void;
-Enables listening for caption style changes.
-
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+Enables listening for captions style changes.
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | type | string | Yes | Type of the event to listen for, which is set to **styleChange** in this API. |
- | callback | Callback<[CaptionsStyle](#captionsstyle8)> | Yes | Callback invoked when the caption style changes. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Type of the event to listen for, which is set to **styleChange** in this API.|
+ | callback | Callback<[CaptionsStyle](#captionsstyle8)> | Yes| Callback invoked when the style of captions changes.|
-- Example
+- **Example**
```typescript
captionsManager.on('styleChange',(data) => {
@@ -199,43 +200,39 @@ Enables listening for caption style changes.
})
```
-#### off('enableChange')
+### off('enableChange')
off(type: 'enableChange', callback?: Callback<boolean>): void;
-Disables listening for enable status changes of caption configuration.
-
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+Disables listening for enabled status changes of captions configuration.
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | type | string | Yes | Type of the event to listen for, which is set to **enableChange** in this API. |
- | callback | Callback<boolean> | No | Callback invoked when the enable status of caption configuration changes. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Type of the event to listen for, which is set to **enableChange** in this API.|
+ | callback | Callback<boolean> | No| Callback invoked when the enabled status of captions configuration changes.|
-- Example
+- **Example**
```typescript
captionsManager.off('enableChange')
```
-#### off('styleChange')
+### off('styleChange')
off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void;
-Disables listening for caption style changes.s is removed.
-
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+Disables listening for captions style changes.
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | type | string | Yes | Type of the event to listen for, which is set to **styleChange** in this API. |
- | callback | Callback<[CaptionsStyle](#captionsstyle8)> | No | Callback invoked when the caption style changes. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Type of the event to listen for, which is set to **styleChange** in this API.|
+ | callback | Callback<[CaptionsStyle](#captionsstyle8)> | No| Callback invoked when the style of captions changes.|
-- Example
+- **Example**
```typescript
captionsManager.off('styleChange')
@@ -245,80 +242,92 @@ Disables listening for caption style changes.s is removed.
Describes a GUI change event.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
### Attributes
- | Name | Type | Readable | Writable | Description |
- | -------- | -------- | -------- | -------- | -------- |
- | type | [EventType](#eventtype) | Yes | Yes | Accessibility event type. |
- | windowUpdateType | [WindowUpdateType](#windowupdatetype) | Yes | Yes | Window update type. |
- | bundleName | string | Yes | Yes | Target application name. |
- | componentType | string | Yes | Yes | Type of the event source component, for example, button or chart. |
- | pageId | number | Yes | Yes | Page ID of the event source. |
- | description | string | Yes | Yes | Event description. |
- | triggerAction | [Action](#action) | Yes | Yes | Action that triggers the event. |
- | textMoveUnit | [TextMoveUnit](#textmoveunit) | Yes | Yes | Text movement unit. |
- | contents | Array<string> | Yes | Yes | Array of contents. |
- | lastContent | string | Yes | Yes | Latest content. |
- | beginIndex | number | Yes | Yes | Sequence number of the first item displayed on the page. |
- | currentIndex | number | Yes | Yes | Sequence number of the current item. |
- | endIndex | number | Yes | Yes | Sequence number of the last item displayed on the page. |
- | itemCount | number | Yes | Yes | Total number of items. |
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| type | [EventType](#eventtype) | Yes| Yes| Accessibility event type.|
+| windowUpdateType | [WindowUpdateType](#windowupdatetype) | Yes| Yes| Window update type.|
+| bundleName | string | Yes| Yes| Target application name.|
+| componentType | string | Yes| Yes| Type of the event source component, for example, button or chart.|
+| pageId | number | Yes| Yes| Page ID of the event source.|
+| description | string | Yes| Yes| Event description.|
+| triggerAction | [Action](#action) | Yes| Yes| Action that triggers the event.|
+| textMoveUnit | [TextMoveUnit](#textmoveunit) | Yes| Yes| Text movement unit.|
+| contents | Array<string> | Yes| Yes| Array of contents.|
+| lastContent | string | Yes| Yes| Latest content.|
+| beginIndex | number | Yes| Yes| Sequence number of the first item displayed on the page.|
+| currentIndex | number | Yes| Yes| Sequence number of the current item.|
+| endIndex | number | Yes| Yes| Sequence number of the last item displayed on the page.|
+| itemCount | number | Yes| Yes| Total number of items.|
+
+### constructor
+
+constructor(jsonObject)
+
+Implements a constructor.
+
+- **Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | jsonObject | string | Yes| JSON string required for creating an object.|
+
+- **Example**
+
+ ```typescript
+ let eventInfo = new accessibility.EventInfo({"type":"click","bundleName":"com.example.MyApplication","triggerAction":"click"})
+ ```
## EventType
Enumerates accessibility event types.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-
- | Name | Description |
- | -------- | -------- |
- | click | Event of clicking a component. |
- | longClick | Event of long-pressing a component. |
- | select | Event of selecting a component. |
- | focus | Event indicating that the component obtains the focus. |
- | textUpdate | Event indicating that the component text has been updated. |
- | hoverEnter | Event indicating that the hover enters a component. |
- | hoverExit | Event indicating that the hover exits a component. |
- | scroll | Event of the scroll view. |
- | textSelectionUpdate | Event indicating that the selected text has been updated. |
- | accessibilityFocus | Event indicating that the accessibility focus has been obtained. |
- | accessibilityFocusClear | Event indicating that the accessibility focus has been cleared. |
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
+
+| Name| Description|
+| -------- | -------- |
+| click | Event of clicking a component.|
+| longClick | Event of long-pressing a component.|
+| select | Event of selecting a component.|
+| focus | Event indicating that the component obtains the focus.|
+| textUpdate | Event indicating that the component text has been updated.|
+| hoverEnter | Event indicating that the hover enters a component.|
+| hoverExit | Event indicating that the hover exits a component.|
+| scroll | Event of the scroll view.|
+| textSelectionUpdate | Event indicating that the selected text has been updated.|
+| accessibilityFocus | Event indicating that the accessibility focus has been obtained.|
+| accessibilityFocusClear | Event indicating that the accessibility focus has been cleared.|
## TextMoveUnit
Enumerates the movement units for traversing the node text.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- | Name | Description |
- | -------- | -------- |
- | char | The movement unit for traversing the node text is by character. |
- | word | The movement unit for traversing the node text is by word. |
- | line | The movement unit for traversing the node text is by line. |
- | page | The movement unit for traversing the node text is by page. |
- | paragraph | The movement unit for traversing the node text is by paragraph. |
+| Name| Description|
+| -------- | -------- |
+| char | The movement unit for traversing the node text is by character.|
+| word | The movement unit for traversing the node text is by word.|
+| line | The movement unit for traversing the node text is by line.|
+| page | The movement unit for traversing the node text is by page.|
+| paragraph | The movement unit for traversing the node text is by paragraph.|
## WindowUpdateType
Enumerates window update types.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-
- | Name | Description |
- | -------- | -------- |
- | add | Window adding. |
- | remove | Window deletion. |
- | title | Window title change. |
- | bounds | Window boundary change. |
- | layer | Window layer change. |
- | active | Window activity change. |
- | focus | Window focus change. |
- | accessibilityFocus | Window accessibility focus change. |
- | parent | Parent window change. |
- | children | Child window change. |
- | pip | Picture-in-picture (PIP) mode change. |
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
+
+| Name| Description|
+| -------- | -------- |
+| add | Window adding.|
+| remove | Window deletion.|
+| bounds | Window boundary change.|
+| active | Window activity change.|
+| focus | Window focus change.|
## accessibility.getAbilityLists
@@ -326,22 +335,22 @@ getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise<A
Obtains the accessibility application list. This API uses a promise to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type. |
- | stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
+ | stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
-- Return value
+- **Return value**
- | Type | Description |
- | -------- | -------- |
- | Promise<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Promise used to return the accessibility application list. |
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Promise used to return the accessibility application list.|
-- Example
+- **Example**
```typescript
accessibility.getAbilityLists("spoken", "enable")
@@ -369,17 +378,17 @@ getAbilityLists(abilityType: AbilityType, stateType: AbilityState,callback: Asyn
Obtains the accessibility application list. This API uses an asynchronous callback to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type. |
- | stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status. |
- | callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes | Callback used to return the accessibility application list. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
+ | stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
+ | callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes| Callback used to return the accessibility application list.|
-- Example
+- **Example**
```typescript
accessibility.getAbilityLists("visual", "enable", (err, data) => {
@@ -406,17 +415,17 @@ Obtains the accessibility application list. This API uses an asynchronous callba
getCaptionsManager(): CaptionsManager
-Obtains the accessibility caption configuration.
+Obtains the captions configuration.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
+**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
-- Return value
+- **Return value**
- | Type | Description |
- | -------- | -------- |
- | [CaptionsManager](#captionsmanager8) | Accessibility caption configuration. |
+ | Type| Description|
+ | -------- | -------- |
+ | [CaptionsManager](#captionsmanager8) | Captions configuration.|
-- Example
+- **Example**
```typescript
captionsManager = accessibility.getCaptionsManager()
@@ -430,12 +439,12 @@ Enables listening for the accessibility application or touch guide mode status c
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | type | string | Yes | Type of the event to listen for. - **accessibilityStateChange** means to listen for enable status changes of the accessibility application. **System capability**: SystemCapability.Barrierfree.Accessibility.Core - **touchGuideStateChange** means to listen for enable status changes of the touch guide mode. **System capability**: SystemCapability.Barrierfree.Accessibility.Vision |
- | callback | Callback<boolean> | Yes | Callback invoked when the enable status changes. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Type of the event to listen for. - **'accessibilityStateChange'** means to listen for enabled status changes of the accessibility application. **System capability**: SystemCapability.BarrierFree.Accessibility.Core - **'touchGuideStateChange'** means to listen for enabled status changes of the touch guide mode. **System capability**: SystemCapability.BarrierFree.Accessibility.Vision|
+ | callback | Callback<boolean> | Yes| Callback invoked when the enabled status of captions configuration changes.|
-- Example
+- **Example**
```typescript
accessibility.on('accessibilityStateChange',(data) => {
@@ -447,18 +456,16 @@ Enables listening for the accessibility application or touch guide mode status c
off(type: 'accessibilityStateChange ' | 'touchGuideStateChange', callback?: Callback<boolean>): void
-Disables listening for the accessibility application or touch guide mode status changes.
-
-
+Disables listening for the accessibility application or touch guide mode status changes.
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | type | string | No | Type of the event to listen for. - **accessibilityStateChange** means to listen for enable status changes of the accessibility application. **System capability**: SystemCapability.Barrierfree.Accessibility.Core - **touchGuideStateChange** means to listen for enable status changes of the touch guide mode. **System capability**: SystemCapability.Barrierfree.Accessibility.Vision |
- | callback | Callback<boolean> | No | Callback invoked when the enable status changes. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | No| Type of the event to listen for. - **'accessibilityStateChange'** means to listen for enabled status changes of the accessibility application. **System capability**: SystemCapability.BarrierFree.Accessibility.Core - **'touchGuideStateChange'** means to listen for enabled status changes of the touch guide mode. **System capability**: SystemCapability.BarrierFree.Accessibility.Vision|
+ | callback | Callback<boolean> | No| Callback invoked when the enabled status changes.|
-- Example
+- **Example**
```typescript
accessibility.off('accessibilityStateChange',(data) => {
@@ -472,15 +479,15 @@ isOpenAccessibility(): Promise<boolean>
Checks whether accessibility is enabled. This API uses a promise to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-- Return value
+- **Return value**
- | Type | Description |
- | -------- | -------- |
- | Promise<boolean> | Returns **true** if accessibility is enabled; returns **false** otherwise. |
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<boolean> | Returns **true** if accessibility is enabled; returns **false** otherwise.|
-- Example
+- **Example**
```typescript
accessibility.isOpenAccessibility()
@@ -497,15 +504,15 @@ isOpenAccessibility(callback: AsyncCallback<boolean>): void
Checks whether accessibility is enabled. This API uses an asynchronous callback to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-- Parameters
+- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Returns **true** if accessibility is enabled; returns **false** otherwise. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<boolean> | Yes| Callback used to return the result. Returns **true** if accessibility is enabled; returns **false** otherwise.|
-- Example
+- **Example**
```typescript
accessibility.isOpenAccessibility((err, data) => {
@@ -523,15 +530,15 @@ isOpenTouchGuide(): Promise<boolean>
Checks whether touch guide mode is enabled. This API uses a promise to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Vision
-- Return value
+- **Return value**
- | Type | Description |
- | -------- | -------- |
- | Promise<boolean> | Returns **true** if touch guide mode is enabled; returns **false** otherwise. |
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<boolean> | Returns **true** if touch guide mode is enabled; returns **false** otherwise.|
-- Example
+- **Example**
```typescript
accessibility.isOpenTouchGuide()
@@ -548,15 +555,15 @@ isOpenTouchGuide(callback: AsyncCallback<boolean>): void
Checks whether touch guide mode is enabled. This API uses an asynchronous callback to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Vision
-- Parameters
+- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Returns **true** if touch guide mode is enabled; returns **false** otherwise. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<boolean> | Yes| Callback used to return the result. Returns **true** if touch guide mode is enabled; returns **false** otherwise.|
-- Example
+- **Example**
```typescript
accessibility.isOpenTouchGuide((err, data) => {
@@ -574,21 +581,21 @@ sendEvent(event: EventInfo): Promise<void>
Sends an accessibility event. This API uses a promise to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | event | [EventInfo](#eventinfo) | Yes | Accessibility event. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
-- Return value
+- **Return value**
- | Type | Description |
- | -------- | -------- |
- | Promise<void> | Promise used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise. |
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<void> | Promise used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise.|
-- Example
+- **Example**
```typescript
accessibility.sendEvent(this.eventInfo)
@@ -605,16 +612,16 @@ sendEvent(event: EventInfo, callback: AsyncCallback<void>): void
Sends an accessibility event. This API uses an asynchronous callback to return the result.
-**System capability**: SystemCapability.Barrierfree.Accessibility.Core
+**System capability**: SystemCapability.BarrierFree.Accessibility.Core
- **Parameters**
- | Name | Type | Mandatory | Description |
- | -------- | -------- | -------- | -------- |
- | event | [EventInfo](#eventinfo) | Yes | Accessibility event. |
- | callback | AsyncCallback<void> | Yes | Callback used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
+ | callback | AsyncCallback<void> | Yes| Callback used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise.|
-- Example
+- **Example**
```typescript
accessibility.sendEvent(this.eventInfo,(err, data) => {
diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md
index 2a3dc0d9e34fd7ba2dd3e37c018292bec6da8be9..f216c6b08806daa6c5bc87471a3effd749130094 100644
--- a/en/application-dev/reference/apis/js-apis-appAccount.md
+++ b/en/application-dev/reference/apis/js-apis-appAccount.md
@@ -1956,6 +1956,7 @@ Defines OAuth token information.
| -------- | ------ | ---- | -------- |
| authType | string | Yes | Authentication type.|
| token | string | Yes | Value of the token. |
+| account9+ | AppAccountInfo | No | Account information of the token. |
## AuthenticatorInfo8+
diff --git a/en/application-dev/reference/apis/js-apis-application-DataShareExtensionAbility.md b/en/application-dev/reference/apis/js-apis-application-DataShareExtensionAbility.md
index c3dd60f0e942f6666ea4023bca50c0cef7e75fa5..3289f1d2efc43a5af0a8fa3266f41b1ff3139aaa 100644
--- a/en/application-dev/reference/apis/js-apis-application-DataShareExtensionAbility.md
+++ b/en/application-dev/reference/apis/js-apis-application-DataShareExtensionAbility.md
@@ -1,6 +1,6 @@
# Data Share Extension Ability
-**DataShareExtensionAbility** provides extension abilities for data share services based on the ExtensionAbility framework.
+The **DataShareExtensionAbility** module provides Extension abilities for data share services.
>**NOTE**
>
@@ -17,11 +17,19 @@
import DataShareExtensionAbility from '@ohos.application.DataShareExtensionAbility'
```
+## Attributes
+
+**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| context | [ExtensionContext](js-apis-extension-context.md) | Yes| No|Context of the DataShare Extension ability.|
+
## onCreate
onCreate?(want: Want, callback: AsyncCallback<void>): void
-Called to initialize service logic of the server when the DataShare client connects to the DataShareExtensionAbility server. This API can be overridden as required.
+Called by the server to initialize service logic when the DataShare client connects to the DataShareExtensionAbility server. This API can be overridden as required.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
@@ -45,7 +53,7 @@ let DDL_TBL_CREATE = "CREATE TABLE IF NOT EXISTS "
let rdbStore;
export default class DataShareExtAbility extends DataShareExtensionAbility {
- onCreate(want: Want, callback: AsyncCallback) {
+ onCreate(want, callback) {
rdb.getRdbStore(this.context, {
name: DB_NAME
}, 1, function (err, data) {
@@ -66,7 +74,7 @@ export default class DataShareExtAbility extends DataShareExtensionAbility {
getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback<Array<string>>): void
-Called by the server to obtain the Multipurpose Internet Mail Extensions (MIME) types supported by a file. This API can be overridden as required.
+Obtains the Multipurpose Internet Mail Extensions (MIME) types supported by a file. This API is called by the server and can be overridden as required.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
@@ -82,7 +90,7 @@ Called by the server to obtain the Multipurpose Internet Mail Extensions (MIME)
```ts
export default class DataShareExtAbility extends DataShareExtensionAbility {
- getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>) {
+ getFileTypes(uri, mimeTypeFilter, callback) {
let err = {"code":0};
let ret = new Array("type01", "type02", "type03");
callback(err, ret);
@@ -94,7 +102,7 @@ export default class DataShareExtAbility extends DataShareExtensionAbility {
openFile?(uri: string, mode: string, callback: AsyncCallback<number>): void
-Called by the server to open a file. This method can be overridden as required.
+Opens a file. This API is called by the server and can be overridden as required.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
@@ -103,14 +111,14 @@ Called by the server to open a file. This method can be overridden as required.
| Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | ------------------------------------------ |
| uri | string | Yes | URI of the file to open. |
-| mode | string | Yes | File open mode, including read-only mode and read/write mode.|
+| mode | string | Yes | File open mode, which can be read-only or read/write.|
| callback | AsyncCallback<number> | Yes | Callback invoked to return the file descriptor. |
**Example**
```ts
export default class DataShareExtAbility extends DataShareExtensionAbility {
- openFile(uri: string, mode: string, callback: AsyncCallback) {
+ openFile(uri, mode, callback) {
let err = {"code":0};
let fd = 0;
callback(err,fd);
@@ -122,7 +130,7 @@ export default class DataShareExtAbility extends DataShareExtensionAbility {
insert?(uri: string, valueBucket: ValuesBucket, callback: AsyncCallback<number>): void
-Called to insert data into the database. This API can be overridden as required.
+Inserts data into the database. This API can be overridden as required.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
@@ -137,13 +145,22 @@ Called to insert data into the database. This API can be overridden as required.
**Example**
```ts
+import rdb from '@ohos.data.rdb';
+
+let DB_NAME = "DB00.db";
+let TBL_NAME = "TBL00";
+let DDL_TBL_CREATE = "CREATE TABLE IF NOT EXISTS "
++ TBL_NAME
++ " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)";
+let rdbStore;
+
export default class DataShareExtAbility extends DataShareExtensionAbility {
- insert(uri: string, valueBucket: ValuesBucket, callback: AsyncCallback) {
- if (value == null) {
+ insert(uri, valueBucket, callback) {
+ if (valueBucket == null) {
console.info('invalid valueBuckets');
return;
}
- rdbStore.insert(TBL_NAME, value, function (err, ret) {
+ rdbStore.insert(TBL_NAME, valueBucket, function (err, ret) {
console.info('callback ret:' + ret);
if (callback != undefined) {
callback(err, ret);
@@ -157,7 +174,7 @@ export default class DataShareExtAbility extends DataShareExtensionAbility {
update?(uri: string, predicates: dataSharePredicates.DataSharePredicates, valueBucket: ValuesBucket, callback: AsyncCallback<number>): void
-Called by the server to update data in the database. This API can be overridden as required.
+Updates data in the database. This API can be overridden as required.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
@@ -166,19 +183,28 @@ Called by the server to update data in the database. This API can be overridden
| Name| Type| Mandatory| Description|
| ----- | ------ | ------ | ------ |
| uri | string | Yes | URI of the data to update.|
-| predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes | Filter criteria for updating data.|
+| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | Yes | Filter criteria for updating data.|
| valueBucket | [ValuesBucket](js-apis-data-ValuesBucket.md#valuesbucket) | Yes| New data.|
| callback | AsyncCallback<number> | Yes| Callback invoked to return the number of updated data records.|
**Example**
```ts
+import rdb from '@ohos.data.rdb';
+
+let DB_NAME = "DB00.db";
+let TBL_NAME = "TBL00";
+let DDL_TBL_CREATE = "CREATE TABLE IF NOT EXISTS "
++ TBL_NAME
++ " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)";
+let rdbStore;
+
export default class DataShareExtAbility extends DataShareExtensionAbility {
- update(uri: string, predicates: dataSharePredicates.DataSharePredicates, valueBucket: ValuesBucket, callback: AsyncCallback) {
+ update(uri, predicates, valueBucket, callback) {
if (predicates == null || predicates == undefined) {
return;
}
- rdbStore.update(TBL_NAME, value, predicates, function (err, ret) {
+ rdbStore.update(TBL_NAME, valueBucket, predicates, function (err, ret) {
if (callback != undefined) {
callback(err, ret);
}
@@ -191,7 +217,7 @@ export default class DataShareExtAbility extends DataShareExtensionAbility {
delete?(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback<number>): void
-Called by the server to delete data from the database. This API can be overridden as required.
+Deletes data from the database. This API can be overridden as required.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
@@ -200,14 +226,23 @@ Called by the server to delete data from the database. This API can be overridde
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------------------------------ | ---- | ---------------------------------- |
| uri | string | Yes | URI of the data to delete. |
-| predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes | Filter criteria for deleting data. |
+| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | Yes | Filter criteria for deleting data. |
| callback | AsyncCallback<number> | Yes | Callback invoked to return the number of data records deleted.|
**Example**
```ts
+import rdb from '@ohos.data.rdb';
+
+let DB_NAME = "DB00.db";
+let TBL_NAME = "TBL00";
+let DDL_TBL_CREATE = "CREATE TABLE IF NOT EXISTS "
++ TBL_NAME
++ " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)";
+let rdbStore;
+
export default class DataShareExtAbility extends DataShareExtensionAbility {
- delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback) {
+ delete(uri, predicates, callback) {
if (predicates == null || predicates == undefined) {
return;
}
@@ -224,7 +259,7 @@ export default class DataShareExtAbility extends DataShareExtensionAbility {
query?(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array<string>, callback: AsyncCallback<Object>): void
-Called by the server to query data from the database. This API can be overridden as required.
+Queries data from the database. This API can be overridden as required.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Provider
@@ -233,15 +268,24 @@ Called by the server to query data from the database. This API can be overridden
| Name| Type| Mandatory| Description|
| ----- | ------ | ------ | ------ |
| uri | string | Yes | URI of the data to query.|
-| predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes | Filter criteria for querying data.|
+| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | Yes | Filter criteria for querying data.|
| columns | Array<string> | Yes| Columns to query. If this parameter is empty, all columns will be queried.|
| callback | AsyncCallback<Object> | Yes| Callback invoked to return the result set.|
**Example**
```ts
+import rdb from '@ohos.data.rdb';
+
+let DB_NAME = "DB00.db";
+let TBL_NAME = "TBL00";
+let DDL_TBL_CREATE = "CREATE TABLE IF NOT EXISTS "
++ TBL_NAME
++ " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)";
+let rdbStore;
+
export default class DataShareExtAbility extends DataShareExtensionAbility {
- query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback