diff --git a/en/application-dev/faqs/Readme-EN.md b/en/application-dev/faqs/Readme-EN.md
index 740e2bbdaf4a1aadc015c9e683da5f02940ab61a..c8989927e1f804c14effdfe071082ed15410ea80 100644
--- a/en/application-dev/faqs/Readme-EN.md
+++ b/en/application-dev/faqs/Readme-EN.md
@@ -1,21 +1,19 @@
# FAQs
-- [Programming Languages](faqs-language.md)
-- [Ability Framework Development](faqs-ability.md)
+- [Ability Development](faqs-ability.md)
+- [Bundle Management Development](faqs-bundle-management.md)
- [Resource Manager Development](faqs-globalization.md)
-- [ArkUI (ArkTS) Development](faqs-ui-ets.md)
-- [ArkUI Web Component (ArkTS) Development](faqs-web-arkts.md)
-- [ArkUI (JavaScript) Development](faqs-ui-js.md)
- [Common Event and Notification Development](faqs-event-notification.md)
-- [Graphics and Image Development](faqs-graphics.md)
-- [Media Development](faqs-media.md)
+- [Graphics Development](faqs-graphics.md)
+- [Window Management Development](faqs-window-manager.md)
+- [Multimedia Development](faqs-multimedia.md)
- [Basic Security Capability Development](faqs-security.md)
-- [Application Access Control Development](faqs-ability-access-control.md)
+- [Ability Access Control Development](faqs-ability-access-control.md)
- [Data Management Development](faqs-distributed-data-management.md)
- [File Management Development](faqs-file-management.md)
- [Network Management Development](faqs-network-management.md)
- [DFX Development](faqs-dfx.md)
-- [Native API Usage](faqs-native.md)
+- [Pan-Sensor Development](faqs-sensor.md)
- [Startup Development](faqs-startup.md)
-- [Usage of Third- and Fourth-Party Libraries](faqs-third-party-library.md)
-- [IDE Usage](faqs-ide.md)
+- [Distributed Device Development](faqs-distributed-device-profile.md)
+- [Usage of Third- and Fourth-Party Libraries](faqs-third-fourth-party-library.md)
\ No newline at end of file
diff --git a/en/application-dev/faqs/faqs-ability-access-control.md b/en/application-dev/faqs/faqs-ability-access-control.md
index f336120a2b131eb75604fa3e51b1b8ff0130072e..51b3310de190a521b47471d607134c014a79be8c 100644
--- a/en/application-dev/faqs/faqs-ability-access-control.md
+++ b/en/application-dev/faqs/faqs-ability-access-control.md
@@ -1,4 +1,4 @@
-# Application Access Control Development
+# Ability Access Control Development
## Can the app listen for the permission change after its permission is modified in Settings?
diff --git a/en/application-dev/faqs/faqs-ability.md b/en/application-dev/faqs/faqs-ability.md
index aab3ecc19aff704dbc34b9f7aa4d174344735453..b6901e40e6d84c622c41e487e30c62ba87a28ff4 100644
--- a/en/application-dev/faqs/faqs-ability.md
+++ b/en/application-dev/faqs/faqs-ability.md
@@ -1,68 +1,124 @@
-# Ability Framework Development
+# Ability Development
-## Is a guide similar to the Data ability development in the FA model available for the stage model?
+## How do I obtain a notification when the device orientation changes?
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-A guide is available for the **DataShareExtensionAbility** class, which provides APIs for sharing data with other applications and managing the data, in the stage model.
+**Solution**
-Reference: [DataShare Development](../database/database-datashare-guidelines.md)
+Use the **UIAbility.onConfigurationUpdate\(\)** callback to subscribe to system environment variable changes (including the language, color mode, and screen orientation).
-## What should I do if the UI does not respond when an ability is started?
+**Reference**
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+[Subscribing to System Environment Variable Changes](../application-models/subscribe-system-environment-variable-changes.md#using-uiability-for-subscription)
-1. If the ability is started using **startAbility**, check whether the **abilityName** field in **want** uses the bundle name as the prefix. If yes, delete the bundle name.
+## How do I redirect a user to a specified page after they touch a service widget?
-2. Make sure the ability's home page file configured by **onWindowStageCreate** in the **MainAbility.ts** file is defined in the **main_pages.json** file.
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-3. You are advised to use the SDK and OpenHarmony SDK versions released on the same day.
+**Solution**
-Reference: [Release Testing Version](https://gitee.com/openharmony-sig/oh-inner-release-management/blob/master/Release-Testing-Version.md)
+Configure a widget event with the redirected-to UIAbility specified, and call **loadContent** in the **onWindowStageCreate\(\)** callback of the target UIAbility to redirect to the specified page.
-## How do I set the UI of an ability to transparent?
+**Reference**
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
+[Developing Widget Events](../application-models/arkts-ui-widget-configuration.md)
-Set the background color of the top container component to transparent, and then set the **opacity** attribute of the XComponent to **0.01**.
+## How do I create a background service in the stage model?
-Example:
+Applicable to: OpenHarmony 3.2 Beta5
-```
-build() {
- Stack() {
- XComponent({
- id: 'componentId',
- type: 'surface',
- })
- .width('100%')
- .height('100%')
- .opacity(0.01)
- // Page content
- }
- .width('100%')
- .height('100%')
- .backgroundColor('rgba(255,255,255, 0)')
-}
-```
+**Symptom**
+
+**ServiceExtensionAbility** in the stage model is a system API. Therefore, third-party applications cannot use it to create a background service.
+
+**Solution**
+
+Create a background task to provide the background service.
+
+**Reference**
+
+[Background Task](../task-management/background-task-overview.md)
+
+## Can I create a UIAbility and specify the process to run the UIAbility in the FA and Stage models?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Yes.
+
+- FA model
+
+ The FA model supports multiple processes. By default, all components of an application run in the same process. This default scenario is suitable for most applications. To run a specific component in an independent process, configure the **process** tag under **ability** in the configuration file. Note that this tag is available only for system applications.
+
+- Stage model
+
+ The stage model supports multiple processes. The process model is defined by the system, and third-party applications cannot be configured with multiple processes. To customize an independent process, you must request special permissions, and then specify the **process** tag under **module** in the configuration file. This tag specifies the process in which all the abilities in an HAP run. If this tag is not set, the bundle name is used as the process name by default.
+
+
+## What are the differences between the stage model and the FA model in intra-process object sharing?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+- In the stage model, multiple application components share the same ArkTS engine instance. Therefore, they can easily share objects and state with each other. This also reduces the memory usage of complex applications.
+- In the FA model, each application component exclusively uses an ArkTS engine instance. Therefore, you are advised to use the stage model when developing complex applications in distributed scenarios.
+
+**Reference**
+
+[Data Synchronization Between UIAbility and UI](../application-models/uiability-data-sync-with-ui.md)
+
+## How do I use the lifecycle functions of AbilityStage?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Add the field **"srcEntry": "./ets/myabilitystage/MyAbilityStage.ts"** under **module** in the **module.json5** file.
+
+**Reference**
+
+[AbilityStage Component Container](../application-models/abilitystage.md)
+
+
+## How do I delete the mission snapshot in Recents after terminateself is called in the multiton scenario?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+You can set **removeMissionAfterTerminate** to **true** in the **module.json5** file.
+
+## Why can't I start a UIAbility instance by using startAbility\(\)?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+- If the UIAbility is started using **startAbility**, check whether the **abilityName** field in **want** uses the bundle name as the prefix. If yes, delete the bundle name.
+- Make sure the UIAbility's home page file configured by **onWindowStageCreate** in the **MainAbility.ts** file is defined in the **main\_pages.json** file. You are advised to use the SDK and OpenHarmony SDK versions released on the same day.
## How do I prevent "this" in a method from changing to "undefined" when the method is called?
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
-Method 1: Add **.bind(this)** when calling the method.
+Method 1: Add **.bind\(this\)** when calling the method.
Method 2: Use the arrow function.
-## What should I do when the message "must have required property 'startWindowIcon'" is displayed?
+## What should I do when the error message "must have required property 'startWindowIcon'" is displayed during the UIAbility startup?
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-Configure the **startWindowIcon** attribute under **abilities** in the **module.json5** file.
+**Solution**
-Reference: [Application Package Structure (Stage Model)](../quick-start/module-configuration-file.md)
+Configure the **startWindowIcon** attribute under **abilities** in the **module.json5** file.
-Example:
+**Example**
```
{
@@ -77,138 +133,226 @@ Example:
}
```
-## How do I obtain a notification when the device orientation changes?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
+**Reference**
-Implement the **onConfigurationUpdated** callback in the **Ability** class. The callback is triggered when the system language, color mode, or display parameters (such as the orientation and density) change.
+[module.json5 Configuration File](../quick-start/module-configuration-file.md)
## Can I obtain the context through globalThis in the stage model?
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+Do not use **globalThis** to obtain the context in the stage model.
+
+This is because all the processes of an application share a JS VM instance in the stage model. Multiple abilities can run on these processes and share the same global object. If **globalThis** is used, the context of different abilities of the same JS VM instance may be returned.
+
+**Reference**
+
+[Data Synchronization Between UIAbility and UI](../application-models/uiability-data-sync-with-ui.md)
-Do not use **globalThis** to obtain the context in the stage model. This is because all the processes of an application share a JS VM instance in the stage model. Multiple abilities can run on these processes and share the same global object. If **globalThis** is used, the context of different abilities of the same JS VM instance may be returned.
+## What should I do when an error indicating too large size is reported during HAP deployment?
-Reference of the recommended operation: [Context (Stage Model)](../application-models/application-context-stage.md)
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-## How do I obtain the HAP installation path of application B from application A?
+**Symptom**
-Applicable to: OpenHarmony SDK 3.0 or later, stage model of API version 9
+During HAP deployment, the following error message is displayed:
-First, request the system permission. For details, see [Having Your App Automatically Signed](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-auto-configuring-signature-information-0000001271659465). Then, import the **bundle** module, and call **bundle.getApplicationInfo()** to obtain application information based on the bundle name. Finally, use **application.moduleSourceDirs** to obtain the application storage path.
+Failure\[INSTALL\_FAILED\_SIZE\_TOO\_LARGE\] error while deploying hap?
+
+**Solution**
+
+You can split the HAP into multiple HAPs.
## How is data returned when startAbilityForResult is called?
-Applicable to: OpenHarmony SDK3.0, stage model of API version 9
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-The callee uses **AbilityContext.terminateSelfWithResult** to destroy its ability and pass parameters to **startAbilityForResult**. For details, see [AbilityContext](../reference/apis/js-apis-ability-context.md#abilitycontextterminateselfwithresult).
+**Solution**
-## Can the lifecycle callback of a released FA widget be triggered when the widget is displayed in the service center so that the user login information can be obtained without opening the FA application?
+The target UIAbilities uses **AbilityContext.terminateSelfWithResult** to terminate itselef and pass the result to **startAbilityForResult**.
-Applicable to: OpenHarmony SDK 3.2.5.5, FA model of API version 8
+**Reference**
-After a widget is added, the **oncreate()** lifecycle is triggered so that related user information (silent login) can be displayed even when the application is not started. However, users must manually add the widget after the application is installed.
+[Starting UIAbility in the Same Application and Obtaining the Return Result](../application-models/uiability-intra-device-interaction.md)
-## How do I obtain the context?
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
+## How do I obtain the system timestamp?
-You can use **this.context** to obtain the context in the **MainAbility.ts** file or call **getContext(this)** to obtain the context on the component page.
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-## What should I do when undefined is displayed for the calling of **abilityAccessCtrl.grantUserGrantedPermission** during API version 8 syntax verification?
+**Solution**
-Applicable to: OpenHarmony SDK 3.0, FA model of API version 8
+Use **getCurrentTime** of **@ohos.systemDateTime** to obtain the system time and time zone.
-**abilityAccessCtrl.grantUserGrantedPermission** is a system API. It is not available in the public SDK, which is provided as default on DevEco Studio. To use system APIs, switch to the full SDK. For details, see [Guide to Switching to Full SDK](../quick-start/full-sdk-switch-guide.md).
+**Example**
-## Which of the following Extension abilities are available in the public SDK: ServiceExtensionAbility, FormExtensionAbility, and DataShareExtensionAbility?
+Use the **@ohos.systemDateTime** API as follows:
-Applicable to: OpenHarmony SDK 3.2.5.6, stage model of API version 9
+ ```
+ try {
+ systemDateTime.getCurrentTime(true, (error, time) => {
+ if (error) {
+ console.info(`Failed to get currentTime. message: ${error.message}, code: ${error.code}`);
+ return;
+ }
+ console.info(`Succeeded in getting currentTime : ${time}`);
+ });
+ } catch(e) {
+ console.info(`Failed to get currentTime. message: ${e.message}, code: ${e.code}`);
+ }
+ ```
-Among the aforementioned Extension abilities, only **FormExtensionAbility** is available in the public SDK. **ServiceExtensionAbility** and **DataShareExtensionAbility** are system APIs and available only in the full SDK.
-Public SDK: intended for application developers and does not contain system APIs that require system permissions.
+**Reference**
-Full SDK: intended for original equipment manufacturers (OEMs) and contains system APIs that require system permissions.
+[System time and time zone] (../reference/apis/js-apis-system-date-time.md#systemdatetimegetcurrenttime)
-## Why can't I play GIF images cyclically on the widget?
+## How do I obtain the cache directory of the current application?
-Applicable to: OpenHarmony SDK 3.2.5.6, stage model of API version 9
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-The system does not support the display of GIF images on the widget.
+**Solution**
-## How do I implement service login by touching a widget?
+Use **Context.cacheDir** to obtain the cache directory of the application.
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
+**Reference**
-You can start an ability upon the touch and implement service login in the ability.
+[Obtaining the Application Development Path](../application-models/application-context-stage.md#obtaining-the-application-development-path)
-## How do I redirect to the application details page in Settings?
+## In which JS file is the service widget lifecycle callback invoked?
-Applicable to: OpenHarmony SDK 3.2.6.5
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-Refer to the following code:
+**Solution**
-```
-this.context.startAbility(
-{
- action: "action.settings.app.info",
- parameters: { "settingsParamBundleName": "your app bundlename" }
-})
-```
+When a widget is created, a **FormAblity.ts** file is generated, which contains the widget lifecycle.
-## How do I listen for screen rotation events?
+**Reference**
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
+[FormExtensionAbility](../reference/apis/js-apis-app-form-formExtensionAbility.md)
-Refer to the following code:
+## What should I do when the compilation on DevEco Studio fails while ServiceExtensionAbility and DataShareExtensionAbility APIs are used?
-```
-let listener = mediaquery.matchMediaSync('(orientation: landscape)')
-onPortrait(mediaQueryResult) {
-if (mediaQueryResult.matches) {
-// Do something here.
- } else {
-// Do something here.
- }
-}
-listener.on('change', onPortrait)
-```
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Symptom**
+
+After the **ServiceExtensionAbility** and **DataShareExtensionAbility** APIs are used, DevEco Studio reports an error indicating that the compilation fails.
+
+**Cause**
+
+The following types of SDKs are provided:
+
+- Public SDK: intended for application developers and does not contain system APIs that require system permissions.
+- Full SDK: intended for original equipment manufacturers (OEMs) and contains system APIs that require system permissions.
+
+The SDK downloaded using DevEco Studio is the public SDK.
+
+**Solution**
+
+Third-party application cannot use **ServiceExtensionAbility** and **DataShareExtensionAbility**. To develop a system application, first [download the full SDK](../quick-start/full-sdk-switch-guide.md).
+
+## How do I obtain the temp and files paths at the application level?
+
+Applicable to: OpenHarmony 3.2 Beta5
+
+**Solution**
+
+Obtain them from the application context. Specifically, use **this.context.getApplicationContext.tempDir** i to obtain the **temp** path, and use **this.context.getApplicationContext.filesDir** to obtain the **files** path.
+
+**Reference**
+
+[Obtaining the Application Development Path](../application-models/application-context-stage.md#obtaining-the-application-development-path)
+
+
+## Can the lifecycle callback of a released FA widget be triggered when the widget is displayed in the service center so that the user login information can be obtained without opening the FA application?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
-## How do I control the shadow background size during checkbox selection?
+**Solution**
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
+After a widget is added, the **onCreate()** lifecycle is triggered so that related user information (silent login) can be displayed even when the application is not started. However, users must manually add the widget after the application is installed.
-Set the **padding** attribute of the **\** component to control the shadow size.
+## How do I implement service login by touching a widget?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+To create a service widget in the FA model, perform the following steps:
+
+1. Implement lifecycle callbacks for the widget.
+
+2. Configure the widget configuration file.
+
+3. Persistently store widget data.
-## How do I set the widget background to transparent?
+4. Update widget data.
-Applicable to: OpenHarmony SDK 3.2.5.5
+5. Develop the widget UI page.
-1. Create the **widget/resources/styles/default.json** file in the root directory of the widget.
+6. Develop a widget event. You can start a UIAbility upon the touch and implement service login in the UIAbility.
-2. Add the following code to the **default.json** file:
+**Reference**
+
+[Widget Development in the FA Model](../application-models/widget-development-fa.md)
+
+## How do I redirect to the application details page in Settings?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Refer to the following code:
```
-{
- "style": {
- "app_background": "#00000000"
- }
-}
+this.context.startAbility(
+{
+ action: "action.settings.app.info",
+ parameters: { "settingsParamBundleName": "your app bundlename" }
+})
```
-## How do I pass parameters for FA widgets?
-
-Applicable to: OpenHarmony SDK 3.2.5.5
+## How do I get UIAbilityContext within the @Component component in the stage model?
-Use **featureAbility.getWant()** and **featureAbility.getContext()** to send data through **router** in the JSON file and use **featureAbility** to receive data in the JS file.
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
-## How do I trigger router.disableAlertBeforeBackPage and router.enableAlertBeforeBackPage?
+**Solution**
-Applicable to: OpenHarmony SDK 3.2.5.5
+You can use **UIAbility.Context** to obtain the context.
-The following conditions must be met:
+**Example**
-1. Before the redirection to the previous page, a confirm dialog box will be displayed. Note that **router.disableAlertBeforeBackPage** is used to disable the display of a confirm dialog box before returning to the previous page (default), and **router.enableAlertBeforeBackPage** is used to enable the display.
+```
+import UIAbility from '@ohos.app.ability.UIAbility';
+
+let UIAbilityContext = UIAbility.context;
+let ApplicationContext = UIAbility.context.getApplicationContext();
+@Entry
+@Component
+struct AbilityContextTest {
+ // abilityContext
+ @State UIabilityInfo: string = 'Obtaining abilityInfo'
+ UIabilityContext: UIAbilityContext
+
+ aboutToAppear() {
+ // Use getContext to obtain the context and convert it to abilityContext.
+ this.UIabilityContext = getContext(this) as UIAbilityContext
+ }
-2. The system return key is used.
+ build() {
+ Row() {
+ Column({ space: 20 }) {
+ Text(this.abilityInfo)
+ .fontSize(20)
+ .onClick(()=>{
+ this.UIabilityInfo = JSON.stringify(this.UIabilityContext.UIabilityInfo)
+ console.log(`ContextDemo abilityInfo= ${this.UIabilityInfo}`)
+ })
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+```
diff --git a/en/application-dev/faqs/faqs-bundle-management.md b/en/application-dev/faqs/faqs-bundle-management.md
new file mode 100644
index 0000000000000000000000000000000000000000..71b1e01ffcffea415266fb90213fc722e4f5b628
--- /dev/null
+++ b/en/application-dev/faqs/faqs-bundle-management.md
@@ -0,0 +1,126 @@
+# Bundle Management Development
+
+## How do I determine whether an application is a system application?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Use **bundleManager.getApplicationInfo** (available only for system applications) to obtain application information, and check the value of **systemApp** in the information. The application is a system application if the value is **true**.
+
+**Reference**
+
+[bundleManager](../reference/apis/js-apis-bundleManager.md)
+
+## How do I obtain the version code and version name of an application?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Use **bundleManager.getBundleInfoForSelf\(\)** to obtain the bundle information, which contains the version code (specified by **BundleInfo.versionCode**) and version name (specified by **BundleInfo.versionName**) .
+
+**Example**
+
+```
+import bundleManager from '@ohos.bundle.bundleManager';
+import hilog from '@ohos.hilog';
+let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
+try {
+ bundleManager.getBundleInfoForSelf(bundleFlags).then((data) => {
+ const versionCode = data.versionCode;
+ const versionName = data.versionName;
+ hilog.info(0x0000, 'testTag', `successfully. versionCode: ${versionCode}, versionName: ${versionName}`);
+ }).catch(err => {
+ hilog.error(0x0000, 'testTag', 'failed. Cause: %{public}s', err.message);
+ });
+} catch (err) {
+ hilog.error(0x0000, 'testTag', 'failed: %{public}s', err.message);
+}
+```
+
+**Reference**
+
+[getBundleInfoForSelf](../reference/apis/js-apis-bundleManager.md#bundlemanagergetbundleinfoforself)
+
+## How do I obtain the bundle name of the current application?
+
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
+
+**Solution**
+
+Obtain the bundle name from **UIAbilityContext.abilityInfo.bundleName**.
+
+**Example**
+
+```
+import common from '@ohos.app.ability.common';
+const context = getContext(this) as common.UIAbilityContext
+console.log(`bundleName: ${context.abilityInfo.bundleName}`)
+```
+
+**Reference**
+
+[UIAbilityContext](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontext) and [AbilityInfo](../reference/apis/js-apis-bundleManager-abilityInfo.md#abilityinfo)
+
+## How do I obtain the application version number, version name, and screen resolution?
+
+Applicable to: OpenHarmony 3.2 Beta5
+
+**Solution**
+
+1. Obtain the bundle information from the **@ohos.bundle.bundleManager** module.
+
+ The bundle information contains the application version number and version name.
+
+ ```
+ import bundleManager from '@ohos.bundle.bundleManager';
+ ...
+ bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then((bundleInfo)=>{
+ let versionName = bundleInfo.versionName; // Application version name.
+ let versionNo = bundleInfo.versionCode; // Application version number.
+ }).catch((error)=>{
+ console.error("get bundleInfo failed,error is "+error)
+ })
+ ```
+
+2. Obtain **screenDensity** from the **@ohos.app.ability.Configuration** module. **screenDensity** contains the screen resolution information.
+
+ ```
+ import common from '@ohos.app.ability.common';
+ ...
+ let context = getContext(this) as common.UIAbilityContext;
+ let screenDensity = context.config.screenDensity;
+ ```
+
+
+## How do I obtain the source file path of the current application?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+- Method 1: Use the application context to obtain the source file path.
+
+ ```
+ this.uiAbilityContext.abilityInfo.applicationInfo.codePath
+ ```
+
+- Method 2: Use **@ohos.bundle.bundleManager** to obtain the source file path.
+
+ 1. Import the **@ohos.bundle.bundleManager** module and use **bundleManager.getBundleInfoForSelf\(\)** to obtain the bundle information.
+ 2. Obtain the source file path from **bundleInfo.appInfo.codePath**.
+
+ ```
+ import bundleManager from '@ohos.bundle.bundleManager';
+ bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then((bundleInfo)=>{
+ this.sourcePath = bundleInfo.appInfo.codePath;
+ })
+ ```
+
+
+## Can I obtain the HAP information of other applications from the current application?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+According to the OpenHarmony security design specifications, the SDK does not provide APIs for third-party applications to obtain bundle information (including but not limited to the application name and version number) of other applications.
diff --git a/en/application-dev/faqs/faqs-bundle.md b/en/application-dev/faqs/faqs-bundle.md
deleted file mode 100644
index fda41c42bccc357d6b8800ce3f5401e1e2abbceb..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-bundle.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Bundle Management Development
-
-## How do I obtain the version code and version name of an application?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-Use **bundle.getBundleInfo()** to obtain the bundle information, which contains the version code and version name.
-
-Reference: [Bundle](../reference/apis/js-apis-Bundle.md#bundlegetbundleinfo)
-
-## How do I obtain the bundle name of an application?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-Obtain the bundle name through **context.abilityInfo.bundleName**.
-
-Reference: [AbilityInfo](../reference/apis/js-apis-bundle-AbilityInfo.md)
-
-## How do I obtain an application icon?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-Use **bundle.getAbilityIcon** to obtain the application icon. To use this API, you must configure the permission **ohos.permission.GET_BUNDLE_INFO**.
-
-Reference: [Bundle](../reference/apis/js-apis-Bundle.md#bundlegetbundleinfo)
-
-## How do I determine whether an application is a system application?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-Use **bundle.getApplicationInfo** to obtain the application information, and then check the value of **systemApp** in the information. The application is a system application if the value is **true**.
diff --git a/en/application-dev/faqs/faqs-distributed-device-profile.md b/en/application-dev/faqs/faqs-distributed-device-profile.md
new file mode 100644
index 0000000000000000000000000000000000000000..8473e3d4bfcb36c02d3260312cf5379cb436d8a6
--- /dev/null
+++ b/en/application-dev/faqs/faqs-distributed-device-profile.md
@@ -0,0 +1,9 @@
+# Distributed Device Development
+
+## How do I view the IMEI of an OpenHarmony device?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Obtain the device IMEI from the **HUKS\_TAG\_ATTESTATION\_ID\_IMEI** parameter of the **HuksTag** API. [Reference](../reference/apis/js-apis-huks.md)
diff --git a/en/application-dev/faqs/faqs-graphics.md b/en/application-dev/faqs/faqs-graphics.md
index 7eeba0644721dbf77174680f3c6c6d0ac0db05cf..9469a35736ef859342d2c24bdcb9780e94445bf8 100644
--- a/en/application-dev/faqs/faqs-graphics.md
+++ b/en/application-dev/faqs/faqs-graphics.md
@@ -1,90 +1,92 @@
-# Graphics and Image Development
+# Graphics Development
-## Why do the isStatusBarLightIcon and isNavigationBarLightIcon attributes not take effect when window.setSystemBarProperties() is called?
+## How do I obtain the DPI of a device?
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9, stage model)
-In effect, the **isStatusBarLightIcon** and **isNavigationBarLightIcon** attributes turn the font white when set to **true**. If **statusBarContentColor** is also set in **window.setSystemBarProperties()**, the **isStatusBarLightIcon** attribute does not take effect. Similarly, if **navigationBarContentColor** is set, the **isNavigationBarLightIcon** attribute does not take effect.
+**Solution**
-## How do I set the style of the system bar?
+Import the **@ohos.display** module and call the **getDefaultDisplaySync\(\)** API.
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
+**Example**
-Import the **\@ohos.window** module, and call **window.setSystemBarProperties()**.
+```
+import display from '@ohos.display';
+let displayClass = null;
+try {
+ displayClass = display.getDefaultDisplaySync();
+ console.info('Test densityDPI:' + JSON.stringify(displayClass.densityDPI));
+} catch (exception) {
+ console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
+}
+```
## How do I hide the status bar to get the immersive effect?
-Applicable to: OpenHarmony SDK 3.2.6.3, stage model of API version 9
-
-1. Use the **onWindowStageCreate** to obtain a **windowClass** object.
-
- ```ts
- onWindowStageCreate(windowStage) {
- // When the main window is created, set the main page for this ability.
- console.log("[Demo] EntryAbility onWindowStageCreate")
- windowStage.getMainWindow((err, data) => {
- if (err.code) {
- console.error('Failed to obtain the main window.')
- return;
- }
- // Obtain a windowClass object.
- globalThis.windowClass = data;
- })
- }
- ```
-
-2. Enable the full-screen mode for the window and hide the status bar.
-
- ```ts
- globalThis.windowClass.setFullScreen(isFullScreen, (err, data) => {
- if (err.code) {
- console.error('Failed to enable the full-screen mode. Cause:' + JSON.stringify(err));
- return;
- }
- console.info('Succeeded in enabling the full-screen mode. Data: ' + JSON.stringify(data));
- });
- ```
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9, stage model)
+
+**Solution**
+
+1. Use **onWindowStageCreate** to obtain a **windowClass** object.
+
+ ```
+ onWindowStageCreate(windowStage) {
+ // When the main window is created, set the main page for this ability.
+ console.log("[Demo] MainAbility onWindowStageCreate")
+ windowStage.getMainWindow((err, data) => {
+ if (err.code) {
+ console.error('Failed to obtain the main window.')
+ return;
+ }
+ // Obtain a windowClass object.
+ globalThis.windowClass = data;
+ })
+ }
+ ```
+
+2. Enable the full-screen mode for the window and hide the status bar.
+
+ ```
+ globalThis.windowClass.setFullScreen(isFullScreen, (err, data) => {
+ if (err.code) {
+ console.error('Failed to enable the full-screen mode. Cause:' + JSON.stringify(err));
+ return;
+ }
+ console.info('Succeeded in enabling the full-screen mode. Data: ' + JSON.stringify(data));
+ });
+ ```
+
## How do I obtain the window width and height?
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
+Applicable to: OpenHarmony SDK 3.2 Beta5 (API version 9, stage model)
-Use **window.getProperties()** to obtain the window properties. The **windowRect** field in the properties specifies the window width and height.
+**Solution**
-Example:
+Import the **@ohos.window** module, obtain a **Window** object, and use **getWindowProperties\(\)** of the object to obtain the window properties. The **windowRect** field in the properties specifies the window width and height.
+**Example**
-```ts
-let promise = windowClass.getProperties();
-promise.then((data)=> {
- console.info('Succeeded in obtaining the window properties. Data: ' + JSON.stringify(data.windowRect));
-}).catch((err)=>{
- console.error('Failed to obtain the window properties. Cause: ' + JSON.stringify(err));
-});
```
-
-## How do I set the color of the system bar?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-Refer to the following code:
-
-
-```ts
-window.getTopWindow(globalThis.mainContext).then(win => {
- var systemBarProperties = {
- statusBarColor: '#19B6FF', // Set the background color of the status bar.
- navigationBarColor: '#19B6FF', // Set the background color of the navigation bar.
- isStatusBarLightIcon: false, // Set the icon on the status bar not to be highlighted.
- isNavigationBarLightIcon: true, // Set the icon on the navigation bar to be highlighted.
- statusBarContentColor: '#0D0500', // Set the text color of the status bar.
- navigationBarContentColor: '#FFA500' // Set the text color of the navigation bar.
- };
- win.setSystemBarProperties(systemBarProperties).catch(err => {
- INDEX_LOGGER.info(`set System Bar Properties failed:${err}`)
- })
-})
-.catch(err => {
- INDEX_LOGGER.info(`get top window failed:${err}`)
-})
+import window from '@ohos.window';
+let windowClass = null;
+try {
+ let promise = window.getLastWindow(this.context);
+ promise.then((data)=> {
+ // Obtain a Window object.
+ windowClass = data;
+ try {
+ // Obtain the window properties.
+ let properties = windowClass.getWindowProperties();
+ let rect = properties.windowRect;
+ // rect.width: window width; rect.height: window height.
+ } catch (exception) {
+ console.error('Failed to obtain the window properties. Cause: ' + JSON.stringify(exception));
+ }
+ console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data));
+ }).catch((err)=>{
+ console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err));
+ });} catch (exception) {
+ console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception));
+}
```
diff --git a/en/application-dev/faqs/faqs-ide.md b/en/application-dev/faqs/faqs-ide.md
deleted file mode 100644
index a9bbf987a8f098a5016278609cb7d9ebfdd632b8..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-ide.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# IDE Usage
-
-## What should I do if the error message "npm ERR! code SELF_SIGNED_CERT_IN_CHAIN" is displayed?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-1. Run **npm config set strict-ssl=false** on the DevEco Studio terminal.
-
-2. Run **npm install** on the DevEco Studio terminal.
-
-## After manual updating of a DevEco Studio SDK, the error message "Cannot find module 'xxx\ets\x.x.x.x\build-tools\ArkTS-loader\node_modules\webpack\bin\webpack.js'" is displayed during HAP building. What should I do?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-1. Run **npm install** in the **ets\x.x.x.x\build-tools\ets-loader** directory of the SDK.
-
-2. Run **npm install** in the **js\x.x.x.x\build-tools\ace-loader** directory of the SDK. Perform HAP building again.
-
-## How do I pack a HAP file through the command line?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-Method 1: Run **hvigor assembleHap**.
-
-Method 2: In **scripts** of the project **package.json** file, define the build task script and run **npm buildOhosHaps**. The **buildOhosHaps** field can be customized.
-
-
-```
-"scripts": {
- "buildOhosHaps": "hvigor assembleHap"
-},
-```
-
-## How do I select API version 9 when creating a project in DevEco Studio?
-
-Applicable to: DevEco Studio 3.0 Beta4 3.0.0.993(B06)
-
-When creating a project in DevEco Studio, make sure you are on the **OpenHarmony** tab page.
-
-## What should I do if no callback is received and no error code is returned for downloads?
-
-Applicable to: all versions
-
-1. Re-install hdc_std and set up the device connection again.
-2. Run **hdc_std shell hilog -Q pidoff** to disable log log flow control.
-
-## What should I do if the "error: unknow option. usage: aa start \" message is displayed after I click Run in DevEco Studio?
-
-Applicable to: OpenHarmony SDK 3.2.5.6, stage model of API version 9
-
-This issue occurs when the parameter in the **aa** command is invalid and therefore the target application fails to be opened.
-
-To fix this issue, use either of the following methods:
-
-1. Make sure the SDK version and the OS version are the same.
-
-2. Touch the application icon on the device to manually open the application.
-
-## What should I do if "The hdc_std version of the SDK does not match the hdcd version of the device." message is displayed when I run an application in DevEco Studio?
-
-Applicable to: OpenHarmony SDK 3.2.5.6, stage model of API version 9
-
-This issue occurs when the hdc and hdcd versions do not match. Update Dev Eco Studio to 3.0.1.993 or later.
-
-After the update, Dev Eco Studio will still indicate the version mismatch, but will not block the running.
-
-## How do I add a custom .d.ts file to the OpenHarmony SDK?
-
-Applicable to: OpenHarmony SDK 3.1.7.7, FA model of API version 8
-
-Name the .d.ts file **@ohos.xxxx.d.ts**, save it to the SDK path, and restart Dev Eco Studio.
-
-A code notification is displayed when the file is imported.
-
-## How do I switch to the full SDK?
-
-Applicable to: OpenHarmony SDK 3.2.7.5
-
-Follow the instructions in [Guide to Switching to Full SDK](../quick-start/full-sdk-switch-guide.md).
diff --git a/en/application-dev/faqs/faqs-language.md b/en/application-dev/faqs/faqs-language.md
deleted file mode 100644
index 686283d7f8b41fa7abc4f4c78f74eed1240014d8..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-language.md
+++ /dev/null
@@ -1,288 +0,0 @@
-# Programming Languages
-
-## What are the restrictions on using generator functions in TypeScript?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-Below are the restrictions on using generator functions in TypeScript:
-
-- Expressions can be used only in character strings (in the ${expression} format), **if** conditions, **ForEach** parameters, and component parameters.
-
-- No expressions should cause any application state variables (including **@State**, **@Link**, and **@Prop**) to change. Otherwise, undefined and potentially unstable framework behavior may occur.
-
-- The generator function cannot contain local variables.
-
-None of the above restrictions apply to anonymous function implementations of event handlers (such as **onClick**).
-
-Negative example:
-
-```
-build() {
- let a: number = 1 // invalid: variable declaration not allowed
- Column() {
- Text('Hello ${this.myName.toUpperCase()}') // ok.
- ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array variable in place
- }
- buildSpecial() // invalid: no function calls
- Text(this.calcTextValue()) // this function call is ok.
-}
-```
-
-## How do I dynamically replace the %s placeholder in a resource file?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-In an application, you can replace the %s placeholder by using the second parameter in **$r('app.string.xx')**, which is used to reference application resources.
-
-Example:
-
-```
-build() {
- //do something
- // The second parameter indicates the referenced string resource, which can be used to replace the %s placeholder.
- Text($r('app.string.entry_desc','aaa'))
- .fontSize(100)
- .fontColor(Color.Black)
- //do something
-}
-```
-
-## How do I read an XML file in Resource and convert data in it to the string type?
-
-Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
-
-1. Obtain Uint8Array data by calling the **RawFile** API of **resourceManager**.
-
-2. Convert the Uint8Array data to strings by calling the **String.fromCharCode** API.
-
-Reference: [Resource Manager](../reference/apis/js-apis-resource-manager.md)
-
-Example:
-
-
-```
-resourceManager.getRawFile(path, (error, value) => {
- if (error != null) {
- console.log("error is " + error);
- } else {
- let rawFile = value;
- let xml = String.fromCharCode.apply(null, rawFile)
- }
-});
-```
-
-## How do I convert a Resource object to the string type?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-Use the **resourceManager.getString()** API of the **@ohos.resourceManager** module.
-
-Reference: [Resource Manager](../reference/apis/js-apis-resource-manager.md#getstring)
-
-## What should I do if the global static variables of a class do not work?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-Objects imported to abilities and pages are packaged into two different closures, that is, two global objects. In this case, a static variable referenced by the abilities is not the same object as that referenced by the pages. Therefore, global variables cannot be defined by defining static variables in the class. You are advised to use AppStorage to manage global variables.
-
-## How do I obtain resources in the stage model?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-The stage model allows an application to obtain a **ResourceManager** object based on **context** and call its resource management APIs without first importing the required bundle. This method, however, is not applicable to the FA model.
-
-Example:
-
-
-```
-const context = getContext(this) as any
-context
- .resourceManager
- .getString($r('app.string.entry_desc').id)
- .then(value => {
- this.message = value.toString()
-})
-```
-
-## How do I obtain data through an API before page loading?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-In the **aboutToAppear** function, use an asynchronous API to obtain page data and **@State** to decorate related variables. After the data is obtained, the page is automatically refreshed based on the variables.
-
-
-```
-@Entry
-@Component
-struct Test6Page {
- // After the data is obtained, the page is automatically refreshed.
- @State message: string = 'loading.....'
- aboutToAppear(){
- // Simulate an asynchronous API to obtain data.
- setTimeout(()=>{
- this.message = 'new msg'
- },3000)
- }
- build() {
- Row() {
- Column() {
- Text(this.message)
- .fontSize(50)
- .fontWeight(FontWeight.Bold)
- }
- .width('100%')
- }
- .height('100%')
- }
-}
-```
-
-## Do the worker thread and the main thread run in the same global context?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-No. The worker thread and the main thread are not in the same global context. They interact with each other in data communication mode.
-
-## Which API is used for URL encoding in OpenHarmony?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-The global function **encodeURI** is used for URI encoding, and **decodeURI** is used for URI decoding. For example, a space character is encoded as %20.
-
-## Does OpenHarmony provide any API for parsing XML files?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-Yes. The **convert** API of the **convertxml** module can be used to convert XML text into JavaScript objects.
-
-Reference: [@ohos.convertxml](../reference/apis/js-apis-convertxml.md)
-
-## How do I configure application icons to be used across devices?
-
-Applicable to: OpenHarmony SDK 3.0, stage model of API version 9
-
-Use resource qualifiers to configure application icons to be used across devices.
-
-## Can placeholders be configured in the string.json file of the stage model?
-
-Applicable to: OpenHarmony SDK 3.2.6.3, stage model of API version 9
-
-The **string.json** file does not support placeholders. As an alternative, you can define variables on the target page and combine these variables and **Resource** objects.
-
-## Is there any difference between the OpenHarmony API systemTime.getCurrentTime() and the JS API new Date().getTime() API?
-
-Applicable to: OpenHarmony SDK 3.2.6.3, stage model of API version 9
-
-Similar to **new Date().getTime()**, **systemTime.getCurrentTime(false)** returns the number of milliseconds that have elapsed since the Unix epoch. **systemTime.getCurrentTime(true)** returns the number of nanoseconds that have elapsed since the Unix epoch. The system time is used in both APIs.
-
-## How do I define @BuilderParam decorated attributes based on the value assigned to them?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-If no parameter is passed when assigning a value to the **@BuilderParam** decorated attribute (for example, **content: this.specificParam**), define the type of the attribute as a function without a return value (for example, **@BuilderParam content: () => voi**). If any parameter is passed when assigning a value to the **@BuilderParam** decorated attribute (for example, **callContent: this.specificParam1("111")**), define the type of the attribute as **any** (for example, **@BuilderParam callContent: any**).
-
-## How does ArkTS convert a string into a byte array?
-
-Applicable to: all versions
-
-Refer to the following code:
-
-
-```
-function stringToByte(str) {
- var bytes = new Array();
- var len,c;
- len = str.length;
- for(var i = 0;i= 0x010000 && c<= 0x10FFFF) {
- bytes.push(((c>>18) & 0x07) | 0xf0);
- bytes.push(((c>>12) & 0x3F) | 0x80);
- bytes.push(((c>>6) & 0x3f) | 0x80);
- bytes.push((c & 0x3F) | 0x80);
- } else if(c >= 0x000800 && c<= 0x00FFF){
- bytes.push(((c>>12) & 0x07) | 0xf0);
- bytes.push(((c>>6) & 0x3F) | 0x80);
- bytes.push((c & 0x3F) | 0x80);
- } else if(c >= 0x000800 && c<= 0x0007FF) {
- bytes.push(((c>>6) & 0x3F) | 0x80);
- bytes.push((c & 0x3F) | 0x80);
- } else {
- bytes.push(c & 0xFF)
- }
- }
- return bytes;
-}
-```
-
-## What do I do if the "Too many wokers, the number of worker exceeds the maximum" message is displayed during worker creation?
-
-Applicable to: OpenHarmony SDK 3.2.6.5
-
-An application allows for a maximum of seven workers. Therefore, use the **termiate** API to release workers when they are not needed.
-
-Reference: [@ohos.worker](../reference/apis/js-apis-worker.md#terminate)
-
-## What is the recommended multithreading solution on OpenHarmony?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-OpenHarmony recommends that worker threads be used for multithreading.
-
-Reference: [@ohos.worker](../reference/apis/js-apis-worker.md)
-
-## What is the difference between a @Builder decorated method and other methods?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-If the **@Builder** decorated method uses a custom component, this component is re-created each time the method is called.
-
-## Why is the callback registered through @Watch not triggered when the object attributes of an array change?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-As with **@State**, the callback registered through **@Watch** can be used to listen for only one layer of data changes. If the object attributes of the array changes at the inner layer, the callback will not be triggered.
-
-## How do I listen for in-depth changes of @State decorated variables?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-To listen for in-depth changes of **@State** decorated variables, you can use **@Observed** and **@ObjectLink** decorators.
-
-## How do I implement character string encoding and decoding?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-You can use **TextEncoder** and **TextDecoder** provided by the **util** module.
-
-Reference: [TextEncoder](../reference/apis/js-apis-util.md#textencoder) and [TextDecoder](../reference/apis/js-apis-util.md#textdecoder)
-
-## How do i import and export namespaces?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-- Exporting namespaces
-
- ```
- namespace Util{
- export function getTime(){
- return Date.now()
- }
- }
- export default Util
- ```
-
-- Importing namespaces
-
- ```
- import Util from './util'
- Util.getTime()
- ```
-
-## Can relational database operations be performed in the worker thread?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-No. Relational database operations cannot be performed in the worker thread.
-
-
\ No newline at end of file
diff --git a/en/application-dev/faqs/faqs-media.md b/en/application-dev/faqs/faqs-media.md
deleted file mode 100644
index 0e88cf4e94aafa20e47a6ebd8fe3688d26a5e52a..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-media.md
+++ /dev/null
@@ -1,132 +0,0 @@
-# Media Development
-
-## How do I set a front camera?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-1. Set the camera position to **camera.CameraPosition.CAMERA_POSITION_FRONT**.
-
-2. Create a **CameraInput** instance based on the camera position and type.
-
-Reference: [Camera Management](../reference/apis/js-apis-camera.md)
-
-Example:
-
-```
-// The rear camera is set by default. You can use **isFrontCamera** to switch to the rear camera.
-let cameraId
-let cameraInput
-for(let cameraIndex = 0; cameraIndex < this.cameraArray.length; cameraIndex++) {
- let faceType = this.cameraArray[cameraIndex].cameraPosition
- switch(faceType) {
- case camera.CameraPosition.CAMERA_POSITION_FRONT: // Front camera
- if(this.isFrontCamera){
- cameraId = this.cameraArray[cameraIndex].cameraId
- }
- break
- case camera.CameraPosition.CAMERA_POSITION_BACK: // Rear camera
- if(!this.isFrontCamera){
- cameraId = this.cameraArray[cameraIndex].cameraId
- }
- break
- case camera.CameraPosition.CAMERA_POSITION_UNSPECIFIED:
- default:
- break
- }
-}
-cameraInput = await this.cameraManager.createCameraInput(cameraId)
-```
-
-## How do I crop an image?
-
-Applicable to: OpenHarmony SDK 3.2.5.6, stage model of API version 9
-
-1. Create an **ImageSource** instance based on the input URI.
-
- ```
- let path = this.context.getApplicationContext().fileDirs + "test.jpg";
- const imageSourceApi = image.createImageSource(path);
- ```
-
-2. Set decoding parameters and decode the image to obtain a **PixelMap** object. Image processing is supported during decoding.
- - Set **desiredSize** to specify the target size after scaling. If the values are all set to **0**, scaling will not be performed.
- - Set **desiredRegion** to specify the target rectangular area after cropping. If the values are all set to **0**, cropping will not be performed.
- - Set **rotateDegrees** to specify the rotation angle. The image will be rotated clockwise at the center.
-
- ```
- const decodingOptions = {
- desiredSize: {
- height:0,
- width:0
- },
- // Crop a rectangular area.
- desiredRegion: {
- size: {
- height:100,
- width:100
- },
- x:0,
- y:0
- },
- // Rotate the image by 90 degrees.
- rotate:90
- }
- imageSourceApi.createPixelMap(decodingOptions).then(pixelMap => {
- this.handlePixelMap(pixelMap)
- })
- ```
-
-3. Process the obtained **PixelMap** object. For example, render and display the image.
-
-## How do I apply for the media read/write permission on a device?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-1. Configure the permissions **ohos.permission.READ_MEDIA** and **ohos.permission.WRITE_MEDIA** in the **module.json5** file.
- Example:
-
-
- ```
- {
- "module" : {
- "requestPermissions":[
- {
- "name" : "ohos.permission.READ_MEDIA",
- "reason": "$string:reason"
- },
- {
- "name" : "ohos.permission.WRITE_MEDIA",
- "reason": "$string:reason"
- }
- ]
- }
- }
- ```
-
-2. Call **requestPermissionsFromUser** to request the permissions from end users in the form of a dialog box. This operation is required because the grant mode of both permissions is **user_grant**.
-
- ```
- import abilityAccessCtrl from '@ohos.abilityAccessCtrl.d.ts';
-
- let permissions: Array = ['ohos.permission.READ_MEDIA','ohos.permission.WRITE_MEDIA']
- let atManager = abilityAccessCtrl.createAtManager();
- // context is the ability-level context of the initiator UIAbility.
- atManager.requestPermissionsFromUser(context, permissions).then((data) => {
- console.log("Succeed to request permission from user with data: " + JSON.stringify(data))
- }).catch((error) => {
- console.log("Failed to request permission from user with error: " + JSON.stringify(error))
- })
- ```
-
-## Why can't I play MP4 videos?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-Currently, the system does not support the playback of MP4 videos in H.265 format.
-
-
-## Why can't I play a new video or even encounters a crash after creating more than 10 videos?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-A maximum of 13 media player instances can be created.
diff --git a/en/application-dev/faqs/faqs-multimedia.md b/en/application-dev/faqs/faqs-multimedia.md
new file mode 100644
index 0000000000000000000000000000000000000000..080860a9a5ca913d1d40d9de049f9220a66118da
--- /dev/null
+++ b/en/application-dev/faqs/faqs-multimedia.md
@@ -0,0 +1,135 @@
+# Multimedia Development
+
+## How do I obtain the frame data of a camera when using the XComponent to display the preview output stream of the camera?
+
+Applicable to: OpenHarmony 3.2 (API version 9, stage model)
+
+**Symptom**
+
+Currently, the API does not support real-time preview of the camera frame data. To obtain the frame data, you must bind an action, for example, photographing.
+
+**Solution**
+
+Create a dual-channel preview to obtain the frame data.
+
+1. Use the XComponent to create a preview stream.
+
+ ```
+ // Obtain a PreviewOutput instance.
+ const surfaceId = globalThis.mxXComponentController.getXComponentSurfaceld();
+ this.mPreviewOutput = await Camera.createPreviewOutput(surfaceld) ;
+ ```
+
+2. Use imageReceiver to listen for image information.
+
+ ```
+ // Add dual-channel preview.
+ const fullWidth = this.mFullScreenSize.width;
+ const fullHeight = this.mFullScreenSize.height;
+ const imageReceiver = await image.createImageReceiver(fullwidth, fullHeight,
+ formatImage, capacityImage) ;
+ const photoSurfaceId = await imageReceiver.getReceivingSurfaceld();
+ this.mPreviewOutputDouble = await Camera.createPreviewOutput ( photoSurfaceld)
+ ```
+
+
+## How do I obtain the preview image of the front camera?
+
+Applicable to: OpenHarmony 3.2 (API version 9, stage model)
+
+**Solution**
+
+1. Use the **@ohos.multimedia.camera** module to obtain the physical camera information.
+
+ ```
+ let cameraManager = await camera.getCameraManager(context);
+ let camerasInfo = await cameraManager.getSupportedCameras();
+ let cameraDevice = this.camerasInfo[0];
+ ```
+
+2. Create and start the input stream channel of the physical camera.
+
+ ```
+ let cameraInput = await cameraManager.createCameraInput(cameraDevice);
+ await this.cameraInput.open();
+ ```
+
+3. Obtain the output formats supported by the camera, and create a preview output channel based on the surface ID provided by the XComponent.
+
+ ```
+ let outputCapability = await this.cameraManager.getSupportedOutputCapability(cameraDevice);
+ let previewProfile = this.outputCapability.previewProfiles[0];
+ let previewOutput = await cameraManager.createPreviewOutput(previewProfile, previewId);
+ ```
+
+4. Create a camera session, add the camera input stream and preview output stream to the session, and start the session. The preview image is displayed on the XComponent.
+
+ ```
+ let captureSession = await cameraManager.createCaptureSession();
+ await captureSession.beginConfig();
+ await captureSession.addInput(cameraInput);
+ await captureSession.addOutput(previewOutput);
+ await this.captureSession.commitConfig()
+ await this.captureSession.start();
+ ```
+
+
+## How do I set the camera focal length?
+
+Applicable to: OpenHarmony 3.2 (API version 9, stage model)
+
+**Solution**
+
+1. Check whether the camera is a front camera. A front camera does not support focal length setting.
+2. Use **captureSession.getZoomRatioRange\(\)** to obtain the focal length range supported by the device.
+3. Check whether the target focal length is within the range obtained. If yes, call **captureSession.setZoomRatio\(\)** to set the focal length.
+
+## How do I play music in the background?
+
+Applicable to: OpenHarmony 3.2 (API version 9, stage model)
+
+**Symptom**
+
+Music cannot be played in the background.
+
+**Solution**
+
+**AVSession** controls media playback. When a third-party application switches to the background or encounters a screen lock event, media playback is forcibly paused and the application is unaware of the pause. To enable the application to continue the playback in the background, request a continuous task and access the AVSession capability, which allows Control Panel to control the playback behavior of third-party applications.
+
+**Reference**
+
+[Continuous Task Development](../task-management/continuous-task-dev-guide.md)
+
+[AVSession Development](../media/using-avsession-developer.md)
+
+
+## What should I do when multiple video components cannot be used for playback?
+
+Applicable to: OpenHarmony 3.2 (API version 9, stage model)
+
+**Symptom**
+
+A large number of video components are created. They cannot play media normally or even crash.
+
+**Solution**
+
+A maximum of 13 media player instances can be created.
+
+
+## How do I invoke the image library directly?
+
+Applicable to: OpenHarmony 3.2 (API version 9, stage model)
+
+**Solution**
+
+```
+let want = {
+ bundleName: 'com.ohos.photos',
+ abilityName: 'com.ohos.photos.MainAbility',
+ parameters: {
+ uri: 'detail'
+ }
+};
+let context = getContext(this) as common.UIAbilityContext;
+context.startAbility(want);
+```
diff --git a/en/application-dev/faqs/faqs-native.md b/en/application-dev/faqs/faqs-native.md
deleted file mode 100644
index ef5700bb0ec1e3c903fd758d644779856f0ce681..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-native.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# Native API Usage
-
-## Is there a native API that provides functions similar to Canvas?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-Yes. The native API **Drawing** provides similar functions. It can be used for 2D drawing.
-
-## When a native HAP is running, the error message "Obj is not a valid object" is displayed for the imported namespace. What should I do?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-Check the **abiFilters** parameter value in the **build-profile.json5** file in the root directory of the module (not the root directory of the project). If the device is 32-bit, the value must be **armeabi-v7a**. If the device is 64-bit, the value must be **arm64-v8a**.
-
-## What should I do when the error message "install parse profile prop check error" is displayed during the running of a native HAP?
-
-Applicable to: OpenHarmony SDK 3.2.6.3, stage model of API version 9
-
-Check the **abiFilters** parameter value in the **build-profile.json5** file in the root directory of the module (not the root directory of the project). If the device is 32-bit, the value must be **armeabi-v7a**. If the device is 64-bit, the value must be **arm64-v8a**.
-
-## What should I do when the error message "undefined symbol: OH_LOG_Print" is displayed during log printing by **OH_LOG_Print**?
-
-Applicable to: OpenHarmony SDK 3.2.6.3, stage model of API version 9
-
-Modify the **CMakeLists.txt** file by adding **libhilog_ndk.z.so** to the end of **target_link_libraries**.
-
-## How do I obtain the value of version in the package.json file of a module?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-1. In the script file **hvigorfile.js** of Hvigor, use **subModule.getPackageJsonPath** to obtain the location of the **package.json** file in the module.
-
-2. Use Node.js to read the **version** field in the **package.json** file and write the value to the **buildOption.cppFlags** field in the **build-profile.json5** file.
-
-Example
-
-
-```
-// Module-level hvigorfile.js
-const subModule = require('@ohos/hvigor')(__filename)
-
-const fs = require("fs-extra")
-const path = require("path")
-
-const packageJsonPath = subModule.getPackageJsonPath()
-const buildProfilePath = path.resolve(packageJsonPath, '../build-profile.json5')
-const packageJsonData = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
-let buildProfileData = fs.readFileSync(buildProfilePath, 'utf8')
-buildProfileData = buildProfileData.replace(/\"cppFlags\"\:(.*)\,/, `"cppFlags": "-D NWEBEX_VERSION=${packageJsonData.version}",`)
-fs.writeFileSync(buildProfilePath, buildProfileData, 'utf8')
-
-const ohosPlugin = require('@ohos/hvigor-ohos-plugin').hapTasks(subModule) // The plug-in executes the C++ build task and reads the build-profile.json5 file.
-
-module.exports = {
- ohos: ohosPlugin
-}
-```
-
-
-```
-// Read the hello.cpp file.
-#define _NWEBEX_VERSION(v) #v
-#define _NWEBEX_VER2STR(v) _NWEBEX_VERSION(v)
-
-static napi_value Add(napi_env env, napi_callback_info info)
-{
-
- napi_value fixed_version_value = nullptr;
- napi_create_string_utf8(env, _NWEBEX_VER2STR(NWEBEX_VERSION), NAPI_AUTO_LENGTH, &fixed_version_value);
-
- return fixed_version_value;
-}
-```
-
-## How do I traverse files in rawfile?
-
-Applicable to: OpenHarmony SDK 3.2 or later, stage model of API version 9
-
-Use the native API **OH_ResourceManager_OpenRawDir()** to obtain the root directory of **rawfile** and traverse the root directory.
diff --git a/en/application-dev/faqs/faqs-sensor.md b/en/application-dev/faqs/faqs-sensor.md
new file mode 100644
index 0000000000000000000000000000000000000000..3932b223fb5c6af755c9eae019851e37edfa6ef4
--- /dev/null
+++ b/en/application-dev/faqs/faqs-sensor.md
@@ -0,0 +1,7 @@
+# Pan-Sensor Development
+
+## Are the APIs used for obtaining PPG and ECG sensor data open to individual developers?
+
+Applicable to: OpenHarmony 3.1 Beta 5 (API version 9)
+
+Data collected by the PPG and ECG sensors of wearable devices is personal privacy data. Therefore, relative APIs are not open to individual developers.
diff --git a/en/application-dev/faqs/faqs-third-fourth-party-library.md b/en/application-dev/faqs/faqs-third-fourth-party-library.md
new file mode 100644
index 0000000000000000000000000000000000000000..045a3f5efe77b0ad16b64960bbf015b62b07d46f
--- /dev/null
+++ b/en/application-dev/faqs/faqs-third-fourth-party-library.md
@@ -0,0 +1,69 @@
+# Usage of Third- and Fourth-Party Libraries
+
+## How do I obtain available third-party libraries?
+
+Applicable to: OpenHarmony 3.1 Beta 5 (API version 9)
+
+The three-party and four-party libraries that can be obtained through ohpm are summarized in the [OpenHarmony-TPC/tpc_resource repository](https://gitee.com/openharmony-tpc/tpc_resource). You can access this repository, and find the desired component based on the directory index.
+
+## Which third-party libraries are related to network requests?
+
+Applicable to: OpenHarmony 3.1 Beta 5 (API version 9)
+
+The following third-party libraries are related to network requests: [Axios](https://gitee.com/openharmony-sig/axios), httpclient, and okdownload. For details, see the [OpenHarmony-TPC/tpc_resource repository](https://gitee.com/openharmony-tpc/tpc_resource).
+
+## How do I use ohpm to import third- and fourth-party libraries?
+
+Applicable to: OpenHarmony 3.1 Beta 5 (API version 9)
+
+**Solution**
+
+- Method 1:
+ 1. Open the **Terminal** window and run the following command to go to the **entry** directory:
+
+ ```
+ cd entry
+ ```
+
+ 2. Run the following command to install a third-party library, for example, **dayjs**:
+
+ ```
+ ohpm install dayjs
+ ```
+
+ 3. Add the following statement in the .js file to import the third-party library:
+
+ ```
+ import dayjs from 'dayjs';
+ ```
+
+
+- Method 2:
+ 1. Enter the **entry** directory of the project and open the **oh-package.json5** file.
+ 2. Write the third-party library to be installed (for example, **dayjs**) in the **oh-package.json5** file.
+
+ ```
+ {
+ "dependencies": {
+ "dayjs": "^1.10.4",
+ }
+ }
+ ```
+
+ 3. Open the **Terminal** window and run the following command to go to the **entry** directory:
+
+ ```
+ cd entry
+ ```
+
+ 4. Run the following command to install the third-party library:
+
+ ```
+ ohpm install
+ ```
+
+ 5. Add the following statement in the .js file to import the third-party library:
+
+ ```
+ import dayjs from 'dayjs';
+ ```
diff --git a/en/application-dev/faqs/faqs-third-party-library.md b/en/application-dev/faqs/faqs-third-party-library.md
deleted file mode 100644
index 898055cd200805d8df549b33bb2c5f3b4b05bca6..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-third-party-library.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Usage of Third- and Fourth-Party Libraries
-
-## What does the following error message mean: "Stage model module... does not support including OpenHarmony npm packages or modules in FA model. OpenHarmony build tasks will not be executed, and OpenHarmony resources will not be packed."
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-The third- and fourth-party libraries are not yet compatible with the stage model of API version 9 and cannot be used.
-
-## Can I transfer project-level dependencies?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-For example, if project A depends on project B and project B depends on project C, can project A directly use the APIs provided by project C?
-
-No. Project A cannot directly use the APIs provided by project C. The project packing tool NPM does not support dependency transfer. To use the APIs provided by project C, you can add the dependency of project C to project A.
-
-## How do I obtain available third-party libraries?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-For details, see [Third-Party Components That Can Be Directly Used on OpenHarmony](https://gitee.com/openharmony-sig/third_party_app_libs).
-
-## Which third-party libraries are related to network requests?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The [Axios](https://gitee.com/openharmony-sig/axios) library is related to network requests.
-
-## How do I use NPM to import third- and fourth-party libraries?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-- Method 1:
- 1. Open the **Terminal** window and run the following command to go to the **entry** directory:
-
- ```
- cd entry
- ```
- 2. Run the following command to install a third-party package, for example, **dayjs**:
-
- ```
- npm install dayjs --save
- ```
- 3. Add the following statement in the .js file to import the package:
-
- ```
- import dayjs from 'dayjs';
- ```
-
-- Method 2:
- 1. Enter the **entry** directory of the project and open the **package.json** file.
- 2. Write the third-party NPM package to be installed (for example, **dayjs**) in the **package.json** file.
-
- ```
- {
- "dependencies": {
- "dayjs": "^1.10.4",
- }
- }
- ```
- 3. Open the **Terminal** window and run the following command to go to the **entry** directory:
-
- ```
- cd entry
- ```
- 4. Run the following command to install NPM:
-
- ```
- npm install
- ```
- 5. Add the following statement in the .js file to import the package:
-
- ```
- import dayjs from 'dayjs';
- ```
diff --git a/en/application-dev/faqs/faqs-ui-ets.md b/en/application-dev/faqs/faqs-ui-ets.md
deleted file mode 100644
index 8564d2f0969a2cf6eac9bb2d9ac521e62045d162..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-ui-ets.md
+++ /dev/null
@@ -1,656 +0,0 @@
-# ArkUI (ArkTS) Development
-
-## How do I use router to implement page redirection in the stage model?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-1. To implement page redirection through **router**, add all redirected-to pages to the pages list in the **main_pages.json** file.
-
-2. Page routing APIs in **router** can be invoked only after page rendering is complete. Do not call these APIs in **onInit** or **onReady** when the page is still in the rendering phase.
-
-Reference: [Page Routing](../reference/apis/js-apis-router.md)
-
-## Will a page pushed into the stack through router.push be reclaimed?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-After being pushed to the stack through **router.push**, a page can be reclaimed only when it is popped from the stack through **router.back**.
-
-## How do I position a container component to the bottom of the screen?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-Create a **** component, and set the target container at the bottom of the **** component.
-
-Example:
-
-```
-build() {
- Stack({alignContent : Alignment.Bottom}) {
- // The container is at the bottom.
- Stack() {
- Column()
- .width('100%')
- .height('100%')
- .backgroundColor(Color.Yellow)
- }
- .width('100%')
- .height('10%')
- }
- .width('100%')
- .height('100%')
- .backgroundColor('rgba(255,255,255, 0)')
-}
-```
-
-## Can CustomDialog be used in TypeScript files?
-
-Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
-
-No. **CustomDialog** can be used only on ArkTS pages.
-
-Reference: [Custom Dialog Box](../reference/arkui-ts/ts-methods-custom-dialog-box.md)
-
-## How do I transfer variables in CustomDialog to variables on pages?
-
-Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
-
-Use a custom callback so that when the confirm button in the custom dialog box is clicked, the value of **data** is transferred from the dialog box to the current page.
-
-Example:
-
-
-```
-// Dialog box component
-@CustomDialog
-struct MyDialog {
- controller: CustomDialogController
- title: string
- confirm: (data: string) => void
- data: string = ''
-
- build() {
- Row() {
- Column({ space: 10 }) {
- Text(this.title)
- .fontSize(30)
- .fontColor(Color.Blue)
- TextInput({ placeholder: "Enter content", text: this.data })
- .onChange((data) => {
- this.data = data // Obtain the data in the text box.
- })
- Button('confirm')
- .onClick(() => {
- this.confirm(this.data) // Transfer the data in the text box to the main page through the callback.
- this.controller.close()
- }).backgroundColor(0xffffff).fontColor(Color.Red)
- }.width("50%")
- }.height("50%")
- }
-}
-
-// Main page
-@Entry
-@Component
-struct DialogTest {
- @State dialogTitle: string = ''
- @State dialogData: string = ''
- dialogController: CustomDialogController = new CustomDialogController({
- builder: MyDialog({
- title: this.dialogTitle, // Bind data.
- data: this.dialogData,
- confirm: this.confirm.bind(this) // Bind the custom callback. Change the direction of this here.
- })
- })
-
- confirm(data: string) {
- this.dialogData = data
- console.info(`recv dialog data: ${data}`) // Obtain the information entered in the dialog box.
- }
-
- build() {
- Row() {
- Column({ space: 10 }) {
- Button ('Open Dialog Box')
- .onClick(() => {
- this.dialogTitle ='Dialog Box'
- this.dialogController.open()
- })
- Text(`Accept pop-up window data:`)
- .fontSize(20)
- TextInput ({ placeholder: "Input", text: this.dialogData })
- .width("50%")
- .onChange((data) => {
- this.dialogData = data //Obtain the data in the text box.
- })
- }.width("100%")
- }.height("100%")
- }
-}
-```
-
-## What should I do if the \ component cannot be dragged to the bottom after it has a \ component added?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-The **\** component is a scrollable container. By default, it takes up the entire screen height. When any component with a fixed height takes up part of the screen height, you need to explicitly specify **layoutWeight(1)** for the parent container of the **\** component to take up the remaining height instead of the entire screen height.
-
-## How do I center child components in a grid container?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-By default, child components in a **\** are horizontally aligned to the left. To center them, perform the following steps:
-
-Nest a **\** component and set it to **justifyContent(FlexAlign.Center)**. For details, see [Grid Layout](../reference/arkui-ts/ts-container-gridcontainer.md).
-
-Example:
-
-```
-GridContainer({ sizeType: SizeType.SM, columns: 12 }) {
- Row() {
- Text('1')
- .useSizeType({
- sm: { span: 4, offset: 0 },
- })
- .backgroundColor(0x46F2B4)
- }.justifyContent(FlexAlign.Center) // Center child components.
-}
-```
-
-## How do I obtain the height of the status bar and navigation bar?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-Before the window content is loaded, enable listening for the **systemAvoidAreaChange** event.
-
-Example:
-
-```ts
-import Window from '@ohos.window';
-import UIAbility from '@ohos.app.ability.UIAbility';
-
-/**
- * Set the immersive window and obtain the height of the status bar and navigation bar.
- * @param mainWindow Indicates the main window.
- */
-async function enterImmersion(mainWindow: window.Window) {
- mainWindow.on("systemAvoidAreaChange", (area: window.AvoidArea) => {
- AppStorage.SetOrCreate("topHeight", area.topRect.height);
- AppStorage.SetOrCreate("bottomHeight", area.bottomRect.height);
- })
- await mainWindow.setFullScreen(true)
- await mainWindow.setSystemBarEnable(["status", "navigation"])
- await mainWindow.sArkTSystemBarProperties({
- navigationBarColor: "#00000000",
- statusBarColor: "#00000000",
- navigationBarContentColor: "#FF0000",
- statusBarContentColor: "#FF0000"
- })
-}
-export default class EntryAbility extends UIAbility {
- // do something
- async onWindowStageCreate(windowStage: window.WindowStage) {
- let mainWindow = await windowStage.getMainWindow()
- await enterImmersion(mainWindow)
- windowStage.loadContent('pages/index')
- }
- // do something
-}
-```
-
-## How do I fix misidentification of the pan gesture where container nesting is involved?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
-
-Set the **distance** attribute to **1** for the gesture. By default, this attribute is set to **5**.
-
-## How do I obtain the height of a component?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-You can obtain the changes in the width and height of a component through **onAreaChange**.
-
-Example:
-
-
-```ts
-Column() {
- Text(this.value)
- .backgroundColor(Color.Green).margin(30).fontSize(20)
- .onClick(() => {
- this.value = this.value + 'Text'
- })
- .onAreaChange((oldValue: Area, newValue: Area) => {
- console.info(`Ace: on area change, oldValue is ${JSON.stringify(oldValue)} value is ${JSON.stringify(newValue)}`)
- this.size = JSON.stringify(newValue)
- })
-```
-
-## How do I obtain the offset of the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-Bind the **\** component to a **Scoller** object and obtain the offset through **currentOffset**.
-
-Example:
-
-
-```ts
-Column() {
- List({ space: 20, initialIndex: 0,scroller: this.scroller}) {
- ForEach(this.arr, (item) => {
- ListItem() {
- Text('' + item)
- .width('100%').height(100).fontSize(16)
- .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF)
- }.editable(true)
- }, item => item)
- }
- .listDirection(Axis.Vertical) // Arrangement direction
- .editMode(this.editFlag)
- .onScroll((xOffset: number, yOffset: number) => {
- console.info("yOffset======="+this.scroller.currentOffset().yOffset)
- })
-}.width('100%')
-```
-
-## How do I obtain the value of param for the target page of redirection implemented using router?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-
-```ts
-// In versions earlier than 3.1.5.5, obtain the value through router.getParams().key.
-private value: string = router.getParams().value;
-// In 3.1.6.5 and later versions, obtain the value through router.getParams()['key'].
-private value: string = router.getParams()['value'];
-```
-
-## Does the \ component support redirection to a local page?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-No. This feature is not supported.
-
-## How do I disable the transition effect for pages switched using router or navigator?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-1. Define the **pageTransition** method for the current and target pages, by following instructions in [Example](../reference/arkui-ts/ts-page-transition-animation.md#example).
-
-2. Set the **duration** parameter of both **PageTransitionEnter** and **PageTransitionExit** to **0**.
-
-## How do I select the pixel unit during UI development?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-It depends.
-
-The vp unit ensures consistency of visual effects across resolutions. For example, it ensures that an icon is displayed consistently under different resolutions.
-
-The lpx unit produces a visual effect where items are zoomed in or out proportionally.
-
-If you are concerned about visual effect consistency of items, for example, buttons, texts, and lists, use the vp unit. If your focus is on the layout, for example, 1/2 grid, the lpx is a better choice.
-
-## What color formats are used in ArkTS?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-The color can be represented in two formats, for example, 0x7F000000 or '\#7F000000'. The first two digits indicate opacity, and the last six digits indicate RGB.
-
-
-```ts
-fontColor(0x7F000000)
-fontColor( '#7F000000' )
-```
-
-## How do I listen for the return operation on a page?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-When a return operation is performed on a page, the system calls the **onBackPress()** callback of the **@Entry** decorated custom component. You can implement related service logic in the callback.
-
-Reference: [Custom Component Lifecycle Callbacks](../ui/ui-ts-custom-component-lifecycle-callbacks.md)
-
-## Can I customize the eye icon for the \ component in password mode?
-
-Applicable to: OpenHarmony SDK 3.0, stage model of API version 9
-
-No. The eye icon can be shown or hidden through **showPasswordIcon** when **type** of the **\** component is set to **InputType.Password**. It cannot be customized.
-
-Reference: [TextInput](../reference/arkui-ts/ts-basic-components-textinput.md)
-
-## Why can't images be loaded over HTTP?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-HTTP is insecure and HTTP sources will be filtered out by the trustlist. For security purposes, use HTTPS.
-
-## What should I do if the spacing set for the TextView layout does not fit the UI?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-By default, the **align** attribute of **TextView** is set to **Center**. To display the text from left to right, set the **align** attribute to **Start**.
-
-## Why do the constraintSize settings fail to take effect?
-
-Applicable to: OpenHarmony SDK 3.0, stage model of API version 9
-
-If **constraintSize** is set for a component and the width of its child component is set to a percentage, for example, **width('100%')**, **constraintSize** takes effect by multiplying the maximum width by the percentage. As a result, the child component may overflow, in which case it looks like the **constraintSize** settings fail to take effect.
-
-## How do I set the background color to transparent?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-Set **backgroundColor** to **'\#00000000'**.
-
-## What should I do if the \ component cannot scroll to the bottom?
-
-Applicable to: OpenHarmony SDK 3.0, stage model of API version 9
-
-Unless otherwise specified, the height of the **\** component is equal to the window height. In this case, the component's bottom area will be blocked by components (if any) outside of it. To fix this issue, set the height of the **\** component or use the flex layout to limit this height.
-
-## How do I use the onSubmit event of the \ component?
-
-Applicable to: OpenHarmony SDK 3.0, stage model of API version 9
-
-The **onSubmit** event is triggered when the Enter key is pressed and accepts the current Enter key type as its input parameter. You can set the Enter key type for the **\** component through the **enterKeyType** attribute. The Enter key style of the soft keyboard requires the support of the input method.
-
-Reference: [TextInput](../reference/arkui-ts/ts-basic-components-textinput.md)
-
-## What is the maximum number of pages allowed during page routing?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The maximum number of pages supported by the page stack is 32. When this limit is reached, the **router.push** API cannot be used for page redirection.
-
-## Does ArkUI allow components to be dynamically created in code?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-Yes. You can dynamically creaete components using [conditional rendering](../quick-start/arkts-rendering-control.md#conditional-rendering) and [loop rendering](../quick-start/arkts-rendering-control.md#loop-rendering).
-
-## What should I do if the PixelMap object carried in page routing cannot be obtained from the target page?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-Page routing supports only the common object type and common JSON data structure. To pass a **PixelMap** object to the target page, store it in the **localStorage**.
-
-## How do I use .caretPosition(0) to move the caret to the start of the text area when onEditChange is triggered for the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The **onEditChange** event is triggered when the input box gains focus. Under this scenario, the caret position is related to the position where the gesture is when the event is triggered, and **caretPosition** cannot be used to change the caret position. Call **setTimeout** for asynchronous processing first.
-
-## Is there any method for selecting all items in the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-No. This feature is not supported yet.
-
-## Why can't I select a date when the type attribute of the input text box is set to date?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-Setting the **type** attribute of the input component to **date** means that the component accepts dates as input and the user will be notified of the valid input format. It does not display a date picker. To display a date picker, use the **\** component.
-
-## What should I do if the displayed input keyboard gets squeezed when using the **\** component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-This issue may occur when the flex layout is used. To fix it, switch to the column layout.
-
-## How does the parent component pass values to a @Link decorated member variable in its child component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-To pass a value from the parent component to the **@Link** decorated member variable in a child component, add **"$"** in front of the value.
-
-Example:
-
-
-```
-@Component
-struct FoodImageDisplay {
- @Link imageSrc: Resource
-
- build() {
- Stack({ alignContent: Alignment.BottomStart }) {
- Image(this.imageSrc)
- .objectFit(ImageFit.Contain)
- Text('Tomato')
- .fontSize(26)
- .fontWeight(500)
- .margin({ left: 26, bottom: 17.4 })
- }
- .backgroundColor('#FFedf2f5')
- .height(357)
- }
-}
-
-@Entry
-@Component
-struct FoodDetail {
-
- @State imageSrc: Resource = $r('app.media.Tomato')
-
- build() {
- Column() {
- FoodImageDisplay({imageSrc:$imageSrc})
- }
- .alignItems(HorizontalAlign.Center)
- }
-}
-```
-
-## How do I share variables between Page abilities?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-1. Use a lightweight database.
-
-2. Use persistent data management.
-
-3. Use the emitter event communication mechanism.
-
-
-## How do I customize the control bar style of the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-1. Set **controls** to **false** to disable the default control bar.
-
-2. Set **controller** for the **\** component.
-
-3. Implement a custom control bar in ArkTS and use **VideoController** to control video playback.
-
-## How do I optimize the performance when an ArkTS component is to be updated for multiple times?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-Extract the ArkTS component to be updated into a custom component and update the **@State** decorated variables in the custom component to implement partial refresh.
-
-## How do I optimize the \ component performance?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-When the **\** component is on a tab page, other tab pages are not unloaded by the system and still occupy some memory. To improve performance, you can use **if** to check whether the current tab page is being displayed and unload it if it is not. In this way, the tab pages not being displayed can be unloaded and the memory occupied by them can be released.
-
-## How do I set state-specific styles for a component?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-You can use the polymorphic style attribute to set styles of the component for different states (being stateless, in pressed state, in disabled state, in focused state, or in clicked state).
-
-Reference: [Polymorphic Style](../reference/arkui-ts/ts-universal-attributes-polymorphic-style.md)
-
-## Why can't the onBlur or onFocus callback be triggered?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-Only the Tab button and arrow buttons on the connected keyboard can be used to trigger the focus event. In addition, to trigger a focus event by a touch, the **focusOnTouch** attribute must be added for the component.
-
-Reference: [Focus Control](../reference/arkui-ts/ts-universal-attributes-focus.md)
-
-## What should I do if the flex width and height in the \ component conflicts with the scrolling?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The **\** component supports a single child component, whose height is subject to the content height. If the scrolling layout is abnormal due to asynchronous loading of an image within the content, you can set the minimum height for the child component through **constraintSize({ minHeight: '100%' })**.
-
-## How do I block the page router from returning to the previous page?
-
-Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9
-
-Call **router.clear()** to remove all historical pages in the page stack and retain the current page at the top of the stack.
-
-Reference: [Page Routing](../reference/apis/js-apis-router.md)
-
-## How do I clear the content of the \ component at once?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-Refer to the following:
-
-
-```
-struct Index {
-@State text: string = 'Hello World'
-controller: TextInputController = new TextInputController()
- build() {
- Row() {
- Column() {
- TextInput({ placeholder: 'Please input your words.', text: this.text,
- controller:this.controller}).onChange((value) => {
- this.text = value
- })
- Button("Clear TextInput").onClick(() => {
- this.text = "";
- })
- }
- .width('100%')
- }
- .height('100%')
- }
-}
-```
-
-## Can tab switching be disabled for the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-No. This feature is not supported.
-
-## An error is reported when @state is used to decorate the id member variable: "TypeError: cannot read property 'get' of undefined." Why?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The ID has been added as a unique value and becomes a keyword.
-
-## Can I use the fontFamily attribute to set different fonts for OpenHarmony applications?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-No. For applications developed based on OpenHarmony, the default font and also the only supported font is HarmonyOS Sans.
-
-## What is the recommended data interaction mode between an ability and UI page?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-[LocalStorage](../quick-start/arkts-state-mgmt-application-level.md#localstorage) is recommended.
-
-## How does a parent component synchronize status with its grandchild components?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-- Method 1 (recommended): Use the **@Provide** and **@Consume** decorators. Specifically, use **@Provide** in the parent component and **@Consume** in the grandchild component to implement two-way data binding between the components.
-
-- Method 2: Use the **@State** and **@Link** decorators. Specifically, use **@State** in the parent component, and **@Link** in all involved child and grandchild components.
-
-## How do I display an ellipsis in cases when the string is too long to display in full?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-Example:
-
-
-```
-beautySub(str,len) {
- var reg = /[\u4e00-\u9fa5]/g;
- // Reduce characters whenever possible.
- var slice = str.substring(0,len)
- var charNum = (~~(slice.match(reg) && slice.match(reg).length))
- // The purpose of charNum-1 is to process the string that exceeds the maximum value. If the string exceeds the maximum value, the character that is not in current language is not displayed.
- var realen = slice.length*2 - charNum-1
- return str.substr(0,realen) + (realen < str.length ? "..." : "") +str.substr(str.length-realen,str.length)
-}
-```
-
-## How do I add a scrollbar to the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The **\** component is underpinned by web. To add a scrollbar, you can refer to the HTML syntax and add the **overflow: auto** style to **div**.
-
-## How do I disable the scroll event of a grid in the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-You can use the **onScrollBegin** event and the **scrollBy** method to implement nested scrolling of the containers.
-
-Reference: [Scroll](../reference/arkui-ts/ts-container-scroll.md#example-2)
-
-## Can the white background of the custom dialog box be removed?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-No. This feature is not supported. The UI style is hardcoded in the framework and cannot be changed.
-
-## Does the **backgroundImage** API support the SVG image format?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-No. This image format is not supported.
-
-## How do I set the position for a custom dialog box?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-You can set the position for a custom dialog box through the **alignment** parameter. For example, to set the custom dialog box to show at the bottom, set **alignment** to **DialogAlignment.Bottom**.
-
-Reference: [Custom Dialog Box](../reference/arkui-ts/ts-methods-custom-dialog-box.md)
-
-## How does the scroller determine the end error of the rebound animation?
-
-Applicable to: OpenHarmony SDK 3.2.5.3, FA model of API version 8
-
-After the touch ends, a change in the same direction may be calculated. If the change is in the opposite direction, it indicates that a rebound occurs, and no processing is performed.
-
-
-## How do I implement persistent storage of application data?
-
-Use the **PersistentStorage** class to manage persistent application data. Persistent data with specific tags can be linked to the **AppStorage** and accessed through the **AppStorage** APIs.
-
-Reference: [PersistentStorage](../quick-start/arkts-state-mgmt-application-level.md#persistentstorage)
-
-Example:
-
-
-```
-AppStorage.Link('varA')
-PersistentStorage.PersistProp("varA", "111");
-@Entry
-@Componentstruct Index {
- @StorageLink('varA') varA: string = ''
- build() {
- Column() {
- Text('varA: ' + this.varA).fontSize(20)
- Button('Set').width(100).height(100).onClick(() => {
- this.varA += '333'
- })
- }
- .width('100%')
- .height('100%')
- }
-}
-```
diff --git a/en/application-dev/faqs/faqs-ui-js.md b/en/application-dev/faqs/faqs-ui-js.md
deleted file mode 100644
index c60ff729eae773a356a50da1b9197c1de2b9c120..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-ui-js.md
+++ /dev/null
@@ -1,94 +0,0 @@
-# ArkUI (JavaScript) Development
-
-## How do I convert the fields in an XML file into JavaScript objects?
-
-Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9
-
-To convert fields in an XML file into JavaScript objects, call the **convert** API in the **convertxml** module.
-
-Example:
-
-
-```
-import convertxml from '@ohos.convertxml';
-// XML strings
-let xml =
- '' +
- '' +
- ' Happy ' +
- ' Work ' +
- ' Play ' +
- ' ';
-let conv = new convertxml.ConvertXML();
-// Options for conversion. For details, see the reference document.
-let options = {
- trim: false,
- declarationKey: "_declaration",
- instructionKey: "_instruction",
- attributesKey: "_attributes",
- textKey: "_text",
- cdataKey: "_cdata",
- doctypeKey: "_doctype",
- commentKey: "_comment",
- parentKey: "_parent",
- typeKey: "_type",
- nameKey: "_name",
- elementsKey: "_elements"
-}
-let result: any = conv.convert(xml, options) // Convert fields in the XML file into JavaScript objects.
-console.log('Test: ' + JSON.stringify(result))
-console.log('Test: ' + result._declaration._attributes.version) // version field in the XML file
-console.log('Test: ' + result._elements[0]._elements[0]._elements[0]._text) // title field in the XML file
-```
-
-For details, see [XML-to-JavaScript Conversion](../reference/apis/js-apis-convertxml.md).
-
-## How do I convert the time to the HHMMSS format?
-
-Example:
-
-
-```
-export default class DateTimeUtil{
- /**
- * HHMMSS
- */
- getTime() {
- const DATETIME = new Date()
- return this.concatTime(DATETIME.getHours(),DATETIME.getMinutes(),DATETIME.getSeconds())
- }
- /**
- * YYYYMMDD
- */
- getDate() {
- const DATETIME = new Date()
- return this.concatDate(DATETIME.getFullYear(),DATETIME.getMonth()+1,DATETIME.getDate())
- }
- /**
- * If the date is less than 10, add a leading zero, for example, **07**.
- * @param value Indicates the value.
- */
- fill(value:number) {
- return (value> 9 ? '' : '0') + value
- }
- /**
- * Concatenate year, month, and date fields.
- * @param year
- * @param month
- * @param date
- */
- concatDate(year: number, month: number, date: number){
- return `${year}${this.fill(month)}${this.fill(date)}`
- }
- /**
- Concatenate hours, minutes, and seconds fields.
- * @param hours
- * @param minutes
- * @param seconds
- */
- concatTime(hours:number,minutes:number,seconds:number){
- return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}`
- }
-}
-
-```
diff --git a/en/application-dev/faqs/faqs-web-arkts.md b/en/application-dev/faqs/faqs-web-arkts.md
deleted file mode 100644
index 6fe2c75a4bf0bc9b1d2f73929a34dc618c503d5b..0000000000000000000000000000000000000000
--- a/en/application-dev/faqs/faqs-web-arkts.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# ArkUI Web Component (ArkTS) Development
-
-## What is the domStorageAccess attribute of the \ component used for?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The **domStorageAccess** attribute specifies whether to enable the DOM Storage API, which is disabled by default and provides **localStorage**, but not **sessionStorage**.
-
-## How do I check the online status on the HTML page loaded by the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-1. Configure the **ohos.permission.INTERNET** and **ohos.permission.GET_NETWORK_INFO** application permissions.
-
-2. Obtain the online status through **window.navigator.onLine** on the HTML page.
-
-## What should I do if the UserAgent string cannot be used in concatenation before the initial HTML5 page loading by the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-By default, the **UserAgent** string is obtained through the **WebController**. A **WebController** object can control only one **\** component, and methods on the **WebController** can only be called by the **\** component bound to it. To concatenate the default **UserAgent** string and a custom string before the initial page loading, perform the following:
-
-1. Use **@State** to define the initial **userAgent** and bind it to the **\** component.
-
-2. In the **onUrlLoadIntercept** callback of the **\** component, use **WebController** to obtain the default **userAgent** string and modify the **userAgent** bound to the **\** component.
- The code snippet is as follows:
-
-
- ```
- @Entry
- @Component
- struct Index {
- private controller: WebController = new WebController()
- @State userAgentPa: string = ''
- build() {
- Row() {
- Column() {
- Web({ src: 'www.example.com', controller: this.controller })
- .width('100%')
- .userAgent(this.userAgentPa)
- .onUrlLoadIntercept((event) => {
- let userAgent = this.controller.getDefaultUserAgent();
- this.userAgentPa = userAgent + ' 111111111'
- console.log("userAgent onUrlLoadIntercept: " + userAgent);
- return false;
- })
- }
- .width('100%').alignItems(HorizontalAlign.Start).backgroundColor(Color.Green)
- }
- .height('100%')
- }
- }
- ```
-
-## Should the logic for loading the lottie animation be written in the onAppear or onReady function?
-
-Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9
-
-The logic for loading the lottie animation must be written in the **onReady** function. The **onReady** function is triggered when the canvas is ready, while the **onAppear** function is triggered when the canvas is displayed.
-
-## Do I need to invoke the refresh API after invoking deleteJavaScriptRegister?
-
-Applicable to: all versions
-
-No. This operation is not needed.
-
-## How do I pass data from a page to the \ component?
-
-Applicable to: OpenHarmony SDK 3.2.7.5, stage model of API version 9
-
-1. Use **WebController** to create two message ports: message port 1 and message port 0.
-
-2. Send message port 1 to the HTML side, which can then save and use the port.
-
-3. Register a callback for message port 0 on the application side.
-
-4. Use message port 0 on the application side to send messages to message port 1 on the HTML side.
-
-Reference: [Web](../reference/arkui-ts/ts-basic-components-web.md)
diff --git a/en/application-dev/faqs/faqs-window-manager.md b/en/application-dev/faqs/faqs-window-manager.md
new file mode 100644
index 0000000000000000000000000000000000000000..7368ec7cbb95ee0235810464d822554cf2b1880d
--- /dev/null
+++ b/en/application-dev/faqs/faqs-window-manager.md
@@ -0,0 +1,64 @@
+# Window Management Development
+
+## How do I obtain the height of the status bar and navigation bar?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Before the window content is loaded, enable listening for the **systemAvoidAreaChange** event.
+
+**Example**
+
+```
+// MainAbility.ts
+import window from '@ohos.window';
+
+/**
+ * Set the immersive window and obtain the height of the status bar and navigation bar.
+ * @param mainWindow Indicates the main window.
+ */
+async function enterImmersion(mainWindow: window.Window) {
+ mainWindow.on("systemBarTintChange", (data) => {
+ let avoidAreaRect = data.regionTint[0].region; // data.regionTint is an array that contains the rectangle coordinates of the status bar and navigation bar.
+ })
+ await mainWindow.setFullScreen(true)
+ await mainWindow.setSystemBarEnable(["status", "navigation"])
+ await mainWindow.systemBarProperties({
+ navigationBarColor: "#00000000",
+ statusBarColor: "#00000000",
+ navigationBarContentColor: "#FF0000",
+ statusBarContentColor: "#FF0000"
+ })
+}
+export default class MainAbility extends Ability {
+ // Do something.
+ async onWindowStageCreate(windowStage: window.WindowStage) {
+ let mainWindow = await windowStage.getMainWindow()
+ await enterImmersion(mainWindow)
+ windowStage.loadContent('pages/index')
+ }
+ // Do something.
+}
+```
+
+## How do I hide the status bar on the top of an application?
+
+Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+
+**Solution**
+
+Use **setWindowSystemBarEnable** in the **onWindowStageCreate** lifecycle callback of UIAbility.
+
+**Example**
+
+```
+onWindowStageCreate(windowStage){
+ windowStage.getMainWindowSync().setWindowSystemBarEnable([])
+ ......
+}
+```
+
+**Reference**
+
+[Window](../reference/apis/js-apis-window.md)
diff --git a/en/application-dev/media/using-avsession-developer.md b/en/application-dev/media/using-avsession-developer.md
index 07bd4bf1297f3afc5352d30e9acd674fe056f815..077f0b956a5fb6abaf26c647132bdbb81e78fc63 100644
--- a/en/application-dev/media/using-avsession-developer.md
+++ b/en/application-dev/media/using-avsession-developer.md
@@ -88,7 +88,7 @@ To enable an audio and video application to access the AVSession service as a pr
```ts
// It is assumed that an AVSession object has been created. For details about how to create an AVSession object, see the node snippet above.
let session: AVSessionManager.AVSession = ALLREADY_CREATE_A_SESSION;
- let wantAgentInfo: {
+ let wantAgentInfo = {
wants: [
{
bundleName: "com.example.musicdemo",
diff --git a/en/application-dev/quick-start/app-configuration-file.md b/en/application-dev/quick-start/app-configuration-file.md
index cbc97f24e80d576f747d69eeeaec89f50c264283..e133664dbec342b76c4f6b57e650513a7fbfc92a 100644
--- a/en/application-dev/quick-start/app-configuration-file.md
+++ b/en/application-dev/quick-start/app-configuration-file.md
@@ -1,7 +1,7 @@
# app.json5 Configuration File
-This document gives an overview of the **app.json5** configuration file. To start with, let's go through an example of what this file contains.
+This topic gives an overview of the **app.json5** configuration file. To start with, let's go through an example of what this file contains.
```json
{
@@ -35,7 +35,7 @@ As shown above, the **app.json5** file contains several tags.
| Name| Description| Data Type| Initial Value Allowed|
| -------- | -------- | -------- | -------- |
| bundleName | Bundle name, which uniquely identifies an application. The value must comply with the following rules: - Consists of letters, digits, underscores (_), and periods (.). - Starts with a letter. - Contains 7 to 127 bytes. You are advised to use the reverse domain name notation, for example, *com.example.demo*, where the first part is the domain suffix **com**, the second part is the vendor/individual name, and the third part is the application name, which can be of multiple levels. If an application is built with the system source code, you are advised to name it in *com.ohos.demo* notation, where **ohos** signifies that the application is an OpenHarmony system application.| String| No|
-| bundleType| Bundle type, which is used to distinguish applications and atomic services. - **app**: The bundle is a common application. - **atomicService**: The bundle is an atomic service. - **shared**: The bundle is a shared object application. | String| Yes (initial value: **"app"**)|
+| bundleType| Bundle type, which is used to distinguish applications and atomic services. - **app**: The bundle is a common application. - **atomicService**: The bundle is an atomic service. - **shared**: The bundle is a shared object application.| String| Yes (initial value: **"app"**)|
| debug | Whether the application can be debugged. This tag is generated during compilation and building in DevEco Studio. - **true**: The application can be debugged. - **false**: The application cannot be debugged.| Boolean| Yes (initial value: **false**)|
| icon | [Icon of the application](../application-models/application-component-configuration-stage.md). The value is an icon resource index.| String| No|
| label | [Name of the application](../application-models/application-component-configuration-stage.md). The value is a string resource index.| String| No|
@@ -49,10 +49,11 @@ As shown above, the **app.json5** file contains several tags.
| apiReleaseType | Type of the target API version required for running the application. The value can be **"CanaryN"**, **"BetaN"**, or **"Release"**, where **N** represents a positive integer. - **Canary**: indicates a restricted release. - **Beta**: indicates a publicly released beta version. - **Release**: indicates a publicly released official version. The value is set by DevEco Studio reading the stage of the SDK in use.| String| Yes (initial value: set by DevEco Studio)|
| multiProjects | Whether the application supports joint development of multiple projects. - **true**: The application supports joint development of multiple projects. - **false**: The application does not support joint development of multiple projects. For details about multi-project development, see [Multi-Project Build](https://developer.harmonyos.com/en/docs/documentation/doc-guides-V3/ohos-building-overview-0000001263360495-V3#section71471033104216).| Boolean| Yes (initial value: **false**)|
| assanEnabled | Whether to enable AddressSanitizer (ASan) to detect memory corruption issues such as buffer overflows. - **true**: ASan is enabled. - **false**: ASan is disabled. Note that ASan is not available in the Release version.| Boolean| Yes (initial value: **false**)|
-| tablet | Tablet-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes. When running on tablets, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
-| tv | TV-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes. When running on TVs, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
-| wearable | Wearable-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes. When running on wearables, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
-| car | Head unit–specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes. When running on head units, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
-| default | Default device–specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes. When running on default devices, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
+| tablet | Tablet-specific configuration, which includes the **minAPIVersion** attribute. When running on tablets, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
+| tv | TV-specific configuration, which includes the **minAPIVersion** attribute. When running on TVs, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
+| wearable | Wearable-specific configuration, which includes the **minAPIVersion** attribute. When running on wearables, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
+| car | Head unit–specific configuration, which includes the **minAPIVersion** attribute. When running on head units, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
+| default | Default device–specific configuration, which includes the **minAPIVersion** attribute. When running on default devices, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
|targetBundleName|Target application name of the bundle. The value rule and range are the same as those of **bundleName**.|String|Yes (if the initial value is used, the target application is not an application with the overlay feature)|
|targetPriority|Priority of the application. When **targetBundleName** is set, the application is an application with the overlay feature. The value ranges from 1 to 100.|Number|Yes (initial value: **1**)|
+|generateBuildHash |Whether the hash values of all HAP and HSP files of the application are generated by the packaging tool. The hash values (if any) are used to determine whether the application needs to be updated when the system is updated in OTA mode but the **versionCode** value of the application remains unchanged. If this tag is set to **true**, the packaging tool generates hash values for all HAP and HSP files of the application. **NOTE** This tag applies only to system applications.|Boolean|Yes (initial value: **false**)|
diff --git a/en/application-dev/quick-start/module-configuration-file.md b/en/application-dev/quick-start/module-configuration-file.md
index bc32e0296a9307c843be5093fed75af17700ab87..2d830a4b8318afdf61f4d9d7531e71a3a6420858 100644
--- a/en/application-dev/quick-start/module-configuration-file.md
+++ b/en/application-dev/quick-start/module-configuration-file.md
@@ -96,6 +96,7 @@ As shown above, the **module.json5** file contains several tags.
| targetPriority | Priority of the module. When **targetModuleName** is set, the module is a module with the overlay feature. The value ranges from 1 to 100.|Number|Yes (initial value: **1**)|
| [proxyDatas](#proxydatas) | List of data proxies provided by the module.| Object array| Yes (initial value: left empty)|
| isolationMode | Multi-process configuration of the module. The options are as follows: - **nonisolationFirst**: The module preferentially runs in a non-independent process. - **isolationFirst**: The module preferentially runs in an independent process. - **isolationOnly**: The module runs only in an independent process. - **nonisolationOnly**: The module runs only in non-independent processes.|String|Yes (initial value: **nonisolationFirst**)|
+| generateBuildHash |Whether the hash value of the HAP or HSP file is generated by the packaging tool. The hash value (if any) is used to determine whether the application needs to be updated when the system is updated in OTA mode but the **versionCode** value of the application remains unchanged. This tag is enabled only when the **generateBuildHash** tag in the [app.json5](./app-configuration-file.md) file is **false**. **NOTE** This tag applies only to system applications.|Boolean|Yes (initial value: **false**)|
## deviceTypes
diff --git a/en/application-dev/quick-start/module-structure.md b/en/application-dev/quick-start/module-structure.md
index a18a1eae33ac116e9bb829b2d30dc34e344b935f..2959e6a942a6236a1717d9f2ead60dc7f814e479 100644
--- a/en/application-dev/quick-start/module-structure.md
+++ b/en/application-dev/quick-start/module-structure.md
@@ -24,6 +24,7 @@ The **module** tag contains the HAP configuration.
|commonEvents | Information about the common event static subscriber, which must contain the subscriber name, required permissions, and list of the common events subscribed to. When a subscribed event is sent, the static subscriber is started. Unlike the dynamic subscriber, the static subscriber does not need to proactively call the common event subscription API in the service code, and may not be running when the common event is published.| Object array| Yes (initial value: left empty)|
| entryTheme | Keyword of an OpenHarmony internal theme. Set it to the resource index of the name.| String| Yes (initial value: left empty)|
|testRunner | Test runner configuration.| Object| Yes (initial value: left empty)|
+|generateBuildHash |Whether the hash value of the HAP or HSP file is generated by the packaging tool. The hash value (if any) is used to determine whether the application needs to be updated when the system is updated in OTA mode but the value of [code](#internal-structure-of-the-apiversion-attribute) in **version** of the application remains unchanged. **NOTE** This tag applies only to system applications.|Boolean|Yes (initial value: **false**)|
Example of the **module** tag structure:
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index d4984c913c6513270302417d873cf25d8ba2e60e..08f33bdb2bc12f0557e958ca75ee97f0441095f4 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -152,6 +152,7 @@
- bundleManager
- [abilityInfo](js-apis-bundleManager-abilityInfo.md)
- [applicationInfo](js-apis-bundleManager-applicationInfo.md)
+ - [AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)
- [bundleInfo](js-apis-bundleManager-bundleInfo.md)
- [BundlePackInfo](js-apis-bundleManager-BundlePackInfo.md)
- [dispatchInfo](js-apis-bundleManager-dispatchInfo.md)
@@ -166,6 +167,7 @@
- UI Page
- [@ohos.animator (Animator)](js-apis-animator.md)
+ - [@ohos.arkui.drawableDescriptor (DrawableDescriptor)](js-apis-arkui-drawableDescriptor.md)
- [@ohos.curves (Interpolation Calculation)](js-apis-curve.md)
- [@ohos.matrix4 (Matrix Transformation)](js-apis-matrix4.md)
- [@ohos.mediaquery (Media Query)](js-apis-mediaquery.md)
@@ -312,8 +314,6 @@
- [Timer](js-apis-timer.md)
- application
- [AccessibilityExtensionContext (Accessibility Extension Context)](js-apis-inner-application-accessibilityExtensionContext.md)
- - imf
- - [InputMethodCommon](js-apis-inputmethod-InputMethodCommon.md)
- Device Management
- [@ohos.batteryInfo (Battery Information)](js-apis-battery-info.md)
@@ -354,8 +354,8 @@
- Customization
- [@ohos.configPolicy (Configuration Policy)](js-apis-configPolicy.md)
- [@ohos.enterprise.accountManager (Account Management)](js-apis-enterprise-accountManager.md)
- - [@ohos.enterprise.bundleManager (Bundle Management)](js-apis-enterprise-bundleManager.md)
- [@ohos.enterprise.adminManager (Enterprise Device Management)](js-apis-enterprise-adminManager.md)
+ - [@ohos.enterprise.bundleManager (Bundle Management)](js-apis-enterprise-bundleManager.md)
- [@ohos.enterprise.dateTimeManager (System Time Management)](js-apis-enterprise-dateTimeManager.md)
- [@ohos.enterprise.deviceControl (Device Control Management)](js-apis-enterprise-deviceControl.md)
- [@ohos.enterprise.deviceInfo (Device Information Management)](js-apis-enterprise-deviceInfo.md)
diff --git a/en/application-dev/reference/apis/js-apis-audio.md b/en/application-dev/reference/apis/js-apis-audio.md
index 1b41dfffac05d2d5af6c7d080860f89bec12d762..83c2d59e857f73cf3b6573cbc2b96f8200c14e18 100644
--- a/en/application-dev/reference/apis/js-apis-audio.md
+++ b/en/application-dev/reference/apis/js-apis-audio.md
@@ -486,8 +486,8 @@ Enumerates the audio channels.
| Name | Value | Description |
| --------- | -------- | -------- |
-| CHANNEL_1 | 0x1 << 0 | Mono.|
-| CHANNEL_2 | 0x1 << 1 | Dual-channel.|
+| CHANNEL_1 | 0x1 << 0 | Channel 1. |
+| CHANNEL_2 | 0x1 << 1 | Channel 2. |
## AudioSamplingRate8+
diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-AppProvisionInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-AppProvisionInfo.md
new file mode 100644
index 0000000000000000000000000000000000000000..b2e9cd3663f9600c47bba775e6197dfa83371d1a
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-bundleManager-AppProvisionInfo.md
@@ -0,0 +1,36 @@
+# AppProvisionInfo
+
+The **AppProvisionInfo** module provides information in the [HarmonyAppProvision configuration file](../../security/app-provision-structure.md). The information can be obtained through [getAppProvisionInfo](js-apis-bundleManager.md#bundlemanagergetappprovisioninfo10).
+
+> **NOTE**
+> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## AppProvisionInfo
+
+**System capability**: SystemCapability.BundleManager.BundleFramework.Core
+
+**System API**: This is a system API.
+
+| Name | Type | Readable| Writable| Description |
+| ------------------------- | ------ | ---- | ---- | -------------------- |
+| versionCode | number | Yes | No | Version number of the configuration file.|
+| versionName | string | Yes | No | Version name of the configuration file. |
+| uuid | string | Yes | No | UUID in the configuration file.|
+| type | string | Yes | No | Type of the configuration file, which can be **debug** or **release**.|
+| appDistributionType | string | Yes | No | Distribution type in the configuration file, which can be **app_gallery**, **enterprise**, **os_integration**, or **crowdtesting**.|
+| validity | [Validity](#validity) | Yes | No | Validity period in the configuration file.|
+| developerId | string | Yes | No | Developer ID in the configuration file.|
+| certificate | string | Yes | No | Certificate public key in the configuration file.|
+| apl | string | Yes | No | APL in the configuration file, which can be **normal**, **system_basic**, or **system_core**.|
+| issuer | string | Yes | No | Issuer name in the configuration file.|
+
+## Validity
+
+**System capability**: SystemCapability.BundleManager.BundleFramework.Core
+
+**System API**: This is a system API.
+
+| Name | Type | Readable| Writable| Description |
+| ------------------------- | ------ | ---- | ---- | -------------------- |
+| notBefore | number | Yes | No | Earliest validity date of the configuration file.|
+| notAfter | number | Yes | No | Latest validity date of the configuration file.|
diff --git a/en/application-dev/reference/apis/js-apis-bundleManager.md b/en/application-dev/reference/apis/js-apis-bundleManager.md
index d5d0ff10e38e7597fdc1bed9d6a4a2a1627c5ade..7962d8ae77ab77dc1bba0d72b4418d3da2f867a2 100644
--- a/en/application-dev/reference/apis/js-apis-bundleManager.md
+++ b/en/application-dev/reference/apis/js-apis-bundleManager.md
@@ -401,7 +401,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------- |
| 17700001 | The specified bundleName is not found. |
-| 17700004 | The specified user ID is not found. |
| 17700026 | The specified bundle is disabled. |
**Example**
@@ -446,7 +445,7 @@ No permission is required for obtaining the caller's own information.
| ----------- | ------ | ---- | ---------------------------- |
| bundleName | string | Yes | Bundle name.|
| bundleFlags | [number](#bundleflag) | Yes | Type of the bundle information to obtain. |
-| userId | number | No | User ID. |
+| 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. |
**Return value**
@@ -587,7 +586,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | --------------------------------------|
| 17700001 | The specified bundleName is not found. |
-| 17700004 | The specified user ID is not found. |
| 17700026 | The specified bundle is disabled. |
**Example**
@@ -631,7 +629,7 @@ No permission is required for obtaining the caller's own information.
| ---------- | ------ | ---- | ---------------------------- |
| bundleName | string | Yes | Bundle name.|
| appFlags | [number](#applicationflag) | Yes | Type of the application information to obtain. |
-| userId | number | No | User ID.|
+| 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.|
**Return value**
@@ -737,14 +735,6 @@ Obtains the information about all bundles based on the given bundle flags. This
| bundleFlags | [number](#bundleflag) | Yes | Type of the bundle information to obtain. |
| callback | AsyncCallback> | Yes| Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of bundle information obtained. Otherwise, **err** is an error object.|
-**Error codes**
-
-For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
-
-| ID| Error Message |
-| -------- | ---------------------------------- |
-| 17700004 | The specified user ID is not found. |
-
**Example**
```ts
@@ -782,7 +772,7 @@ Obtains the information about all bundles based on the given bundle flags and us
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | -------------------------------------------------- |
| bundleFlags | [number](#bundleflag) | Yes | Type of the bundle information to obtain. |
-| userId | number | No | User ID. |
+| 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. |
**Return value**
@@ -884,14 +874,6 @@ Obtains the information about all applications based on the given application fl
| appFlags | [number](#applicationflag) | Yes | Type of the application information to obtain. |
| callback | AsyncCallback> | Yes| Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of application information obtained. Otherwise, **err** is an error object.|
-**Error codes**
-
-For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
-
-| ID| Error Message |
-| -------- | ---------------------------------- |
-| 17700004 | The specified user ID is not found. |
-
**Example**
```ts
@@ -929,7 +911,7 @@ Obtains the information about all applications based on the given application fl
| Name | Type | Mandatory| Description |
| -------- | ------ | ---- | ---------------------------------------------------------- |
| appFlags | [number](#applicationflag) | Yes | Type of the application information to obtain. |
-| userId | number | No | User ID. |
+| 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. |
**Return value**
@@ -1050,7 +1032,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| -------- | -------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700003 | The specified ability is not found. |
-| 17700004 | The specified userId is invalid. |
| 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. |
@@ -1096,7 +1077,7 @@ Obtains the ability information based on the given want, ability flags, and user
| ------------ | ------ | ---- | ------------------------------------------------------- |
| want | Want | Yes | Want containing the bundle name to query. |
| abilityFlags | [number](#abilityflag) | Yes | Type of the ability information to obtain.|
-| userId | number | No | User ID. |
+| 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. |
**Return value**
@@ -1247,7 +1228,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| -------- | -------------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700003 | The specified extensionAbility is not found. |
-| 17700004 | The specified userId is invalid. |
| 17700026 | The specified bundle is disabled. |
**Example**
@@ -1294,7 +1274,7 @@ Obtains the Extension ability information based on the given want, Extension abi
| want | Want | Yes | Want containing the bundle name to query. |
| extensionAbilityType | [ExtensionAbilityType](#extensionabilitytype) | Yes | Type of the Extension ability. |
| extensionAbilityFlags | [number](#extensionabilityflag) | Yes | Type of the Extension ability information to obtain.|
-| userId | number | No | User ID. |
+| 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. |
**Return value**
@@ -2171,7 +2151,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | --------------------------------------|
| 17700001 | The specified bundleName is not found. |
-| 17700004 | The specified user ID is not found. |
| 17700026 | The specified bundle is disabled. |
**Example**
@@ -2211,7 +2190,7 @@ Obtains the Want used to launch the bundle based on the given bundle name and us
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------------- |
| bundleName | string | Yes | Bundle name.|
-| userId | number | No | User ID. |
+| 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. |
**Return value**
@@ -2313,7 +2292,7 @@ Obtains the JSON strings of the configuration file based on the given module ame
| ------------ | ------ | ---- | -------------------------- |
| moduleName | string | Yes | Module name. |
| abilityName | string | Yes | Ability name. |
-| metadataName | string | No | Metadata name.|
+| metadataName | string | No | Metadata name. By default, no value is passed.|
**Return value**
@@ -2433,7 +2412,7 @@ Obtains the JSON strings of the configuration file based on the given module ame
| -------------------- | ------ | ---- | ---------------------------------- |
| moduleName | string | Yes | Module name. |
| extensionAbilityName | string | Yes | Extension ability name.|
-| metadataName | string | No | Metadata name. |
+| metadataName | string | No | Metadata name. By default, no value is passed. |
**Return value**
@@ -2948,7 +2927,7 @@ try {
### bundleManager.getSharedBundleInfo10+
-function getSharedBundleInfo(bundleName: string, moduleName: string): Promise\\>;
+getSharedBundleInfo(bundleName: string, moduleName: string): Promise\\>;
Obtains the shared bundle information based on the given bundle name. This API uses a promise to return the result.
@@ -3038,7 +3017,7 @@ try {
### bundleManager.getAllSharedBundleInfo10+
-function getAllSharedBundleInfo(): Promise\\>;
+getAllSharedBundleInfo(): Promise\\>;
Obtains the information about all shared bundles. This API uses a promise to return the result.
@@ -3186,7 +3165,7 @@ Obtains the provision configuration file information based on the given bundle n
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes| Bundle name.|
-| userId | number | No| User ID, which can be obtained by calling [getOsAccountLocalId](js-apis-osAccount.md#getosaccountlocalid9).|
+| 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. You can call [getOsAccountLocalId](js-apis-osAccount.md#getosaccountlocalid9) to obtain the user ID on the current device.|
**Return value**
@@ -3232,5 +3211,3 @@ try {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed. Cause: %{public}s', err.message);
}
```
-
-
\ No newline at end of file
diff --git a/en/application-dev/reference/apis/js-apis-sensor.md b/en/application-dev/reference/apis/js-apis-sensor.md
index 5d99ee002e6645ab65f503cac73f49d68dc2f8d5..f439302caddedbbffbe160778843db8e72a6a826 100644
--- a/en/application-dev/reference/apis/js-apis-sensor.md
+++ b/en/application-dev/reference/apis/js-apis-sensor.md
@@ -31,13 +31,13 @@ Subscribes to data of the acceleration sensor.
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | [SensorId](#sensorid9).ACCELEROMETER | Yes | Sensor type. The value is fixed at **SensorId.ACCELEROMETER**. |
| callback | Callback<[AccelerometerResponse](#accelerometerresponse)> | Yes | Callback used to report the sensor data, which is an **AccelerometerResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -49,7 +49,7 @@ try {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -71,13 +71,13 @@ Subscribes to data of the uncalibrated acceleration sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).ACCELEROMETER_UNCALIBRATED | Yes | Sensor type. The value is fixed at **SensorId.ACCELEROMETER_UNCALIBRATED**. |
| callback | Callback<[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)> | Yes | Callback used to report the sensor data, which is an **AccelerometerUncalibratedResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -92,7 +92,7 @@ try {
console.info('X-coordinate bias: ' + data.biasX);
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -112,13 +112,13 @@ Subscribes to data of the ambient light sensor.
| -------- | ----------------------------------------------- | ---- | --------------------------------------------------- |
| type | [SensorId](#sensorid9).AMBIENT_LIGHT | Yes | Sensor type. The value is fixed at **SensorId.AMBIENT_LIGHT**. |
| callback | Callback<[LightResponse](#lightresponse)> | Yes | Callback used to report the sensor data, which is a **LightResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -128,7 +128,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.AMBIENT_LIGHT, function (data) {
console.info('The ambient light intensity: ' + data.intensity);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -148,13 +148,13 @@ Subscribes to data of the ambient temperature sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).AMBIENT_TEMPERATURE | Yes | Sensor type. The value is fixed at **SensorId.AMBIENT_TEMPERATURE**. |
| callback | Callback<[AmbientTemperatureResponse](#ambienttemperatureresponse)> | Yes | Callback used to report the sensor data, which is an **AmbientTemperatureResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -164,7 +164,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.AMBIENT_TEMPERATURE, function (data) {
console.info('Temperature: ' + data.temperature);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -184,13 +184,13 @@ Subscribes to data of the barometer sensor.
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------- |
| type | [SensorId](#sensorid9).BAROMETER | Yes | Sensor type. The value is fixed at **SensorId.BAROMETER**. |
| callback | Callback<[BarometerResponse](#barometerresponse)> | Yes | Callback used to report the sensor data, which is a **BarometerResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -200,7 +200,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.BAROMETER, function (data) {
console.info('Atmospheric pressure: ' + data.pressure);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -220,13 +220,13 @@ Subscribes to data of the gravity sensor.
| -------- | --------------------------------------------------- | ---- | ----------------------------------------------------- |
| type | [SensorId](#sensorid9).GRAVITY | Yes | Sensor type. The value is fixed at **SensorId.GRAVITY**. |
| callback | Callback<[GravityResponse](#gravityresponse)> | Yes | Callback used to report the sensor data, which is a **GravityResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -238,7 +238,7 @@ try {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -260,13 +260,13 @@ Subscribes to data of the gyroscope sensor.
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------- |
| type | [SensorId](#sensorid9).GYROSCOPE | Yes | Sensor type. The value is fixed at **SensorId.GYROSCOPE**. |
| callback | Callback<[GyroscopeResponse](#gyroscoperesponse)> | Yes | Callback used to report the sensor data, which is a **GyroscopeResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -278,7 +278,7 @@ try {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -301,13 +301,13 @@ Subscribes to data of the uncalibrated gyroscope sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).GYROSCOPE_UNCALIBRATED | Yes | Sensor type. The value is fixed at **SensorId.GYROSCOPE_UNCALIBRATED**. |
| callback | Callback<[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)> | Yes | Callback used to report the sensor data, which is a **GyroscopeUncalibratedResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -322,7 +322,7 @@ try {
console.info('X-coordinate bias: ' + data.biasX);
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -342,13 +342,13 @@ Subscribes to data of the Hall effect sensor.
| -------- | --------------------------------------------- | ---- | -------------------------------------------------- |
| type | [SensorId](#sensorid9).HALL | Yes | Sensor type. The value is fixed at **SensorId.HALL**. |
| callback | Callback<[HallResponse](#hallresponse)> | Yes | Callback used to report the sensor data, which is a **HallResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -358,7 +358,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.HALL, function (data) {
console.info('Hall status: ' + data.status);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -380,13 +380,13 @@ Subscribes to data of the heart rate sensor.
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------- |
| type | [SensorId](#sensorid9).HEART_RATE | Yes | Sensor type. The value is fixed at **SensorId.HEART_RATE**. |
| callback | Callback<[HeartRateResponse](#heartrateresponse)> | Yes | Callback used to report the sensor data, which is a **HeartRateResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -396,7 +396,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.HEART_RATE, function (data) {
console.info('Heart rate: ' + data.heartRate);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -416,13 +416,13 @@ Subscribes to data of the humidity sensor.
| -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------ |
| type | [SensorId](#sensorid9).HUMIDITY | Yes | Sensor type. The value is fixed at **SensorId.HUMIDITY**. |
| callback | Callback<[HumidityResponse](#humidityresponse)> | Yes | Callback used to report the sensor data, which is a **HumidityResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -432,7 +432,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.HUMIDITY, function (data) {
console.info('Humidity: ' + data.humidity);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -455,13 +455,13 @@ Subscribes to data of the linear acceleration sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).LINEAR_ACCELEROMETER | Yes | Sensor type. The value is fixed at **SensorId.LINEAR_ACCELEROMETER**. |
| callback | Callback<[LinearAccelerometerResponse](#linearaccelerometerresponse)> | Yes | Callback used to report the sensor data, which is a **LinearAccelerometerResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -473,7 +473,7 @@ try {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -493,13 +493,13 @@ Subscribes to data of the magnetic field sensor.
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | [SensorId](#sensorid9).MAGNETIC_FIELD | Yes | Sensor type. The value is fixed at **SensorId.MAGNETIC_FIELD**. |
| callback | Callback<[MagneticFieldResponse](#magneticfieldresponse)> | Yes | Callback used to report the sensor data, which is a **MagneticFieldResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -511,7 +511,7 @@ try {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -531,13 +531,13 @@ Subscribes to data of the uncalibrated magnetic field sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).MAGNETIC_FIELD_UNCALIBRATED | Yes | Sensor type. The value is fixed at **SensorId.MAGNETIC_FIELD_UNCALIBRATED**.|
| callback | Callback<[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)> | Yes | Callback used to report the sensor data, which is a **MagneticFieldUncalibratedResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -552,7 +552,7 @@ try {
console.info('X-coordinate bias: ' + data.biasX);
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -570,7 +570,7 @@ Subscribes to data of the orientation sensor.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -580,7 +580,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
| -------- | ----------------------------------------------------------- | ---- | --------------------------------------------------------- |
| type | [SensorId](#sensorid9).ORIENTATION | Yes | Sensor type. The value is fixed at **SensorId.ORIENTATION**. |
| callback | Callback<[OrientationResponse](#orientationresponse)> | Yes | Callback used to report the sensor data, which is a **OrientationResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -590,7 +590,7 @@ try {
console.info('The device rotates at an angle around the Z axis: ' + data.alpha);
console.info('The device rotates at an angle around the X axis: ' + data.beta);
console.info('The device rotates at an angle around the Y axis: ' + data.gamma);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -610,7 +610,7 @@ Subscribes to data of the pedometer sensor.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -620,7 +620,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------- |
| type | [SensorId](#sensorid9).PEDOMETER | Yes | Sensor type. The value is fixed at **SensorId.PEDOMETER**. |
| callback | Callback<[PedometerResponse](#pedometerresponse)> | Yes | Callback used to report the sensor data, which is a **PedometerResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -628,7 +628,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.PEDOMETER, function (data) {
console.info('Step count: ' + data.steps);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -651,13 +651,13 @@ Subscribes to data of the pedometer detection sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).PEDOMETER_DETECTION | Yes | Sensor type. The value is fixed at **SensorId.PEDOMETER_DETECTION**. |
| callback | Callback<[PedometerDetectionResponse](#pedometerdetectionresponse)> | Yes | Callback used to report the sensor data, which is a **PedometerDetectionResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -667,7 +667,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.PEDOMETER_DETECTION, function (data) {
console.info('Pedometer scalar: ' + data.scalar);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -687,13 +687,13 @@ Subscribes to data of the proximity sensor.
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------- |
| type | [SensorId](#sensorid9).PROXIMITY | Yes | Sensor type. The value is fixed at **SensorId.PROXIMITY**. |
| callback | Callback<[ProximityResponse](#proximityresponse)> | Yes | Callback used to report the sensor data, which is a **ProximityResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -703,7 +703,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.PROXIMITY, function (data) {
console.info('Distance: ' + data.distance);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -724,13 +724,13 @@ Subscribes to data of the rotation vector sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).ROTATION_VECTOR | Yes | Sensor type. The value is fixed at **SensorId.ROTATION_VECTOR**. |
| callback | Callback<[RotationVectorResponse](#rotationvectorresponse)> | Yes | Callback used to report the sensor data, which is a **RotationVectorResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -743,7 +743,7 @@ try {
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Scalar quantity: ' + data.w);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -764,13 +764,13 @@ Subscribes to data of the significant motion sensor.
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | [SensorId](#sensorid9).SIGNIFICANT_MOTION | Yes | Sensor type. The value is fixed at **SensorId.SIGNIFICANT_MOTION**. |
| callback | Callback<[SignificantMotionResponse](#significantmotionresponse)> | Yes | Callback used to report the sensor data, which is a **SignificantMotionResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -780,7 +780,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.SIGNIFICANT_MOTION, function (data) {
console.info('Scalar data: ' + data.scalar);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -801,13 +801,13 @@ Subscribes to data of the wear detection sensor.
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | [SensorId](#sensorid9).WEAR_DETECTION | Yes | Sensor type. The value is fixed at **SensorId.WEAR_DETECTION**. |
| callback | Callback<[WearDetectionResponse](#weardetectionresponse)> | Yes | Callback used to report the sensor data, which is a **WearDetectionResponse** object.|
-| options | [Options](#options) | No | Data reporting frequency. The default value is 200,000,000 ns. |
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Error code**
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -817,7 +817,7 @@ For details about the following error codes, see [Sensor Error Codes](../errorco
try {
sensor.on(sensor.SensorId.WEAR_DETECTION, function (data) {
console.info('Wear status: ' + data.value);
- }, { interval: 10000000 });
+ }, { interval: 100000000 });
} catch (err) {
console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message);
}
@@ -846,7 +846,7 @@ Obtains data of the acceleration sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -885,7 +885,7 @@ Obtains data of the uncalibrated acceleration sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -925,7 +925,7 @@ Obtains data of the ambient light sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -960,7 +960,7 @@ Obtains data of the temperature sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -995,7 +995,7 @@ Obtains data of the barometer sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1030,7 +1030,7 @@ Obtains data of the gravity sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1069,7 +1069,7 @@ Obtains to data of the gyroscope sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1108,7 +1108,7 @@ Obtains data of the uncalibrated gyroscope sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1148,7 +1148,7 @@ Obtains data of the Hall effect sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1185,7 +1185,7 @@ Obtains data of the heart rate sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1220,7 +1220,7 @@ Obtains data of the humidity sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1257,7 +1257,7 @@ Obtains data of the linear acceleration sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1294,7 +1294,7 @@ Obtains data of the magnetic field sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1331,7 +1331,7 @@ Obtains data of the uncalibrated magnetic field sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1371,7 +1371,7 @@ Obtains data of the orientation sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1410,7 +1410,7 @@ Obtains data of the pedometer sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1447,7 +1447,7 @@ Obtains data of the pedometer sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1482,7 +1482,7 @@ Obtains data of the proximity sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1517,7 +1517,7 @@ Obtains data of the rotation vector sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1555,7 +1555,7 @@ Obtains data of the significant motion sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -1590,7 +1590,7 @@ Obtains data of the wear detection sensor once.
For details about the following error codes, see [Sensor Error Codes](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2400,7 +2400,7 @@ Obtains the geomagnetic field of a geographic location at a certain time. This A
For details about the following error codes, see [Error Codes of sensor.getGeomagneticInfo](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2451,7 +2451,7 @@ Obtains the geomagnetic field of a geographic location at a certain time. This A
For details about the following error codes, see [Error Codes of sensor.getGeomagneticInfo](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2496,7 +2496,7 @@ Obtains the altitude based on the atmospheric pressure. This API uses an asynchr
For details about the following error codes, see [Error Codes of sensor.getDeviceAltitude](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2543,7 +2543,7 @@ Obtains the altitude based on the atmospheric pressure. This API uses a promise
For details about the following error codes, see [Error Codes of sensor.getDeviceAltitude](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2583,7 +2583,7 @@ Obtains the magnetic dip based on the inclination matrix. This API uses an async
For details about the following error codes, see [Error Codes of sensor.getInclination](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2633,7 +2633,7 @@ Obtains the magnetic dip based on the inclination matrix. This API uses a promis
For details about the following error codes, see [Error Codes of sensor.getInclination](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2679,7 +2679,7 @@ Obtains the angle change between two rotation matrices. This API uses an asynchr
For details about the following error codes, see [Error Codes of sensor.getAngleVariation](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2740,7 +2740,7 @@ Obtains the angle change between two rotation matrices. This API uses a promise
For details about the following error codes, see [Error Codes of sensor.getAngleVariation](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2794,7 +2794,7 @@ Obtains the rotation matrix from a rotation vector. This API uses an asynchronou
For details about the following error codes, see [Error Codes of sensor.getRotationMatrix](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2841,7 +2841,7 @@ Obtains the rotation matrix from a rotation vector. This API uses a promise to r
For details about the following error codes, see [Error Codes of sensor.getRotationMatrix](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2880,11 +2880,11 @@ Transforms a rotation vector based on the coordinate system. This API uses an as
| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Rotation vector to transform. |
| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation vector after being transformed.|
-**Error code**
+**Error codes**
For details about the following error codes, see [Error Codes of sensor.transformRotationMatrix](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2936,7 +2936,7 @@ Transforms a rotation vector based on the coordinate system. This API uses a pro
For details about the following error codes, see [Error Codes of sensor.transformRotationMatrix](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -2981,7 +2981,7 @@ Obtains the quaternion from a rotation vector. This API uses an asynchronous cal
For details about the following error codes, see [Error Codes of sensor.getQuaternion](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3028,7 +3028,7 @@ Obtains the quaternion from a rotation vector. This API uses a promise to return
For details about the following error codes, see [Error Codes of sensor.getQuaternion](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3069,7 +3069,7 @@ Obtains the device direction based on the rotation matrix. This API uses an asyn
For details about the following error codes, see [Error Codes of sensor.getOrientation](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3123,7 +3123,7 @@ Obtains the device direction based on the rotation matrix. This API uses a promi
For details about the following error codes, see [Error Codes of sensor.getOrientation](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3169,7 +3169,7 @@ Obtains the rotation matrix based on a gravity vector and geomagnetic vector. Th
For details about the following error codes, see [Error Codes of sensor.getRotationMatrix](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3216,7 +3216,7 @@ Obtains the rotation matrix based on a gravity vector and geomagnetic vector. Th
For details about the following error codes, see [Error Codes of sensor.getRotationMatrix](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3255,7 +3255,7 @@ Obtains information about all sensors on the device. This API uses an asynchrono
For details about the following error codes, see [Error Codes of sensor.getSensorList](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3295,7 +3295,7 @@ Obtains information about all sensors on the device. This API uses a promise to
For details about the following error codes, see [Error Codes of sensor.getSensorList](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3334,7 +3334,7 @@ Obtains information about the sensor of a specific type. This API uses an asynch
For details about the following error codes, see [Error Codes of sensor.getSingleSensor](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3378,7 +3378,7 @@ Obtains information about the sensor of a specific type. This API uses a promise
For details about the following error codes, see [Error Codes of sensor.getSingleSensor](../errorcodes/errorcode-sensor.md).
-| Error Code ID| Error Message |
+| ID| Error Message |
| -------- | ------------------ |
| 14500101 | Service exception. |
@@ -3847,11 +3847,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AC
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**. |
-| callback | Callback<[AccelerometerResponse](#accelerometerresponse)> | Yes | Callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**. |
+| callback | Callback<[AccelerometerResponse](#accelerometerresponse)> | Yes | Callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -3861,7 +3861,7 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AC
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -3879,11 +3879,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.LI
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_LINEAR_ACCELERATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**. |
-| callback | Callback<[LinearAccelerometerResponse](#linearaccelerometerresponse)> | Yes | Callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_LINEAR_ACCELERATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.|
+| callback | Callback<[LinearAccelerometerResponse](#linearaccelerometerresponse)> | Yes | Callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
### ACCELEROMETER_UNCALIBRATED(deprecated)
@@ -3899,14 +3899,13 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AC
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**. |
-| callback | Callback<[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)> | Yes | Callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.|
+| callback | Callback<[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)> | Yes | Callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,function(data){
console.info('X-coordinate component: ' + data.x);
@@ -3916,7 +3915,7 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AC
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -3932,11 +3931,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.GR
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GRAVITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**. |
-| callback | Callback<[GravityResponse](#gravityresponse)> | Yes | Callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------------------- | ---- | ----------------------------------------------------------- |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GRAVITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**. |
+| callback | Callback<[GravityResponse](#gravityresponse)> | Yes | Callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -3946,7 +3945,7 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.GR
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -3964,21 +3963,20 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.GY
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
-| callback | Callback<[GyroscopeResponse](#gyroscoperesponse)> | Yes | Callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
+| callback | Callback<[GyroscopeResponse](#gyroscoperesponse)> | Yes | Callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE,function(data){
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -3996,14 +3994,13 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.GY
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**. |
-| callback | Callback<[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)> | Yes | Callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.|
+| callback | Callback<[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)> | Yes | Callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,function(data){
console.info('X-coordinate component: ' + data.x);
@@ -4013,7 +4010,7 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.GY
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -4029,19 +4026,18 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.SI
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_SIGNIFICANT_MOTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**. |
-| callback | Callback<[SignificantMotionResponse](#significantmotionresponse)> | Yes | Callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_SIGNIFICANT_MOTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.|
+| callback | Callback<[SignificantMotionResponse](#significantmotionresponse)> | Yes | Callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,function(data){
console.info('Scalar data: ' + data.scalar);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -4059,19 +4055,18 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.PE
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**. |
-| callback | Callback<[PedometerDetectionResponse](#pedometerdetectionresponse)> | Yes | Callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.|
+| callback | Callback<[PedometerDetectionResponse](#pedometerdetectionresponse)> | Yes | Callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,function(data){
console.info('Scalar data: ' + data.scalar);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -4089,19 +4084,18 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.PE
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**. |
-| callback | Callback<[PedometerResponse](#pedometerresponse)> | Yes | Callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**. |
+| callback | Callback<[PedometerResponse](#pedometerresponse)> | Yes | Callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER,function(data){
console.info('Steps: ' + data.steps);
},
- {interval: 10000000}
+ {interval: 100000000}
);
```
@@ -4117,11 +4111,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AM
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**. |
-| callback | Callback<[AmbientTemperatureResponse](#ambienttemperatureresponse)> | Yes | Callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.|
+| callback | Callback<[AmbientTemperatureResponse](#ambienttemperatureresponse)> | Yes | Callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -4129,9 +4123,8 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AM
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,function(data){
console.info('Temperature: ' + data.temperature);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### MAGNETIC_FIELD(deprecated)
@@ -4146,11 +4139,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.MA
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. |
-| callback | Callback<[MagneticFieldResponse](#magneticfieldresponse)> | Yes | Callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. |
+| callback | Callback<[MagneticFieldResponse](#magneticfieldresponse)> | Yes | Callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -4160,9 +4153,8 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.MA
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### MAGNETIC_FIELD_UNCALIBRATED(deprecated)
@@ -4177,14 +4169,13 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.MA
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**. |
-| callback | Callback<[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)> | Yes | Callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.|
+| callback | Callback<[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)> | Yes | Callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,function(data){
console.info('X-coordinate component: ' + data.x);
@@ -4194,9 +4185,8 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.MA
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### PROXIMITY(deprecated)
@@ -4211,21 +4201,19 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.PR
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PROXIMITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**. |
-| callback | Callback<[ProximityResponse](#proximityresponse)> | Yes | Callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PROXIMITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**. |
+| callback | Callback<[ProximityResponse](#proximityresponse)> | Yes | Callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY,function(data){
console.info('Distance: ' + data.distance);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### HUMIDITY(deprecated)
@@ -4240,11 +4228,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.HU
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ----------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HUMIDITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**. |
-| callback | Callback<[HumidityResponse](#humidityresponse)> | Yes | Callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HUMIDITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**. |
+| callback | Callback<[HumidityResponse](#humidityresponse)> | Yes | Callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -4252,9 +4240,8 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.HU
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY,function(data){
console.info('Humidity: ' + data.humidity);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### BAROMETER(deprecated)
@@ -4269,11 +4256,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.BA
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_BAROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**. |
-| callback | Callback<[BarometerResponse](#barometerresponse)> | Yes | Callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_BAROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**. |
+| callback | Callback<[BarometerResponse](#barometerresponse)> | Yes | Callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -4281,9 +4268,8 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.BA
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER,function(data){
console.info('Atmospheric pressure: ' + data.pressure);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### HALL(deprecated)
@@ -4298,21 +4284,19 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.HA
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HALL | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**. |
-| callback | Callback<[HallResponse](#hallresponse)> | Yes | Callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HALL | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**. |
+| callback | Callback<[HallResponse](#hallresponse)> | Yes | Callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL,function(data){
console.info('Status: ' + data.status);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### AMBIENT_LIGHT(deprecated)
@@ -4327,11 +4311,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AM
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_LIGHT | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**. |
-| callback | Callback<[LightResponse](#lightresponse)> | Yes | Callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------ | ---- | ----------------------------------------------------------- |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_LIGHT | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**. |
+| callback | Callback<[LightResponse](#lightresponse)> | Yes | Callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
@@ -4339,9 +4323,8 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.AM
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT,function(data){
console.info(' Illumination: ' + data.intensity);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### ORIENTATION(deprecated)
@@ -4356,30 +4339,28 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.OR
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ----------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ORIENTATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**. |
-| callback | Callback<[OrientationResponse](#orientationresponse)> | Yes | Callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ORIENTATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**. |
+| callback | Callback<[OrientationResponse](#orientationresponse)> | Yes | Callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION,function(data){
console.info('The device rotates at an angle around the X axis: ' + data.beta);
console.info('The device rotates at an angle around the Y axis: ' + data.gamma);
console.info('The device rotates at an angle around the Z axis: ' + data.alpha);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### HEART_RATE(deprecated)
on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback<HeartRateResponse>, options?: Options): void
-Subscribes to only one data change of the heart rate sensor.
+Subscribes to data changes of the heart rate sensor. If this API is called multiple times for the same application, the last call takes effect.
This API is deprecated since API version 9. You are advised to use [sensor.on.HEART_RATE](#heart_rate9) instead.
@@ -4389,10 +4370,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.HE
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HEART_RATE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**. |
-| callback | Callback<[HeartRateResponse](#heartrateresponse)> | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HEART_RATE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**. |
+| callback | Callback<[HeartRateResponse](#heartrateresponse)> | Yes | Callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
### ROTATION_VECTOR(deprecated)
@@ -4406,14 +4388,13 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.RO
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ROTATION_VECTOR | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**. |
-| callback | Callback<[RotationVectorResponse](#rotationvectorresponse)> | Yes | Callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ROTATION_VECTOR | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.|
+| callback | Callback<[RotationVectorResponse](#rotationvectorresponse)> | Yes | Callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,function(data){
console.info('X-coordinate component: ' + data.x);
@@ -4421,9 +4402,8 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.RO
console.info('Z-coordinate component: ' + data.z);
console.info('Scalar quantity: ' + data.w);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
### WEAR_DETECTION(deprecated)
@@ -4438,21 +4418,19 @@ This API is deprecated since API version 9. You are advised to use [sensor.on.WE
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_WEAR_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**. |
-| callback | Callback<[WearDetectionResponse](#weardetectionresponse)> | Yes | Callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**. |
-| options | [Options](#options) | No | Interval at which the callback is invoked to return the sensor data. The default value is 200,000,000 ns. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_WEAR_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**. |
+| callback | Callback<[WearDetectionResponse](#weardetectionresponse)> | Yes | Callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.|
+| options | [Options](#options) | No | List of optional parameters. Currently, this parameter can be used to set the data reporting frequency. The default value is 200,000,000 ns. |
**Example**
-
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION,function(data){
console.info('Wear status: ' + data.value);
},
- {interval: 10000000}
+ {interval: 100000000}
);
-
```
## sensor.once(deprecated)
@@ -4471,13 +4449,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**. |
-| callback | Callback<[AccelerometerResponse](#accelerometerresponse)> | Yes | One-shot callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER**. |
+| callback | Callback<[AccelerometerResponse](#accelerometerresponse)> | Yes | One-shot callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(data){
console.info('X-coordinate component: ' + data.x);
@@ -4485,7 +4462,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Z-coordinate component: ' + data.z);
}
);
-
```
### LINEAR_ACCELERATION(deprecated)
@@ -4502,10 +4478,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_LINEAR_ACCELERATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**. |
-| callback | Callback<[LinearAccelerometerResponse](#linearaccelerometerresponse)> | Yes | One-shot callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_LINEAR_ACCELERATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**. |
+| callback | Callback<[LinearAccelerometerResponse](#linearaccelerometerresponse)> | Yes | One-shot callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**.|
### ACCELEROMETER_UNCALIBRATED(deprecated)
@@ -4521,13 +4497,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**. |
-| callback | Callback<[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)> | Yes | One-shot callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.|
+| callback | Callback<[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)> | Yes | One-shot callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**.|
**Example**
-
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, function(data) {
console.info('X-coordinate component: ' + data.x);
@@ -4538,7 +4513,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Z-coordinate bias: ' + data.biasZ);
}
);
-
```
### GRAVITY(deprecated)
@@ -4553,13 +4527,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GRAVITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**. |
-| callback | Callback<[GravityResponse](#gravityresponse)> | Yes | One-shot callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GRAVITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GRAVITY**. |
+| callback | Callback<[GravityResponse](#gravityresponse)> | Yes | One-shot callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, function(data) {
console.info('X-coordinate component: ' + data.x);
@@ -4567,7 +4540,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Z-coordinate component: ' + data.z);
}
);
-
```
### GYROSCOPE(deprecated)
@@ -4584,13 +4556,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
-| callback | Callback<[GyroscopeResponse](#gyroscoperesponse)> | Yes | One-shot callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
+| callback | Callback<[GyroscopeResponse](#gyroscoperesponse)> | Yes | One-shot callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, function(data) {
console.info('X-coordinate component: ' + data.x);
@@ -4598,7 +4569,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Z-coordinate component: ' + data.z);
}
);
-
```
### GYROSCOPE_UNCALIBRATED(deprecated)
@@ -4615,13 +4585,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**. |
-| callback | Callback<[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)> | Yes | One-shot callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.|
+| callback | Callback<[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)> | Yes | One-shot callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, function(data) {
console.info('X-coordinate component: ' + data.x);
@@ -4632,7 +4601,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Z-coordinate bias: ' + data.biasZ);
}
);
-
```
### SIGNIFICANT_MOTION(deprecated)
@@ -4647,19 +4615,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_SIGNIFICANT_MOTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**. |
-| callback | Callback<[SignificantMotionResponse](#significantmotionresponse)> | Yes | One-shot callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_SIGNIFICANT_MOTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**. |
+| callback | Callback<[SignificantMotionResponse](#significantmotionresponse)> | Yes | One-shot callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, function(data) {
console.info('Scalar data: ' + data.scalar);
}
);
-
```
### PEDOMETER_DETECTION(deprecated)
@@ -4676,19 +4642,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**. |
-| callback | Callback<[PedometerDetectionResponse](#pedometerdetectionresponse)> | Yes | One-shot callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**. |
+| callback | Callback<[PedometerDetectionResponse](#pedometerdetectionresponse)> | Yes | One-shot callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, function(data) {
console.info('Scalar data: ' + data.scalar);
}
);
-
```
### PEDOMETER(deprecated)
@@ -4705,19 +4669,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**. |
-| callback | Callback<[PedometerResponse](#pedometerresponse)> | Yes | One-shot callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PEDOMETER**. |
+| callback | Callback<[PedometerResponse](#pedometerresponse)> | Yes | One-shot callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, function(data) {
console.info('Steps: ' + data.steps);
}
);
-
```
### AMBIENT_TEMPERATURE(deprecated)
@@ -4732,19 +4694,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**. |
-| callback | Callback<[AmbientTemperatureResponse](#ambienttemperatureresponse)> | Yes | One-shot callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**. |
+| callback | Callback<[AmbientTemperatureResponse](#ambienttemperatureresponse)> | Yes | One-shot callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, function(data) {
console.info('Temperature: ' + data.temperature);
}
);
-
```
### MAGNETIC_FIELD(deprecated)
@@ -4759,13 +4719,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. |
-| callback | Callback<[MagneticFieldResponse](#magneticfieldresponse)> | Yes | One-shot callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. |
+| callback | Callback<[MagneticFieldResponse](#magneticfieldresponse)> | Yes | One-shot callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, function(data) {
console.info('X-coordinate component: ' + data.x);
@@ -4773,7 +4732,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Z-coordinate component: ' + data.z);
}
);
-
```
### MAGNETIC_FIELD_UNCALIBRATED(deprecated)
@@ -4788,13 +4746,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**. |
-| callback | Callback<[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)> | Yes | One-shot callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.|
+| callback | Callback<[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)> | Yes | One-shot callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, function(data) {
console.info('X-coordinate component: ' + data.x);
@@ -4805,7 +4762,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Z-coordinate bias: ' + data.biasZ);
}
);
-
```
### PROXIMITY(deprecated)
@@ -4820,19 +4776,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PROXIMITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**. |
-| callback | Callback<[ProximityResponse](#proximityresponse)> | Yes | One-shot callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PROXIMITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_PROXIMITY**. |
+| callback | Callback<[ProximityResponse](#proximityresponse)> | Yes | One-shot callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, function(data) {
console.info('Distance: ' + data.distance);
}
);
-
```
### HUMIDITY(deprecated)
@@ -4847,19 +4801,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ----------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HUMIDITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**. |
-| callback | Callback<[HumidityResponse](#humidityresponse)> | Yes | One-shot callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HUMIDITY | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HUMIDITY**. |
+| callback | Callback<[HumidityResponse](#humidityresponse)> | Yes | One-shot callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, function(data) {
console.info('Humidity: ' + data.humidity);
}
);
-
```
### BAROMETER(deprecated)
@@ -4874,19 +4826,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_BAROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**. |
-| callback | Callback<[BarometerResponse](#barometerresponse)> | Yes | One-shot callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_BAROMETER | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_BAROMETER**. |
+| callback | Callback<[BarometerResponse](#barometerresponse)> | Yes | One-shot callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, function(data) {
console.info('Atmospheric pressure: ' + data.pressure);
}
);
-
```
### HALL(deprecated)
@@ -4901,19 +4851,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HALL | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**. |
-| callback | Callback<[HallResponse](#hallresponse)> | Yes | One-shot callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HALL | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HALL**. |
+| callback | Callback<[HallResponse](#hallresponse)> | Yes | One-shot callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HALL, function(data) {
console.info('Status: ' + data.status);
}
);
-
```
### AMBIENT_LIGHT(deprecated)
@@ -4928,10 +4876,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_LIGHT | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**. |
-| callback | Callback<[LightResponse](#lightresponse)> | Yes | One-shot callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_LIGHT | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**. |
+| callback | Callback<[LightResponse](#lightresponse)> | Yes | One-shot callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**.|
**Example**
@@ -4940,7 +4888,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info(' Illumination: ' + data.intensity);
}
);
-
```
### ORIENTATION(deprecated)
@@ -4955,13 +4902,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ----------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ORIENTATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**. |
-| callback | Callback<[OrientationResponse](#orientationresponse)> | Yes | One-shot callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ORIENTATION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ORIENTATION**. |
+| callback | Callback<[OrientationResponse](#orientationresponse)> | Yes | One-shot callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, function(data) {
console.info('The device rotates at an angle around the X axis: ' + data.beta);
@@ -4969,7 +4915,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('The device rotates at an angle around the Z axis: ' + data.alpha);
}
);
-
```
### ROTATION_VECTOR(deprecated)
@@ -4984,13 +4929,12 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ROTATION_VECTOR | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**. |
-| callback | Callback<[RotationVectorResponse](#rotationvectorresponse)> | Yes | One-shot callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ROTATION_VECTOR | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**. |
+| callback | Callback<[RotationVectorResponse](#rotationvectorresponse)> | Yes | One-shot callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, function(data) {
console.info('X-coordinate component: ' + data.x);
@@ -4999,7 +4943,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
console.info('Scalar quantity: ' + data.w);
}
);
-
```
### HEART_RATE(deprecated)
@@ -5016,10 +4959,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HEART_RATE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**. |
-| callback | Callback<[HeartRateResponse](#heartrateresponse)> | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HEART_RATE | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_HEART_RATE**. |
+| callback | Callback<[HeartRateResponse](#heartrateresponse)> | Yes | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**.|
### WEAR_DETECTION(deprecated)
@@ -5033,19 +4976,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.once.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_WEAR_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**. |
-| callback | Callback<[WearDetectionResponse](#weardetectionresponse)> | Yes | One-shot callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_WEAR_DETECTION | Yes | Type of the sensor to subscribe to, which is **SENSOR_TYPE_ID_WEAR_DETECTION**. |
+| callback | Callback<[WearDetectionResponse](#weardetectionresponse)> | Yes | One-shot callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**.|
**Example**
-
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, function(data) {
console.info("Wear status: "+ data.value);
}
);
-
```
## sensor.off(deprecated)
@@ -5064,10 +5005,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.A
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER**. |
-| callback | Callback<[AccelerometerResponse](#accelerometerresponse)> | No | Callback used to return the acceleration sensor data. The reported data type in the callback is **AccelerometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER**.|
+| callback | Callback<[AccelerometerResponse](#accelerometerresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5078,7 +5019,6 @@ function callback(data) {
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback);
-
```
### ACCELEROMETER_UNCALIBRATED(deprecated)
@@ -5095,10 +5035,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.A
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**. |
-| callback | Callback<[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)> | No | Callback used to return the uncalibrated acceleration sensor data. The reported data type in the callback is **AccelerometerUncalibratedResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED**.|
+| callback | Callback<[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5112,7 +5052,6 @@ function callback(data) {
console.info('Z-coordinate bias: ' + data.biasZ);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback);
-
```
### AMBIENT_LIGHT(deprecated)
@@ -5127,10 +5066,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.A
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_LIGHT | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**. |
-| callback | Callback<[LightResponse](#lightresponse)> | No | Callback used to return the ambient light sensor data. The reported data type in the callback is **LightResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_LIGHT | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_LIGHT**.|
+| callback | Callback<[LightResponse](#lightresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5139,7 +5078,6 @@ function callback(data) {
console.info(' Illumination: ' + data.intensity);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback);
-
```
### AMBIENT_TEMPERATURE(deprecated)
@@ -5154,10 +5092,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.A
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**. |
-| callback | Callback<[AmbientTemperatureResponse](#ambienttemperatureresponse)> | No | Callback used to return the ambient temperature sensor data. The reported data type in the callback is **AmbientTemperatureResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_AMBIENT_TEMPERATURE**.|
+| callback | Callback<[AmbientTemperatureResponse](#ambienttemperatureresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5166,7 +5104,6 @@ function callback(data) {
console.info('Temperature: ' + data.temperature);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback);
-
```
### BAROMETER(deprecated)
@@ -5181,10 +5118,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.B
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_BAROMETER | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_BAROMETER**. |
-| callback | Callback<[BarometerResponse](#barometerresponse)> | No | Callback used to return the barometer sensor data. The reported data type in the callback is **BarometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_BAROMETER | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_BAROMETER**. |
+| callback | Callback<[BarometerResponse](#barometerresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5193,7 +5130,6 @@ function callback(data) {
console.info('Atmospheric pressure: ' + data.pressure);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback);
-
```
### GRAVITY(deprecated)
@@ -5208,10 +5144,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.G
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GRAVITY | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GRAVITY**. |
-| callback | Callback<[GravityResponse](#gravityresponse)> | No | Callback used to return the gravity sensor data. The reported data type in the callback is **GravityResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GRAVITY | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GRAVITY**. |
+| callback | Callback<[GravityResponse](#gravityresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5222,7 +5158,6 @@ function callback(data) {
console.info('Z-coordinate component: ' + data.z);
}
sensor.off( sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
-
```
### GYROSCOPE(deprecated)
@@ -5239,10 +5174,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.G
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
-| callback | Callback<[GyroscopeResponse](#gyroscoperesponse)> | No | Callback used to return the gyroscope sensor data. The reported data type in the callback is **GyroscopeResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE**. |
+| callback | Callback<[GyroscopeResponse](#gyroscoperesponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5253,7 +5188,6 @@ function callback(data) {
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback);
-
```
### GYROSCOPE_UNCALIBRATED(deprecated)
@@ -5270,10 +5204,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.G
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**. |
-| callback | Callback<[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)> | No | Callback used to return the uncalibrated gyroscope sensor data. The reported data type in the callback is **GyroscopeUncalibratedResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED**.|
+| callback | Callback<[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5284,7 +5218,6 @@ function callback(data) {
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback);
-
```
### HALL(deprecated)
@@ -5299,10 +5232,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.H
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HALL | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HALL**. |
-| callback | Callback<[HallResponse](#hallresponse)> | No | Callback used to return the Hall effect sensor data. The reported data type in the callback is **HallResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HALL | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HALL**. |
+| callback | Callback<[HallResponse](#hallresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5311,7 +5244,6 @@ function callback(data) {
console.info('Status: ' + data.status);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL, callback);
-
```
### HEART_RATE(deprecated)
@@ -5328,10 +5260,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.H
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HEART_RATE | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HEART_RATE**. |
-| callback | Callback<[HeartRateResponse](#heartrateresponse)> | No | One-shot callback used to return the heart rate sensor data. The reported data type in the callback is **HeartRateResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HEART_RATE | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HEART_RATE**. |
+| callback | Callback<[HeartRateResponse](#heartrateresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
### HUMIDITY(deprecated)
@@ -5345,10 +5277,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.H
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ----------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HUMIDITY | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HUMIDITY**. |
-| callback | Callback<[HumidityResponse](#humidityresponse)> | No | Callback used to return the humidity sensor data. The reported data type in the callback is **HumidityResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_HUMIDITY | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_HUMIDITY**. |
+| callback | Callback<[HumidityResponse](#humidityresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5357,7 +5289,6 @@ function callback(data) {
console.info('Humidity: ' + data.humidity);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback);
-
```
### LINEAR_ACCELERATION(deprecated)
@@ -5374,10 +5305,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.L
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_LINEAR_ACCELERATION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**. |
-| callback | Callback<[LinearAccelerometerResponse](#linearaccelerometerresponse)> | No | Callback used to return the linear acceleration sensor data. The reported data type in the callback is **LinearAccelerometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_LINEAR_ACCELERATION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_LINEAR_ACCELERATION**.|
+| callback | Callback<[LinearAccelerometerResponse](#linearaccelerometerresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
### MAGNETIC_FIELD(deprecated)
@@ -5391,10 +5322,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.M
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. |
-| callbackcallback | Callback<[MagneticFieldResponse](#magneticfieldresponse)> | No | Callback used to return the magnetic field sensor data. The reported data type in the callback is **MagneticFieldResponse**. |
+| Name | Type | Mandatory| Description |
+| ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD**. |
+| callbackcallback | Callback<[MagneticFieldResponse](#magneticfieldresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5405,7 +5336,6 @@ function callback(data) {
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
-
```
### MAGNETIC_FIELD_UNCALIBRATED(deprecated)
@@ -5420,10 +5350,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.M
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**. |
-| callback | Callback<[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)> | No | Callback used to return the uncalibrated magnetic field sensor data. The reported data type in the callback is **MagneticFieldUncalibratedResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED**.|
+| callback | Callback<[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5437,7 +5367,6 @@ function callback(data) {
console.info('Z-coordinate bias: ' + data.biasZ);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback);
-
```
### ORIENTATION(deprecated)
@@ -5452,10 +5381,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.O
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ----------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ORIENTATION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ORIENTATION**. |
-| callback | Callback<[OrientationResponse](#orientationresponse)> | No | Callback used to return the orientation sensor data. The reported data type in the callback is **OrientationResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ORIENTATION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ORIENTATION**. |
+| callback | Callback<[OrientationResponse](#orientationresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5466,7 +5395,6 @@ function callback(data) {
console.info('The device rotates at an angle around the Z axis: ' + data.alpha);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
-
```
### PEDOMETER(deprecated)
@@ -5483,10 +5411,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.P
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER**. |
-| callback | Callback<[PedometerResponse](#pedometerresponse)> | No | Callback used to return the pedometer sensor data. The reported data type in the callback is **PedometerResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER**. |
+| callback | Callback<[PedometerResponse](#pedometerresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5495,7 +5423,6 @@ function callback(data) {
console.info('Steps: ' + data.steps);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback);
-
```
### PEDOMETER_DETECTION(deprecated)
@@ -5512,10 +5439,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.P
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER_DETECTION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**. |
-| callback | Callback<[PedometerDetectionResponse](#pedometerdetectionresponse)> | No | Callback used to return the pedometer detection sensor data. The reported data type in the callback is **PedometerDetectionResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PEDOMETER_DETECTION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PEDOMETER_DETECTION**.|
+| callback | Callback<[PedometerDetectionResponse](#pedometerdetectionresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5524,7 +5451,6 @@ function callback(data) {
console.info('Scalar data: ' + data.scalar);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback);
-
```
### PROXIMITY(deprecated)
@@ -5539,10 +5465,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.P
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PROXIMITY | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PROXIMITY**. |
-| callback | Callback<[ProximityResponse](#proximityresponse)> | No | Callback used to return the proximity sensor data. The reported data type in the callback is **ProximityResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_PROXIMITY | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_PROXIMITY**. |
+| callback | Callback<[ProximityResponse](#proximityresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5551,7 +5477,6 @@ function callback(data) {
console.info('Distance: ' + data.distance);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback);
-
```
### ROTATION_VECTOR(deprecated)
@@ -5566,10 +5491,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.R
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ROTATION_VECTOR | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**. |
-| callback | Callback<[RotationVectorResponse](#rotationvectorresponse)> | No | Callback used to return the rotation vector sensor data. The reported data type in the callback is **RotationVectorResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_ROTATION_VECTOR | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_ROTATION_VECTOR**.|
+| callback | Callback<[RotationVectorResponse](#rotationvectorresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5581,7 +5506,6 @@ function callback(data) {
console.info('Scalar quantity: ' + data.w);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback);
-
```
### SIGNIFICANT_MOTION(deprecated)
@@ -5596,10 +5520,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.S
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_SIGNIFICANT_MOTION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**. |
-| callback | Callback<[SignificantMotionResponse](#significantmotionresponse)> | No | Callback used to return the significant motion sensor data. The reported data type in the callback is **SignificantMotionResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_SIGNIFICANT_MOTION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_SIGNIFICANT_MOTION**.|
+| callback | Callback<[SignificantMotionResponse](#significantmotionresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5608,7 +5532,6 @@ function callback(data) {
console.info('Scalar data: ' + data.scalar);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback);
-
```
### WEAR_DETECTION(deprecated)
@@ -5623,10 +5546,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.off.W
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| type | [SensorType](#sensortype).SENSOR_TYPE_ID_WEAR_DETECTION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_WEAR_DETECTION**. |
-| callback | Callback<[WearDetectionResponse](#weardetectionresponse)> | No | Callback used to return the wear detection sensor data. The reported data type in the callback is **WearDetectionResponse**. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| type | [SensorType](#sensortype).SENSOR_TYPE_ID_WEAR_DETECTION | Yes | Type of the sensor to unsubscribe from, which is **SENSOR_TYPE_ID_WEAR_DETECTION**.|
+| callback | Callback<[WearDetectionResponse](#weardetectionresponse)> | No | Callback used for unsubscription. If this parameter is not specified, all callbacks of the specified sensor type are unsubscribed from.|
**Example**
@@ -5635,7 +5558,6 @@ function accCallback(data) {
console.info('Wear status: ' + data.value);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, accCallback);
-
```
## sensor.transformCoordinateSystem(deprecated)
@@ -5650,11 +5572,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.trans
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------------- | ----------------------------------------- | --------- | ------------------------------------------------------------ |
-| inRotationVector | Array<number> | Yes | Rotation vector to rotate. |
-| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system. |
-| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation vector after being rotated. |
+| Name | Type | Mandatory | Description |
+| ---------------- | ---------------------------------------- | ---- | ----------- |
+| inRotationVector | Array<number> | Yes | Rotation vector to rotate. |
+| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system. |
+| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation vector after being rotated.|
**Example**
@@ -5669,9 +5591,7 @@ sensor.transformCoordinateSystem([1, 0, 0, 0, 1, 0, 0, 0, 1], {x:2, y:3}, functi
console.info("transformCoordinateSystem data[ " + i + "] = " + data[i]);
}
})
-
```
-
## sensor.transformCoordinateSystem(deprecated)
transformCoordinateSystem(inRotationVector: Array<number>, coordinates: CoordinatesOptions): Promise<Array<number>>
@@ -5684,16 +5604,16 @@ This API is deprecated since API version 9. You are advised to use [sensor.trans
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------------- | ----------------------------------------- | --------- | ----------------------------------- |
-| inRotationVector | Array<number> | Yes | Rotation vector to rotate. |
-| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system. |
+| Name | Type | Mandatory | Description |
+| ---------------- | ---------------------------------------- | ---- | -------- |
+| inRotationVector | Array<number> | Yes | Rotation vector to rotate. |
+| coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Direction of the coordinate system.|
**Return value**
-| Type | Description |
-| ---------------------------------- | ------------------------------------------------------------ |
-| Promise<Array<number>> | Promise used to return the rotation vector after being rotated. |
+| Type | Description |
+| ---------------------------------- | ----------- |
+| Promise<Array<number>> | Promise used to return the rotation vector after being rotated.|
**Example**
@@ -5707,7 +5627,6 @@ const promise = sensor.transformCoordinateSystem([1, 0, 0, 0, 1, 0, 0, 0, 1], {x
}).catch((err) => {
console.info("Operation failed");
})
-
```
## sensor.getGeomagneticField(deprecated)
@@ -5722,14 +5641,13 @@ This API is deprecated since API version 9. You are advised to use [sensor.getGe
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
-| locationOptions | [LocationOptions](#locationoptions) | Yes | Geographic location. |
-| timeMillis | number | Yes | Time for obtaining the magnetic declination, in milliseconds. |
-| callback | AsyncCallback<[GeomagneticResponse](#geomagneticresponse)> | Yes | Callback used to return the geomagnetic field. |
+| Name | Type | Mandatory| Description |
+| --------------- | ------------------------------------------------------------ | ---- | ---------------------------------- |
+| locationOptions | [LocationOptions](#locationoptions) | Yes | Geographic location. |
+| timeMillis | number | Yes | Time for obtaining the magnetic declination, in milliseconds.|
+| callback | AsyncCallback<[GeomagneticResponse](#geomagneticresponse)> | Yes | Callback used to return the geomagnetic field. |
**Example**
-
```js
sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000, function(err, data) {
if (err) {
@@ -5740,9 +5658,7 @@ sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000
data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle +
',levelIntensity: ' + data.levelIntensity + ',totalIntensity: ' + data.totalIntensity);
});
-
```
-
## sensor.getGeomagneticField(deprecated)
getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise<GeomagneticResponse>
@@ -5755,19 +5671,17 @@ This API is deprecated since API version 9. You are advised to use [sensor.getGe
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------------- | ----------------------------------- | --------- | ------------------------------------------------------------ |
-| locationOptions | [LocationOptions](#locationoptions) | Yes | Geographic location. |
-| timeMillis | number | Yes | Time for obtaining the magnetic declination, in milliseconds. |
+| Name | Type | Mandatory | Description |
+| --------------- | ----------------------------------- | ---- | ----------------- |
+| locationOptions | [LocationOptions](#locationoptions) | Yes | Geographic location. |
+| timeMillis | number | Yes | Time for obtaining the magnetic declination, in milliseconds.|
**Return value**
-
-| Type | Description |
-| ---------------------------------------------------------- | --------------------------------------------- |
-| Promise<[GeomagneticResponse](#geomagneticresponse)> | Promise used to return the geomagnetic field. |
+| Type | Description |
+| ---------------------------------------- | ------- |
+| Promise<[GeomagneticResponse](#geomagneticresponse)> | Promise used to return the geomagnetic field.|
**Example**
-
```js
const promise = sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000);
promise.then((data) => {
@@ -5777,7 +5691,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getGe
}).catch((reason) => {
console.info('Operation failed.');
})
-
```
## sensor.getAltitude(deprecated)
@@ -5792,11 +5705,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.getDe
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------------- | --------------------------- | --------- | ------------------------------------------------------------ |
-| seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. |
-| currentPressure | number | Yes | Atmospheric pressure at the altitude where the device is located, in hPa. |
-| callback | AsyncCallback<number> | Yes | Callback used to return the altitude, in meters. |
+| Name | Type | Mandatory | Description |
+| --------------- | --------------------------- | ---- | -------------------- |
+| seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. |
+| currentPressure | number | Yes | Atmospheric pressure at the altitude where the device is located, in hPa.|
+| callback | AsyncCallback<number> | Yes | Callback used to return the altitude, in meters. |
**Example**
@@ -5809,7 +5722,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getDe
}
console.info("Succeeded to get getAltitude interface get data: " + data);
});
-
```
## sensor.getAltitude(deprecated)
@@ -5824,16 +5736,16 @@ This API is deprecated since API version 9. You are advised to use [sensor.getDe
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------------- | ------ | --------- | ------------------------------------------------------------ |
-| seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. |
-| currentPressure | number | Yes | Atmospheric pressure at the altitude where the device is located, in hPa. |
+| Name | Type | Mandatory | Description |
+| --------------- | ------ | ---- | -------------------- |
+| seaPressure | number | Yes | Sea-level atmospheric pressure, in hPa. |
+| currentPressure | number | Yes | Atmospheric pressure at the altitude where the device is located, in hPa.|
**Return value**
-| Type | Description |
-| --------------------- | ----------------------------------------------- |
-| Promise<number> | Promise used to return the altitude, in meters. |
+| Type | Description |
+| --------------------- | ------------------ |
+| Promise<number> | Promise used to return the altitude, in meters.|
**Example**
@@ -5844,7 +5756,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getDe
}).catch((err) => {
console.error("Operation failed");
})
-
```
@@ -5860,10 +5771,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.getIn
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----------------- | --------------------------- | --------- | ----------------------------------------------------- |
-| inclinationMatrix | Array<number> | Yes | Inclination matrix. |
-| callback | AsyncCallback<number> | Yes | Callback used to return the magnetic dip, in radians. |
+| Name | Type | Mandatory | Description |
+| ----------------- | --------------------------- | ---- | -------------- |
+| inclinationMatrix | Array<number> | Yes | Inclination matrix. |
+| callback | AsyncCallback<number> | Yes | Callback used to return the magnetic dip, in radians.|
**Example**
@@ -5876,7 +5787,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getIn
}
console.info("Succeeded to get getGeomagneticDip interface get data: " + data);
})
-
```
## sensor.getGeomagneticDip(deprecated)
@@ -5891,15 +5801,15 @@ This API is deprecated since API version 9. You are advised to use [sensor.getIn
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----------------- | ------------------- | --------- | ------------------- |
-| inclinationMatrix | Array<number> | Yes | Inclination matrix. |
+| Name | Type | Mandatory | Description |
+| ----------------- | ------------------- | ---- | ------- |
+| inclinationMatrix | Array<number> | Yes | Inclination matrix.|
**Return value**
-| Type | Description |
-| --------------------- | ---------------------------------------------------- |
-| Promise<number> | Promise used to return the magnetic dip, in radians. |
+| Type | Description |
+| --------------------- | -------------- |
+| Promise<number> | Promise used to return the magnetic dip, in radians.|
**Example**
@@ -5910,7 +5820,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getIn
}).catch((err) => {
console.error("Operation failed");
})
-
```
## sensor. getAngleModify(deprecated)
@@ -5925,11 +5834,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.getAn
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------------------- | ---------------------------------------- | --------- | ------------------------------------------------------------ |
-| currentRotationMatrix | Array<number> | Yes | Current rotation matrix. |
-| preRotationMatrix | Array<number> | Yes | The other rotation matrix. |
-| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the angle change around the z, x, and y axes. |
+| Name | Type | Mandatory | Description |
+| --------------------- | ---------------------------------------- | ---- | ------------------ |
+| currentRotationMatrix | Array<number> | Yes | Current rotation matrix. |
+| preRotationMatrix | Array<number> | Yes | The other rotation matrix. |
+| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the angle change around the z, x, and y axes.|
**Example**
@@ -5944,7 +5853,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getAn
console.info("data[" + i + "]: " + data[i]);
}
})
-
```
@@ -5960,16 +5868,16 @@ This API is deprecated since API version 9. You are advised to use [sensor.getAn
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------------------- | ------------------- | --------- | -------------------------- |
-| currentRotationMatrix | Array<number> | Yes | Current rotation matrix. |
-| preRotationMatrix | Array<number> | Yes | The other rotation matrix. |
+| Name | Type | Mandatory | Description |
+| --------------------- | ------------------- | ---- | --------- |
+| currentRotationMatrix | Array<number> | Yes | Current rotation matrix.|
+| preRotationMatrix | Array<number> | Yes | The other rotation matrix. |
**Return value**
-| Type | Description |
-| ---------------------------------- | ------------------------------------------------------------ |
-| Promise<Array<number>> | Promise used to return the angle change around the z, x, and y axes. |
+| Type | Description |
+| ---------------------------------- | ------------------ |
+| Promise<Array<number>> | Promise used to return the angle change around the z, x, and y axes.|
**Example**
@@ -5983,7 +5891,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getAn
}).catch((reason) => {
console.info("promise::catch", reason);
})
-
```
@@ -5999,10 +5906,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ---------------------------------------- | --------- | -------------------------------------------- |
-| rotationVector | Array<number> | Yes | Rotation vector to convert. |
-| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation matrix. |
+| Name | Type | Mandatory | Description |
+| -------------- | ---------------------------------------- | ---- | ------- |
+| rotationVector | Array<number> | Yes | Rotation vector to convert.|
+| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation matrix.|
**Example**
@@ -6017,7 +5924,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo
console.info("data[" + i + "]: " + data[i]);
}
})
-
```
@@ -6033,15 +5939,15 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ------------------- | --------- | --------------------------- |
-| rotationVector | Array<number> | Yes | Rotation vector to convert. |
+| Name | Type | Mandatory | Description |
+| -------------- | ------------------- | ---- | ------- |
+| rotationVector | Array<number> | Yes | Rotation vector to convert.|
**Return value**
-| Type | Description |
-| ---------------------------------- | ------------------------------------------- |
-| Promise<Array<number>> | Promise used to return the rotation matrix. |
+| Type | Description |
+| ---------------------------------- | ------- |
+| Promise<Array<number>> | Promise used to return the rotation matrix.|
**Example**
@@ -6055,7 +5961,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo
}).catch((reason) => {
console.info("promise::catch", reason);
})
-
```
@@ -6071,10 +5976,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.getQu
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ---------------------------------------- | --------- | --------------------------------------- |
-| rotationVector | Array<number> | Yes | Rotation vector to convert. |
-| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the quaternion. |
+| Name | Type | Mandatory | Description |
+| -------------- | ---------------------------------------- | ---- | ------- |
+| rotationVector | Array<number> | Yes | Rotation vector to convert.|
+| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the quaternion. |
**Example**
@@ -6089,7 +5994,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getQu
console.info("data[" + i + "]: " + data[i]);
}
})
-
```
@@ -6105,15 +6009,15 @@ This API is deprecated since API version 9. You are advised to use [sensor.getQu
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ------------------- | --------- | --------------------------- |
-| rotationVector | Array<number> | Yes | Rotation vector to convert. |
+| Name | Type | Mandatory | Description |
+| -------------- | ------------------- | ---- | ------- |
+| rotationVector | Array<number> | Yes | Rotation vector to convert.|
**Return value**
-| Type | Description |
-| ---------------------------------- | -------------------------------------- |
-| Promise<Array<number>> | Promise used to return the quaternion. |
+| Type | Description |
+| ---------------------------------- | ------ |
+| Promise<Array<number>> | Promise used to return the quaternion.|
**Example**
@@ -6127,7 +6031,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getQu
}).catch((err) => {
console.info('promise failed');
})
-
```
@@ -6143,10 +6046,10 @@ This API is deprecated since API version 9. You are advised to use [sensor.getOr
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ---------------------------------------- | --------- | ------------------------------------------------------------ |
-| rotationMatrix | Array<number> | Yes | Rotation matrix. |
-| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation angle around the z, x, and y axes. |
+| Name | Type | Mandatory | Description |
+| -------------- | ---------------------------------------- | ---- | ------------------ |
+| rotationMatrix | Array<number> | Yes | Rotation matrix. |
+| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation angle around the z, x, and y axes.|
**Example**
@@ -6162,7 +6065,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getOr
console.info("sensor_getDirection_callback" + data[i]);
}
})
-
```
@@ -6178,15 +6080,15 @@ This API is deprecated since API version 9. You are advised to use [sensor.getOr
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ------------------- | --------- | ---------------- |
-| rotationMatrix | Array<number> | Yes | Rotation matrix. |
+| Name | Type | Mandatory | Description |
+| -------------- | ------------------- | ---- | ------- |
+| rotationMatrix | Array<number> | Yes | Rotation matrix.|
**Return value**
-| Type | Description |
-| ---------------------------------- | ------------------------------------------------------------ |
-| Promise<Array<number>> | Promise used to return the rotation angle around the z, x, and y axes. |
+| Type | Description |
+| ---------------------------------- | ------------------ |
+| Promise<Array<number>> | Promise used to return the rotation angle around the z, x, and y axes.|
**Example**
@@ -6215,11 +6117,11 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----------- | ------------------------------------------------------------ | --------- | -------------------------------------------- |
-| gravity | Array<number> | Yes | Gravity vector. |
-| geomagnetic | Array<number> | Yes | Geomagnetic vector. |
-| callback | AsyncCallback<[RotationMatrixResponse](#rotationmatrixresponse)> | Yes | Callback used to return the rotation matrix. |
+| Name | Type | Mandatory | Description |
+| ----------- | ---------------------------------------- | ---- | ------- |
+| gravity | Array<number> | Yes | Gravity vector.|
+| geomagnetic | Array<number> | Yes | Geomagnetic vector.|
+| callback | AsyncCallback<[RotationMatrixResponse](#rotationmatrixresponse)> | Yes | Callback used to return the rotation matrix.|
**Example**
@@ -6246,16 +6148,16 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----------- | ------------------- | --------- | ------------------- |
-| gravity | Array<number> | Yes | Gravity vector. |
-| geomagnetic | Array<number> | Yes | Geomagnetic vector. |
+| Name | Type | Mandatory | Description |
+| ----------- | ------------------- | ---- | ------- |
+| gravity | Array<number> | Yes | Gravity vector.|
+| geomagnetic | Array<number> | Yes | Geomagnetic vector.|
**Return value**
-| Type | Description |
-| ------------------------------------------------------------ | ------------------------------------------- |
-| Promise<[RotationMatrixResponse](#rotationmatrixresponse)> | Promise used to return the rotation matrix. |
+| Type | Description |
+| ---------------------------------------- | ------- |
+| Promise<[RotationMatrixResponse](#rotationmatrixresponse)> | Promise used to return the rotation matrix.|
**Example**
@@ -6266,4 +6168,4 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo
}).catch((err) => {
console.info('promise failed');
})
- ```
\ No newline at end of file
+ ```
diff --git a/en/application-dev/reference/apis/js-apis-uiappearance.md b/en/application-dev/reference/apis/js-apis-uiappearance.md
index ebbdc971840c8f3669bc19dbba0ebd0d95b28d60..20d4807d83b031ebf821c3368da690e6b6bbcb67 100644
--- a/en/application-dev/reference/apis/js-apis-uiappearance.md
+++ b/en/application-dev/reference/apis/js-apis-uiappearance.md
@@ -4,7 +4,7 @@ The **uiAppearance** module provides basic capabilities for managing the system
> **NOTE**
>
-> The APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
+> The APIs of this module are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
diff --git a/en/application-dev/reference/apis/js-apis-usbManager.md b/en/application-dev/reference/apis/js-apis-usbManager.md
index 211a623cce941537d2d24f8ee3764608721bf6fe..ac6de75dd00fc24d9503039fdae5bf6be0931ee7 100644
--- a/en/application-dev/reference/apis/js-apis-usbManager.md
+++ b/en/application-dev/reference/apis/js-apis-usbManager.md
@@ -209,8 +209,8 @@ Removes the permission for the application to access a USB device.
**Example**
```js
-let devicesName="1-1";
-if usb.removeRight(devicesName) {
+let devicesName= "1-1";
+if (usb.removeRight(devicesName)) {
console.log(`Succeed in removing right`);
}
```
@@ -245,7 +245,7 @@ Adds the permission for the application to access a USB device.
```js
let devicesName = "1-1";
let bundleName = "com.example.hello";
-if usb.addRight(bundleName, devicesName) {
+if (usb.addRight(bundleName, devicesName)) {
console.log(`Succeed in adding right`);
}
```
@@ -454,7 +454,14 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**Example**
```js
-let param = new usb.USBControlParams();
+let param = {
+ request: 0,
+ reqType: 0,
+ target:0,
+ value: 0,
+ index: 0,
+ data: null
+};
usb.controlTransfer(devicepipe, param).then((ret) => {
console.log(`controlTransfer = ${ret}`);
})
@@ -579,7 +586,7 @@ Converts the USB function list in the numeric mask format to a string in Device
**Example**
```js
-let funcs = usb.ACM | usb.ECM;
+let funcs = usb.FunctionType.ACM | usb.FunctionType.ECM;
let ret = usb.usbFunctionsToString(funcs);
```
@@ -608,7 +615,7 @@ Sets the current USB function list in Device mode.
**Example**
```js
-let funcs = usb.HDC;
+let funcs = usb.FunctionType.HDC;
usb.setCurrentFunctions(funcs).then(() => {
console.info('usb setCurrentFunctions successfully.');
}).catch(err => {
diff --git a/en/application-dev/reference/apis/js-apis-vibrator.md b/en/application-dev/reference/apis/js-apis-vibrator.md
index 383bc980e60cbf460db627124b77facff8555751..46e6f69db5327502add3c26ba6fd6b897868fc0c 100644
--- a/en/application-dev/reference/apis/js-apis-vibrator.md
+++ b/en/application-dev/reference/apis/js-apis-vibrator.md
@@ -52,7 +52,7 @@ try {
usage: 'alarm'
}, (error) => {
if (error) {
- console.error('vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
+ console.error('Vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
return;
}
console.log('Callback returned to indicate a successful vibration.');
@@ -145,7 +145,7 @@ try {
usage: 'alarm'
}, (error) => {
if (error) {
- console.error('vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
+ console.error('Vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
return;
}
console.log('Callback returned to indicate a successful vibration.');
@@ -253,7 +253,7 @@ try {
usage: 'alarm'
}, (error) => {
if (error) {
- console.error('vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
+ console.error('Vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
return;
}
console.log('Callback returned to indicate a successful vibration.');
@@ -338,7 +338,7 @@ Checks whether the passed effect ID is supported. This API uses an asynchronous
| Name | Type | Mandatory| Description |
| -------- | ---------------------------- | ---- | ------------------------------------------------------ |
| effectId | string | Yes | Vibration effect ID. |
-| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** means that the passed effect ID is supported, and **false** means the opposite. |
+| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** means that the passed effect ID is supported, and **false** means the opposite.|
**Example**
@@ -395,7 +395,7 @@ Checks whether the passed effect ID is supported. This API uses a promise to ret
| Type | Description |
| ---------------------- | --------------------------------------------------------- |
-| Promise<boolean> | Promise that returns the result. The value **true** means that the passed effect ID is supported, and **false** means the opposite. |
+| Promise<boolean> | Promise that returns the result. The value **true** means that the passed effect ID is supported, and **false** means the opposite.|
**Example**
@@ -419,7 +419,7 @@ try {
console.error('Promise returned to indicate a failed vibration:' + JSON.stringify(error));
});
} catch (error) {
- console.error('exception in, error:' + JSON.stringify(error));
+ console.error('Exception in, error:' + JSON.stringify(error));
}
}
}, (error) => {
diff --git a/en/application-dev/reference/arkui-js/figures/screenshot-8.png b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001127125162.png
similarity index 100%
rename from en/application-dev/reference/arkui-js/figures/screenshot-8.png
rename to en/application-dev/reference/arkui-js/figures/en-us_image_0000001127125162.png
diff --git a/en/application-dev/reference/arkui-js/figures/smoothoff.png b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001167952236.png
similarity index 100%
rename from en/application-dev/reference/arkui-js/figures/smoothoff.png
rename to en/application-dev/reference/arkui-js/figures/en-us_image_0000001167952236.png
diff --git a/en/application-dev/reference/arkui-js/figures/ellipse.png b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214823665.png
similarity index 100%
rename from en/application-dev/reference/arkui-js/figures/ellipse.png
rename to en/application-dev/reference/arkui-js/figures/en-us_image_0000001214823665.png
diff --git a/en/application-dev/reference/arkui-js/figures/js-text.png b/en/application-dev/reference/arkui-js/figures/js-text.png
new file mode 100644
index 0000000000000000000000000000000000000000..65f36bddf4015f870e67edf7a96d1457014d1b3c
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/js-text.png differ
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md b/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md
index ee7d77b8d909a85c416073c74551511de4f5a11c..a710010f667b27244bf6f54604f718a3bc6b4039 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md
@@ -1,7 +1,6 @@
# picker-view
> **NOTE**
->
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
The **\** component provides the view that shows an embedded scrollable selector on the screen.
@@ -121,228 +120,232 @@ Not supported
## Example
-1. Text Selector
- ```html
-
-
-
- Selected value: {{value}} Selected index: {{index}}
-
-
-
- ```
-
- ```css
- /* xxx.css */
- .container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 50%;
- }
- .title {
- font-size: 30px;
- text-align: center;
- margin-top: 50%;
- }
- ```
-
- ```js
- /* xxx.js */
- export default {
- data: {
- options: ['Option 1','Option 2','Option 3'],
- value: "Option 1",
- index: 0
- },
- handleChange(data) {
- this.value = data.newValue;
- this.index = data.newSelected;
- },
- }
- ```
- 
-
-2. Time Selector
- ```html
-
-
-
- Selected: {{time}}
-
-
-
- ```
-
- ```css
- /* xxx.css */
- .container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 50%;
- }
- .title {
- font-size: 31px;
- text-align: center;
- margin-top: 50%;
- }
- ```
-
- ```js
- /* xxx.js */
- export default {
- data: {
- defaultTime: "",
- time: "",
- },
- onInit() {
- this.defaultTime = this.now();
- },
- handleChange(data) {
- this.time = this.concat(data.hour, data.minute);
- },
- now() {
- const date = new Date();
- const hours = date.getHours();
- const minutes = date.getMinutes();
- return this.concat(hours, minutes);
- },
- fill(value) {
- return (value > 9 ? "" : "0") + value;
- },
- concat(hours, minutes) {
- return `${this.fill(hours)}:${this.fill(minutes)}`;
- },
- }
- ```
-
- 
-
-3. Date Selector
- ```html
-
-
-
- Selected: {{date}}
-
-
-
- ```
-
- ```css
- /* xxx.css */
- .container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 50%;
- }
- .title {
- font-size: 31px;
- text-align: center;
- margin-top: 50%;
- }
- ```
-
- ```js
- /* xxx.js */
- export default {
- data: {
- date: "",
- },
- handleChange(data) {
- this.date = data.year + "/" + data.month + "/" + data.day + "";
- },
- }
- ```
- 
-
-4. Date and Time Selector
- ```html
-
-
-
- Selected: {{datetime}}
-
-
-
- ```
-
- ```css
- /* xxx.css */
- .container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 50%;
- }
- .title {
- font-size: 31px;
- text-align: center;
- margin-top: 50%;
- }
- ```
-
- ```js
- /* xxx.js */
- export default {
- data: {
- datetime: "",
- },
- handleChange(data) {
- this.datetime = data.year + "/" + data.month + "/" + data.day + "" + data.hour + ":" + data.minute + "";
- },
- }
- ```
- 
-
-5. Multi-Column Text Selector
-
- ```html
-
-
-
- Selected: {{ value }}
-
-
-
- ```
-
- ```css
- /* xxx.css */
- .container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 50%;
- }
- .title {
- font-size: 31px;
- text-align: center;
- margin-top: 50%;
- }
- ```
-
- ```js
- /* xxx.js */
- export default {
- data: {
- multitext: [
- [1, 2, 3],
- [4, 5, 6],
- [7, 8, 9],
- ],
- value: ""
- },
- handleChange(data) {
- this.value = "Selected: " + data.column + "," + "value: " + data.newValue + ", index:" + data.newSelected;
- },
- }
- ```
- 
+### Text Selector
+
+```html
+
+
+
+ Selected value: {{value}} Selected index: {{index}}
+
+
+
+```
+
+```css
+/* xxx.css */
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 50%;
+}
+.title {
+ font-size: 30px;
+ text-align: center;
+ margin-top: 50%;
+}
+```
+
+```js
+/* xxx.js */
+export default {
+ data: {
+ options: ['Option 1','Option 2','Option 3'],
+ value: "Option 1",
+ index: 0
+ },
+ handleChange(data) {
+ this.value = data.newValue;
+ this.index = data.newSelected;
+ },
+}
+```
+
+
+### Time Selector
+
+```html
+
+
+
+ Selected: {{time}}
+
+
+
+```
+
+```css
+/* xxx.css */
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 50%;
+}
+.title {
+ font-size: 31px;
+ text-align: center;
+ margin-top: 50%;
+}
+```
+
+```js
+/* xxx.js */
+export default {
+ data: {
+ defaultTime: "",
+ time: "",
+ },
+ onInit() {
+ this.defaultTime = this.now();
+ },
+ handleChange(data) {
+ this.time = this.concat(data.hour, data.minute);
+ },
+ now() {
+ const date = new Date();
+ const hours = date.getHours();
+ const minutes = date.getMinutes();
+ return this.concat(hours, minutes);
+ },
+ fill(value) {
+ return (value > 9 ? "" : "0") + value;
+ },
+ concat(hours, minutes) {
+ return `${this.fill(hours)}:${this.fill(minutes)}`;
+ },
+}
+```
+
+
+
+### Date Selector
+
+```html
+
+
+
+ Selected: {{date}}
+
+
+
+```
+
+```css
+/* xxx.css */
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 50%;
+}
+.title {
+ font-size: 31px;
+ text-align: center;
+ margin-top: 50%;
+}
+```
+
+```js
+/* xxx.js */
+export default {
+ data: {
+ date: "",
+ },
+ handleChange(data) {
+ this.date = data.year + "/" + data.month + "/" + data.day + "";
+ },
+}
+```
+
+
+### Date and Time Selector
+
+```html
+
+
+
+ Selected: {{datetime}}
+
+
+
+```
+
+```css
+/* xxx.css */
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 50%;
+}
+.title {
+ font-size: 31px;
+ text-align: center;
+ margin-top: 50%;
+}
+```
+
+```js
+/* xxx.js */
+export default {
+ data: {
+ datetime: "",
+ },
+ handleChange(data) {
+ this.datetime = data.year + "/" + data.month + "/" + data.day + "" + data.hour + ":" + data.minute + "";
+ },
+}
+```
+
+
+### Multi-Column Text Selector
+
+```html
+
+
+
+ Selected: {{ value }}
+
+
+
+```
+
+```css
+/* xxx.css */
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 50%;
+}
+.title {
+ font-size: 31px;
+ text-align: center;
+ margin-top: 50%;
+}
+```
+
+```js
+/* xxx.js */
+export default {
+ data: {
+ multitext: [
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+ ],
+ value: ""
+ },
+ handleChange(data) {
+ this.value = "Column: " + data.column + "," + "Value: " + data.newValue + ", Index:" + data.newSelected;
+ },
+}
+```
+
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-text.md b/en/application-dev/reference/arkui-js/js-components-basic-text.md
index 2509a3a6bcc556e19d1393ed80acad3d28c91fb4..9a90dab3196ec3bb3ae41bddc6c93fb275413e18 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-text.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-text.md
@@ -137,4 +137,4 @@ The [universal methods](../arkui-js/js-components-common-methods.md) are support
```
-
+
diff --git a/en/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md b/en/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md
index ceefb977f290e2f59c5234c8e2eb99b61f0b9cd2..2fdfc9bc47c82d75e0d9b3f88e051d17d6348f7a 100644
--- a/en/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md
+++ b/en/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md
@@ -43,7 +43,7 @@
- Anti-aliasing enabled
- 
+ 
## Attributes
@@ -558,7 +558,7 @@ export default {
}
```
-
+
@@ -863,10 +863,10 @@ Moves a drawing path to a target position on the canvas.
**Parameters**
-| Name | Type | Description |
-| ---- | ------ | --------- |
-| x | number | X-coordinate of the target position.|
-| y | number | Y-coordinate of the target position.|
+| Name | Type | Description |
+| ---- | ------ | ------------------ |
+| x | number | X-coordinate of the target position. Unit: vp|
+| y | number | Y-coordinate of the target position. Unit: vp|
**Example**
```html
@@ -902,8 +902,8 @@ Connects the current point to a target position using a straight line.
| Name | Type | Description |
| ---- | ------ | --------- |
-| x | number | X-coordinate of the target position.|
-| y | number | Y-coordinate of the target position.|
+| x | number | X-coordinate of the target position. Unit: vp|
+| y | number | Y-coordinate of the target position. Unit: vp|
**Example**
```html
@@ -1026,7 +1026,7 @@ Draws a cubic bezier curve on the canvas.
```html
-
+
```
@@ -1204,7 +1204,7 @@ Draws an ellipse in the specified rectangular region on the canvas.
}
```
- 
+ 
### rect
diff --git a/en/application-dev/reference/arkui-js/js-components-container-list-item-group.md b/en/application-dev/reference/arkui-js/js-components-container-list-item-group.md
index f624bc744807f1e8fc5e621eb4ada060f29150b8..1f50afab4fe79bada6760d056f3059114852cf3a 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-list-item-group.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-list-item-group.md
@@ -18,7 +18,7 @@ None
## Child Components
-Only the **[\](../arkui-js/js-components-container-list-item.md)** component is supported.
+Only the [\](../arkui-js/js-components-container-list-item.md) child component is supported.
## Attributes
@@ -31,7 +31,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
> **NOTE**
>
-> **id** in the universal attributes is used to identify a group. The input parameters of related functions and event information in the list also use **id** to uniquely identify a group.
+> The universal attribute **id** is used to identify a group. The input parameters of related functions and event information in the list also use **id** to uniquely identify a group.
## Styles
@@ -126,48 +126,55 @@ The [universal methods](../arkui-js/js-components-common-methods.md) are support
// xxx.js
import promptAction from '@ohos.promptAction';
export default {
- data: {
- direction: 'column',
- list: [],
- listAdd: []
- },
- onInit() {
- this.list = []
- this.listAdd = []
- for (var i = 1; i <= 3; i++) {
- var dataItem = {
- value: 'GROUP' + i,
- };
- this.list.push(dataItem);
+ data: {
+ direction: 'column',
+ list: [],
+ listAdd: []
+ },
+ onInit() {
+ this.list = []
+ this.listAdd = []
+ for (var i = 1; i <= 3; i++) {
+ var dataItem = {
+ value: 'GROUP' + i,
+ };
+ this.list.push(dataItem);
+ }
+ },
+ collapseOne(e) {
+ this.$element('mylist').collapseGroup({
+ groupid: 'GROUP1'
+ })
+ },
+ expandOne(e) {
+ this.$element('mylist').expandGroup({
+ groupid: 'GROUP1'
+ })
+ },
+ collapseAll(e) {
+ this.$element('mylist').collapseGroup({
+ groupid: ''
+ })
+ },
+ expandAll(e) {
+ this.$element('mylist').expandGroup({
+ groupid: ''
+ })
+ },
+ collapse(e) {
+ promptAction.showToast({
+ message: 'Close ' + e.groupid
+ })
+ },
+ expand(e) {
+ promptAction.showToast({
+ message: 'Open ' + e.groupid
+ })
}
- },
- collapseOne(e) {
- this.$element('mylist').collapseGroup({
- groupid: 'GROUP1'
- })
- },
- expandOne(e) {
- this.$element('mylist').expandGroup({
- groupid: 'GROUP1'
- })
- },
- collapseAll(e) {
- this.$element('mylist').collapseGroup()
- },
- expandAll(e) {
- this.$element('mylist').expandGroup()
- },
- collapse(e) {
- promptAction.showToast({
- message: 'Close ' + e.groupid
- })
- },
- expand(e) {
- promptAction.showToast({
- message: 'Open ' + e.groupid
- })
- }
}
+
+
+
```

diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md b/en/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md
index f644f8d30d81df0d011cd05c4f88339edccca5a1..5f88febc197d777bfdea733e3e94530d5f181cf4 100644
--- a/en/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md
+++ b/en/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md
@@ -22,9 +22,9 @@ Creates a text picker based on the selection range specified by **range**.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| range | string[] \| [Resource](ts-types.md#resource)\|[TextPickerRangeContent](#textpickerrangecontent10)[]10+ | Yes| Data selection range of the picker. This parameter cannot be set to an empty array. If set to an empty array, it will not be displayed. If it is dynamically changed to an empty array, the current value remains displayed.|
-| selected | number | No| Index of the default item in the range. Default value: **0**|
-| value | string | No| Value of the default item in the range. The priority of this parameter is lower than that of **selected**. Default value: value of the first item **NOTE**\ This parameter works only for a text list. It does not work for an image list or a list consisting of text and images.|
+| range | string[] \| [Resource](ts-types.md#resource) \| [TextPickerRangeContent](#textpickerrangecontent10)[]10+ | Yes| Data selection range of the picker. This parameter cannot be set to an empty array. If set to an empty array, it will not be displayed. If it is dynamically changed to an empty array, the current value remains displayed.|
+| selected | number | No| Index of the default item in the range. Default value: **0** Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.|
+| value | string | No| Value of the default item in the range. The priority of this parameter is lower than that of **selected**. Default value: value of the first item **NOTE** This parameter works only for a text list. It does not work for an image list or a list consisting of text and images. Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables. |
## TextPickerRangeContent10+
@@ -50,7 +50,9 @@ In addition to the [universal events](ts-universal-events-click.md), the followi
| Name| Description|
| -------- | -------- |
-| onChange(callback: (value: string, index: number) => void) | Triggered when an item in the picker is selected. - **value**: value of the selected item. **NOTE** For a text list or a list consisting of text and images, **value** indicates the text value of the selected item. For an image list, **value** is empty. - **index**: index of the selected item. |
+| onAccept(callback: (value: string, index: number) => void) | Triggered when the OK button in the dialog box is clicked. - **value**: value of the selected item. - **index**: index of the selected item. **NOTE** This event can be triggered only in the [text picker dialog box](ts-methods-textpicker-dialog.md).|
+| onCancel(callback: () => void) | Triggered when the Cancel button in the dialog box is clicked. **NOTE** This event can be triggered only in the [text picker dialog box](ts-methods-textpicker-dialog.md).|
+| onChange(callback: (value: string, index: number) => void) | Triggered when an item in the picker is selected. - **value**: value of the selected item. **NOTE** For a text list or a list consisting of text and images, **value** indicates the text value of the selected item. For an image list, **value** is empty. - **index**: index of the selected item.|
## Example
diff --git a/en/application-dev/reference/arkui-ts/ts-combined-gestures.md b/en/application-dev/reference/arkui-ts/ts-combined-gestures.md
index 64aae057f5b24c1640fe2765bf6cd2ef2a5745c7..a2dbe152f19a9c7200147b319cd20c5df084b790 100644
--- a/en/application-dev/reference/arkui-ts/ts-combined-gestures.md
+++ b/en/application-dev/reference/arkui-ts/ts-combined-gestures.md
@@ -2,9 +2,9 @@
Continuous recognition, parallel recognition, and exclusive recognition are supported for a group of gestures.
-> **NOTE**
+> **NOTE**
>
-> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
+> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
## APIs
@@ -12,24 +12,24 @@ GestureGroup(mode: GestureMode, ...gesture: GestureType[])
**Parameters**
-| Name| Type| Mandatory| Default Value| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| mode | [GestureMode](#gesturemode) | Yes| - | Recognition mode of combined gestures.|
-| gesture | [TapGesture](ts-basic-gestures-tapgesture.md) \| [LongPressGesture](ts-basic-gestures-longpressgesture.md) \| [PanGesture](ts-basic-gestures-pangesture.md) \| [PinchGesture](ts-basic-gestures-pinchgesture.md) \| [RotationGesture](ts-basic-gestures-rotationgesture.md) | Yes| - | Variable-length parameter, indicating one or more basic gesture types. These gestures are recognized in combination.|
+| Name | Type | Mandatory | Description |
+| ------- | ---------------------------------------- | ---- | ------------------------------ |
+| mode | [GestureMode](#gesturemode) | Yes | Recognition mode of combined gestures. |
+| gesture | [TapGesture](ts-basic-gestures-tapgesture.md) \| [LongPressGesture](ts-basic-gestures-longpressgesture.md) \| [PanGesture](ts-basic-gestures-pangesture.md) \| [PinchGesture](ts-basic-gestures-pinchgesture.md) \| [RotationGesture](ts-basic-gestures-rotationgesture.md) | Yes | Variable-length parameter, indicating one or more basic gesture types. These gestures are recognized in combination.|
## GestureMode
-| Name| Description|
-| -------- | -------- |
-| Sequence | Sequential recognition: Gestures are recognized in the registration sequence until all gestures are recognized successfully. When one gesture fails to be recognized, all gestures fail to be recognized.|
-| Parallel | Parallel recognition. Registered gestures are recognized concurrently until all gestures are recognized. The recognition result of each gesture does not affect each other.|
-| Exclusive | Exclusive recognition. Registered gestures are identified concurrently. If one gesture is successfully recognized, gesture recognition ends.|
+| Name | Description |
+| --------- | ---------------------------------------- |
+| Sequence | Sequential recognition: Gestures are recognized in the registration sequence until all gestures are recognized successfully. When one gesture fails to be recognized, all gestures fail to be recognized.|
+| Parallel | Parallel recognition. Registered gestures are recognized concurrently until all gestures are recognized. The recognition result of each gesture does not affect each other. |
+| Exclusive | Exclusive recognition. Registered gestures are identified concurrently. If one gesture is successfully recognized, gesture recognition ends. |
## Events
-| Name| Description|
-| -------- | -------- |
+| Name | Description |
+| ---------------------------------------- | ------------------------------------ |
| onCancel(event: () => void) | Callback for the GestureMode.Sequence cancellation event.|
@@ -50,6 +50,7 @@ struct GestureGroupExample {
build() {
Column() {
Text('sequence gesture\n' + 'LongPress onAction:' + this.count + '\nPanGesture offset:\nX: ' + this.offsetX + '\n' + 'Y: ' + this.offsetY)
+ .fontSize(15)
}
.translate({ x: this.offsetX, y: this.offsetY, z: 0 })
.height(150)
diff --git a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
index 769ac6cfbc8cef5eb1d07376e29f79fea3794915..074f585449d581ca101922c33d4c1baf92ab7ffd 100644
--- a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
+++ b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
@@ -32,8 +32,7 @@ In addition to the [universal events](ts-universal-events-click.md), the followi
| Name | Parameter | Description |
| ----------------------------- | ---- | -------------------- |
-| onReady(event: () => void) | - | Triggered when a canvas is ready. When this event is triggered, the width and height of the canvas can be obtained, and you can use the canvas APIs to draw images. Since API version 9, this API is supported in ArkTS widgets.|
-
+| onReady(event: () => void) | - | Triggered when a canvas is ready or its size changes. When this event is triggered, the canvas is cleared. The width and height of the canvas can then be obtained, and you can use the canvas APIs to draw images. If the canvas is merely relocated, the **onAreaChange** event is triggered, but the **onReady** event is not. Since API version 9, this API is supported in ArkTS widgets.|
**Example**
diff --git a/en/application-dev/reference/arkui-ts/ts-container-grid.md b/en/application-dev/reference/arkui-ts/ts-container-grid.md
index d70db0cd88744a19259ef30153ae50eff5f49fbe..f301c9b24eb7e972431287906c16d3eecbd87ccb 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-grid.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-grid.md
@@ -48,7 +48,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| rowsTemplate | string | Number of rows in the current grid layout. If this attribute is not set, one row is used by default. For example, **'1fr 1fr 2fr'** indicates three rows, with the first row taking up 1/4 of the parent component's full height, the second row 1/4, and the third row 2/4. **NOTE** If this attribute is set to **'0fr'**, the row width is 0, and grid item in the row is not displayed. If this attribute is set to any other invalid value, the grid item is displayed as one row.|
| columnsGap | [Length](ts-types.md#length) | Gap between columns. Default value: **0** **NOTE** A value less than 0 evaluates to the default value.|
| rowsGap | [Length](ts-types.md#length) | Gap between rows. Default value: **0** **NOTE** A value less than 0 evaluates to the default value.|
-| scrollBar | [BarState](ts-appendix-enums.md#barstate) | Scrollbar status. Default value: **BarState.Off** |
+| scrollBar | [BarState](ts-appendix-enums.md#barstate) | Scrollbar status. Default value: **BarState.Off** **NOTE** In API version 9 and earlier versions, the default value is **BarState.Off**. In API version 10, the default value is **BarState.Auto**.|
| scrollBarColor | string \| number \| [Color](ts-appendix-enums.md#color) | Color of the scrollbar.|
| scrollBarWidth | string \| number | Width of the scrollbar. After the width is set, the scrollbar is displayed with the set width in normal state and pressed state. Default value: **4** Unit: vp|
| cachedCount | number | Number of grid items to be preloaded (cached). It works only in [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md). For details, see [Minimizing White Blocks During Swiping](../../ui/arkts-performance-improvement-recommendation.md#minimizing-white-blocks-during-swiping). Default value: **1** **NOTE** The number of the grid items to be cached before and after the currently displayed one equals the value of **cachedCount** multiplied by the number of columns. Grid items that exceed the display and cache range are released. A value less than 0 evaluates to the default value.|
@@ -59,6 +59,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| cellLength8+ | number | When **layoutDirection** is **Row** or **RowReverse**: fixed height per row. When **layoutDirection** is **Column** or **ColumnReverse**: fixed width per column. Default value: size of the first element|
| multiSelectable8+ | boolean | Whether to enable mouse frame selection. Default value: **false** - **false**: The mouse frame selection is disabled. - **true**: The mouse frame selection is enabled.|
| supportAnimation8+ | boolean | Whether to enable animation. Currently, the grid item drag animation is supported. Default value: **false**|
+| edgeEffect10+ | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | Scroll effect. The spring effect and shadow effect are supported. Default value: **EdgeEffect.None** |
Depending on the settings of the **rowsTemplate** and **columnsTemplate** attributes, the **\** component supports the following layout modes:
@@ -181,6 +182,7 @@ struct GridExample {
.columnsTemplate('1fr 1fr 1fr 1fr 1fr')
.columnsGap(10)
.rowsGap(10)
+ .edgeEffect(EdgeEffect.Spring)
.onScrollIndex((first: number) => {
console.info(first.toString())
})
diff --git a/en/application-dev/reference/arkui-ts/ts-container-list.md b/en/application-dev/reference/arkui-ts/ts-container-list.md
index 25d75ce08f639ab0aeba31c2bf035f4e9a060f1e..678358358c74f05506914cab3349a260f40ecfb8 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-list.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-list.md
@@ -118,7 +118,7 @@ Since API version 9, this API is supported in ArkTS widgets.
> **NOTE**
>
-> To enable the editable mode for a list, the following conditions must be met:
+> To enable the editable mode for a list, the following conditions must be met: (This feature is deprecated since API version 9.)
>
> - **editMode** is set to **true**.
>
@@ -128,7 +128,7 @@ Since API version 9, this API is supported in ArkTS widgets.
>
> To enable dragging for a list item, the following conditions must be met:
>
-> - **editMode** is set to **true**.
+> - **editMode** is set to **true**. (This is not required since API version 9.)
>
> - The list item is bound to the **onDragStart** event and the event returns a floating UI during event callback.
diff --git a/en/application-dev/reference/arkui-ts/ts-container-panel.md b/en/application-dev/reference/arkui-ts/ts-container-panel.md
index f67b201b355af588018e87b35e84844762444ee2..14fe7d33b3a061db80c361c620bd1010c4624806 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-panel.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-panel.md
@@ -11,6 +11,10 @@ The **** component is a slidable panel that presents lightweight content
Supported
+> **NOTE**
+>
+> Built-in components and custom components are allowed, with support for ([if/else](../../quick-start/arkts-rendering-control-ifelse.md), [ForEach](../../quick-start/arkts-rendering-control-foreach.md), and [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md)) rendering control.
+
## APIs
@@ -20,19 +24,20 @@ Panel(show: boolean)
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| show | boolean | Yes| Whether the panel is shown.|
-
+| show | boolean | Yes| Whether the panel is shown. **NOTE** The panel is hidden and does not take up space in the layout if this parameter is set to **false** or [Visible.None](ts-universal-attributes-visibility.md) is set.|
## Attributes
+In addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported.
+
| Name| Type| Description|
| -------- | -------- | -------- |
| type | [PanelType](#paneltype)| Type of the panel. Default value: **PanelType.Foldable**|
-| mode | [PanelMode](#panelmode) | Initial status of the panel.|
+| mode | [PanelMode](#panelmode) | Initial status of the panel. Default value for the Minibar type: **PanelMode.Mini** Default value for other types: **PanelMode.Half** Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables. |
| dragBar | boolean | Whether to enable a drag bar. The value **true** means that the drag bar will be displayed, and **false** means the opposite. Default value: **true**|
-| fullHeight | string \| number | Panel height in the **PanelMode.Full** mode.|
-| halfHeight | string \| number | Panel height in the **PanelMode.Half** mode. The default value is half of the screen height.|
-| miniHeight | string \| number | Panel height in the **PanelMode.Mini** mode.|
+| fullHeight | string \| number | Panel height in the **PanelMode.Full** mode. Default value: main axis height of the panel minus 8 vp **NOTE** This attribute cannot be set in percentage.|
+| halfHeight | string \| number | Panel height in the **PanelMode.Half** mode. Default value: half of the main axis height of the panel **NOTE** This attribute cannot be set in percentage.|
+| miniHeight | string \| number | Panel height in the **PanelMode.Mini** mode. Default value: **48** Unit: vp **NOTE** This attribute cannot be set in percentage.|
| show | boolean | Whether to show the panel.|
| backgroundMask9+ |[ResourceColor](ts-types.md#resourcecolor)|Background mask of the panel.|
@@ -52,9 +57,10 @@ Panel(show: boolean)
| Half | Displays a **foldable** or **temporary** panel in a medium-sized (halfscreen-like) area. This attribute does not take effect for **minibar** panels.|
| Full | Displays a panel in a large (fullscreen-like) area.|
-
## Events
+In addition to the [universal events](ts-universal-events-click.md), the following events are supported.
+
| Name| Description|
| -------- | -------- |
| onChange(event: (width: number, height: number, mode: PanelMode) => void) | Triggered when the status of the panel changes. The returned height value is the height of the content area. When the value of **dragBar** is **true**, the panel height is the sum of the drag bar height and content area height.|
diff --git a/en/application-dev/reference/arkui-ts/ts-container-refresh.md b/en/application-dev/reference/arkui-ts/ts-container-refresh.md
index 02e9c2172db36df28211c3d987d68a32b147a147..77287de6608733fa583edce70b08322f4aace509 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-refresh.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-refresh.md
@@ -18,32 +18,36 @@ Refresh\(value: \{ refreshing: boolean, offset?: number | string , friction?: n
**Parameters**
-| Name| Value Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| refreshing | boolean | Yes| Whether the current component is being refreshed. This parameter supports [$$](../../quick-start/arkts-restrictions-and-extensions.md#two-way-binding-of-variables) for two-way binding of variables.|
-| offset | string \| number | No| Distance from the pull-down starting point to the top of the component. Default value: **16**, in vp **NOTE** The value cannot be a percentage or a negative number.|
-| friction | number \| string | No| Coefficient of friction, which indicates the **** component's sensitivity to the pull-down gesture. The value ranges from 0 to 100. Default value: **62** - **0** indicates that the **\** component is not sensitive to the pull-down gesture. - **100** indicates that the **\** component is highly sensitive to the pull-down gesture. - A larger value indicates a more sensitive response of the **\** component to the pull-down gesture.|
-| builder | [CustomBuilder](ts-types.md#custombuilder8)10+ | No| Component with the custom refresh style set for the pull-down gesture.|
+| Name | Value Type | Mandatory | Description |
+| ---------- | ---------------------------------------- | ---- | ---------------------------------------- |
+| refreshing | boolean | Yes | Whether the current component is being refreshed. This parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.|
+| offset | string \| number | No | Distance from the pull-down starting point to the top of the component. Default value: **16**, in vp **NOTE** The value cannot be a percentage or a negative number.|
+| friction | number \| string | No | Coefficient of friction, which indicates the **** component's sensitivity to the pull-down gesture. The value ranges from 0 to 100. Default value: **62** - **0** indicates that the **\** component is not sensitive to the pull-down gesture. - **100** indicates that the **\** component is highly sensitive to the pull-down gesture. - A larger value indicates a more sensitive response of the **\** component to the pull-down gesture.|
+| builder | [CustomBuilder](ts-types.md#custombuilder8)10+ | No | Component with the custom refresh style set for the pull-down gesture. |
+## Attributes
+The [universal attributes](ts-universal-attributes-size.md) are supported.
## Events
+In addition to the [universal events](ts-universal-events-click.md), the following events are supported.
-| Name| Description|
-| -------- | -------- |
+
+| Name | Description |
+| ---------------------------------------- | -------------------------------------- |
| onStateChange(callback: (state: [RefreshStatus](#refreshstatus)) => void)| Triggered when the refresh status changes. - **state**: refresh status.|
-| onRefreshing(callback: () => void)| Triggered when the component enters the refresh state.|
+| onRefreshing(callback: () => void) | Triggered when the component enters the refresh state. |
## RefreshStatus
-| Name| Description|
-| -------- | -------- |
-| Inactive | The component is not pulled down. This is the default value.|
-| Drag | The component is being pulled down, but the pulled distance is shorter than the minimum length required to trigger the refresh.|
-| OverDrag | The component is being pulled down, and the pulled distance exceeds the minimum length required to trigger the refresh.|
-| Refresh | The pull-down ends, and the component rebounds to the minimum length required to trigger the refresh and enters the refresh state.|
-| Done | The refresh is complete, and the component returns to the initial state (top).|
+| Name | Description |
+| -------- | -------------------- |
+| Inactive | The component is not pulled down. This is the default value. |
+| Drag | The component is being pulled down, but the pulled distance is shorter than the minimum length required to trigger the refresh. |
+| OverDrag | The component is being pulled down, and the pulled distance exceeds the minimum length required to trigger the refresh. |
+| Refresh | The pull-down ends, and the component rebounds to the minimum length required to trigger the refresh and enters the refresh state.|
+| Done | The refresh is complete, and the component returns to the initial state (top). |
## Example
diff --git a/en/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md b/en/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
index 86400597c389b6b30ec1dff940b657e53e25ca26..c095761bafda868074d0c4dc1a2ccb8a55829ddf 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
@@ -11,6 +11,12 @@ The **\** component contains a sidebar and content area as its
Supported
+> **NOTE**
+>
+> - Built-in components and custom components are allowed, without support for ([if/else](../../quick-start/arkts-rendering-control-ifelse.md), [ForEach](../../quick-start/arkts-rendering-control-foreach.md), and [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md)) rendering control.
+> - This component must contain two child components.
+> - If there are three or more child components, only the first and second child components are displayed. If there is only one child component, the sidebar is displayed, and the content area is blank.
+
## APIs
@@ -31,27 +37,29 @@ SideBarContainer( type?: SideBarContainerType )
## Attributes
+In addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported.
+
| Name| Type| Description|
| -------- | -------- | -------- |
-| showSideBar | boolean | Whether to display the sidebar. Default value: **true**|
-| controlButton | ButtonStyle | Attributes of the sidebar control button.|
+| showSideBar | boolean | Whether to display the sidebar. Default value: **true** Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.|
+| controlButton | [ButtonStyle](#buttonstyle) | Attributes of the sidebar control button.|
| showControlButton | boolean | Whether to display the sidebar control button. Default value: **true**|
-| sideBarWidth | number \| Length9+ | Width of the sidebar. Default value: **200**, in vp|
-| minSideBarWidth | number \| Length9+ | Minimum width of the sidebar. Default value: **200**, in vp|
-| maxSideBarWidth | number \| Length9+ | Maximum width of the sidebar. Default value: **280**, in vp|
-| autoHide9+ | boolean | Whether to automatically hide the sidebar when it is dragged to be smaller than the minimum width. Default value: **true**|
-| sideBarPosition9+ | SideBarPosition | Position of the sidebar. Default value: **SideBarPosition.Start**|
+| sideBarWidth | number \| [Length](ts-types.md#length)9+ | Width of the sidebar. Default value: **200** Unit: vp **NOTE** A value less than 0 evaluates to the default value. The value must comply with the width constraints. If it is not within the valid range, the value closest to the set one is used. When set, the width of the sidebar takes precedence over that of the sidebar child components. If it is not set, however, the width of the sidebar child component takes precedence.|
+| minSideBarWidth | number \| [Length](ts-types.md#length)9+ | Minimum width of the sidebar. Default value: **200**, in vp **NOTE** A value less than 0 evaluates to the default value. The value cannot exceed the width of the sidebar container itself. Otherwise, the width of the sidebar container itself is used. When set, the minimum width of the sidebar takes precedence over that of the sidebar child components. If it is not set, however, the minimum width of the sidebar child component takes precedence.|
+| maxSideBarWidth | number \| [Length](ts-types.md#length)9+ | Maximum width of the sidebar. Default value: **280**, in vp **NOTE** A value less than 0 evaluates to the default value. The value cannot exceed the width of the sidebar container itself. Otherwise, the width of the sidebar container itself is used. When set, the maximum width of the sidebar takes precedence over that of the sidebar child components. If it is not set, however, the maximum width of the sidebar child component takes precedence.|
+| autoHide9+ | boolean | Whether to automatically hide the sidebar when it is dragged to be smaller than the minimum width. Default value: **true** **NOTE** The value is subject to the **minSideBarWidth** attribute method. If it is not set in **minSideBarWidth**, the default value is used. Whether the sidebar should be hidden is determined when it is being dragged. When its width is less than the minimum width, the damping effect is required to trigger hiding (a distance out of range).|
+| sideBarPosition9+ | [SideBarPosition](#sidebarposition9) | Position of the sidebar. Default value: **SideBarPosition.Start**|
| divider10+ | [DividerStyle](#dividerstyle10) \| null | Divider style. - **DividerStyle** (default): The divider is displayed. - **null**: The divider is not displayed.|
## ButtonStyle
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| left | number | No| Spacing between the sidebar control button and the left of the container. Default value: **16**, in vp|
-| top | number | No| Spacing between the sidebar control button and the top of the container. Default value: **48**, in vp|
-| width | number | No| Width of the sidebar control button. Default value: **32**, in vp|
-| height | number | No| Height of the sidebar control button. Default value: **32**, in vp|
-| icons | { shown: string \| PixelMap \| [Resource](ts-types.md) , hidden: string \| PixelMap \| [Resource](ts-types.md) , switching?: string \| PixelMap \| [Resource](ts-types.md) } | No| Icons of the sidebar control button.
- **shown**: icon of the control button when the sidebar is shown. - **hidden**: icon of the control button when the sidebar is hidden. - **switching**: icon of the control button when the sidebar is switching between the shown and hidden states.|
+| left | number | No| Spacing between the sidebar control button and the left of the container. Default value: **16** Unit: vp|
+| top | number | No| Spacing between the sidebar control button and the top of the container. Default value: **48** Unit: vp|
+| width | number | No| Width of the sidebar control button. Default value: **32** Unit: vp|
+| height | number | No| Height of the sidebar control button. Default value: **32** Unit: vp|
+| icons | { shown: string \| PixelMap \| [Resource](ts-types.md) , hidden: string \| PixelMap \| [Resource](ts-types.md) , switching?: string \| PixelMap \| [Resource](ts-types.md) } | No| Icons of the sidebar control button. - **shown**: icon of the control button when the sidebar is shown. **NOTE** When an error occurs during resource obtaining, the default icon is used. - **hidden**: icon of the control button when the sidebar is hidden. - **switching**: icon of the control button when the sidebar is switching between the shown and hidden states.|
## SideBarPosition9+
@@ -64,16 +72,29 @@ SideBarContainer( type?: SideBarContainerType )
| Name | Type | Mandatory| Description |
| ----------- | ------------- | ---- | ---------------------------------------- |
-| strokeWidth | [Length](ts-types.md#length) | Yes | Stroke width of the divider. Default value: **1**, in vp |
+| strokeWidth | [Length](ts-types.md#length) | Yes | Stroke width of the divider. Default value: **1** Unit: vp|
| color | [ResourceColor](ts-types.md#resourcecolor) | No | Color of the divider. Default value: **#000000, 3%** |
| startMargin | [Length](ts-types.md#length) | No | Distance between the divider and the top of the sidebar. Default value: **0**|
| endMargin | [Length](ts-types.md#length) | No | Distance between the divider and the bottom of the sidebar. Default value: **0**|
+> **NOTE**
+>
+> When the universal attributes [width and height](ts-universal-attributes-size.md) are set for the sidebar, the **width** setting takes effect only when the sidebar container width is not set, and the **height** settings does not take effect.
+> The settings of the universal attributes **width** and **height** do not take effect for the sidebar content area. By default, sidebar content area takes up the remaining space of the sidebar container.
+>
+> If the attribute method is not used, the sidebar is displayed depending on the size.
+>
+> - If the size is less than 520 vp, the sidebar is not displayed by default.
+> - If the size is greater than or equal to 520 vp, the sidebar is displayed by default.
+> -
+> -
## Events
+In addition to the [universal events](ts-universal-events-click.md), the following events are supported.
+
| Name| Description|
| -------- | -------- |
-| onChange(callback: (value: boolean) => void) | Triggered when the status of the sidebar switches between shown and hidden. The value **true** means that the sidebar is shown, and **false** means the opposite.|
+| onChange(callback: (value: boolean) => void) | Triggered when the status of the sidebar switches between shown and hidden. The value **true** means that the sidebar is displayed, and **false** means the opposite. This event is triggered when any of the following conditions is met: 1. The value of **showSideBar** changes. 2. The **showSideBar** attribute adapts to behavior changes. 3. The **autoHide** API is triggered when the divider is dragged.|
## Example
@@ -83,14 +104,13 @@ SideBarContainer( type?: SideBarContainerType )
@Entry
@Component
struct SideBarContainerExample {
- normalIcon : Resource = $r("app.media.icon")
+ normalIcon: Resource = $r("app.media.icon")
selectedIcon: Resource = $r("app.media.icon")
@State arr: number[] = [1, 2, 3]
@State current: number = 1
build() {
- SideBarContainer(SideBarContainerType.Embed)
- {
+ SideBarContainer(SideBarContainerType.Embed) {
Column() {
ForEach(this.arr, (item, index) => {
Column({ space: 5 }) {
@@ -115,6 +135,13 @@ struct SideBarContainerExample {
}
.margin({ top: 50, left: 20, right: 30 })
}
+ .controlButton({
+ icons: {
+ hidden: $r('app.media.drawer'),
+ shown: $r('app.media.drawer'),
+ switching: $r('app.media.drawer')
+ }
+ })
.sideBarWidth(150)
.minSideBarWidth(50)
.maxSideBarWidth(300)
diff --git a/en/application-dev/reference/arkui-ts/ts-container-swiper.md b/en/application-dev/reference/arkui-ts/ts-container-swiper.md
index 2f224afc0377281c20ee36a638b5862a39096106..fdf1227af8f71876d7d1207bf2f205e3fcc053e3 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-swiper.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-swiper.md
@@ -11,6 +11,10 @@
This component can contain child components.
+> **NOTE**
+>
+> Built-in components and custom components are allowed, with support for ([if/else](../../quick-start/arkts-rendering-control-ifelse.md), [ForEach](../../quick-start/arkts-rendering-control-foreach.md), and [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md)) rendering control.
+
## APIs
@@ -29,21 +33,23 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| Name | Type | Description |
| --------------------------- | ---------------------------------------- | ---------------------------------------- |
-| index | number | Index of the child component currently displayed in the container. Default value: **0** |
-| autoPlay | boolean | Whether to enable automatic playback for child component switching. Default value: **false** |
+| index | number | Index of the child component currently displayed in the container. Default value: **0** **NOTE** If the value is less than 0 or greater than or equal to the number of child components, the default value **0** is used. Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.|
+| autoPlay | boolean | Whether to enable automatic playback for child component switching. Default value: **false** **NOTE** If **loop** is set to **false**, the playback stops when the last page is displayed. The playback continues when the page is not the last page after a swipe gesture.|
| interval | number | Interval for automatic playback, in ms. Default value: **3000** |
-| indicator | boolean | Whether to enable the navigation dots indicator. Default value: **true** |
+| indicator10+ | [DotIndicator](#dotindicator) \| [DigitIndicator](#digitindicator) \| boolean | Style of the navigation point indicator. \- **DotIndicator**: dot style. \- **DigitIndicator**: digit style. \- **boolean**: whether to enable the navigation point indicator. Default value: **true** Default type: **DotIndicator**|
| loop | boolean | Whether to enable loop playback. The value **true** means to enable loop playback. When LazyForEach is used, it is recommended that the number of the components to load exceed 5. Default value: **true**|
| duration | number | Duration of the animation for switching child components, in ms. Default value: **400** |
| vertical | boolean | Whether vertical swiping is used. Default value: **false** |
-| itemSpace | number \| string | Space between child components. Default value: **0** |
+| itemSpace | number \| string | Space between child components. Default value: **0** **NOTE** This parameter cannot be set in percentage.|
| displayMode | SwiperDisplayMode | Mode in which elements are displayed along the main axis. This attribute takes effect only when **displayCount** is not set. Default value: **SwiperDisplayMode.Stretch**|
-| cachedCount8+ | number | Number of child components to be cached. Default value: **1** |
+| cachedCount8+ | number | Number of child components to be cached. Default value: **1** **NOTE** **cachedCount** has caching optimized. You are advised not to use it together with [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md).|
| disableSwipe8+ | boolean | Whether to disable the swipe feature. Default value: **false** |
| curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | Animation curve. The ease-in/ease-out curve is used by default. For details about common curves, see [Curve](ts-appendix-enums.md#curve). You can also create custom curves (interpolation curve objects) by using the API provided by the [interpolation calculation](../apis/js-apis-curve.md) module. Default value: **Curve.Ease**|
-| indicatorStyle8+ | { left?: [Length](ts-types.md#length), top?: [Length](ts-types.md#length), right?: [Length](ts-types.md#length), bottom?: [Length](ts-types.md#length), size?: [Length](ts-types.md#length), mask?: boolean, color?: [ResourceColor](ts-types.md), selectedColor?: [ResourceColor](ts-types.md) } | Style of the navigation dots indicator. \- **left**: distance between the navigation dots indicator and the left edge of the **\** component. \- **top**: distance between the navigation dots indicator and the top edge of the **\** component. \- **right**: distance between the navigation dots indicator and the right edge of the **\** component. \- **bottom**: distance between the navigation dots indicator and the bottom edge of the **\** component. \- **size**: diameter of the navigation dots indicator. \- **mask**: whether to enable the mask for the navigation dots indicator. \- **color**: color of the navigation dots indicator. \- **selectedColor**: color of the selected navigation dot.|
-| displayCount8+ | number\|string | Number of elements to display per page. Default value: **1** |
-| effectMode8+ | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | Swipe effect. For details, see **EdgeEffect**. Default value: **EdgeEffect.Spring**|
+| indicatorStyle8+ | { left?: [Length](ts-types.md#length), top?: [Length](ts-types.md#length), right?: [Length](ts-types.md#length), bottom?: [Length](ts-types.md#length), size?: [Length](ts-types.md#length), mask?: boolean, color?: [ResourceColor](ts-types.md), selectedColor?: [ResourceColor](ts-types.md) } | Style of the navigation point indicator. \- **left**: distance between the navigation point indicator and the left edge of the **\** component. \- **top**: distance between the navigation point indicator and the top edge of the **\** component. \- **right**: distance between the navigation point indicator and the right edge of the **\** component. \- **bottom**: distance between the navigation point indicator and the bottom edge of the **\** component. \- **size**: diameter of the navigation point indicator. \- **mask**: whether to enable the mask for the navigation point indicator. \- **color**: color of the navigation point indicator. \- **selectedColor**: color of the selected navigation dot.|
+| displayCount8+ | number \| string | Number of elements to display per page. Default value: **1** **NOTE** If the value is of the string type, it can only be **'auto'**, whose display effect is the same as that of **SwiperDisplayMode.AutoLinear**. If the value is of the number type, child components stretch (shrink) on the main axis after the swiper width [deducting the result of itemSpace x (displayCount – 1)] is evenly distributed among them on the main axis.|
+| effectMode8+ | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | Swipe effect. For details, see **EdgeEffect**. Default value: **EdgeEffect.Spring** **NOTE** The spring effect does not take effect when the controller API is called.|
+| nextMargin10+ | [Length](ts-types.md#length) | Next margin, used to reveal a small part of the next item. Default value: **0** **NOTE** This parameter is valid only when **SwiperDisplayMode** is set to **STRETCH**. If **cachedCount** is set to a value less than or equal to 0, a small part of the next item is displayed, but child components cannot be loaded. |
+| prevMargin10+ | [Length](ts-types.md#length) | Previous margin, used to reveal a small part of the previous item. Default value: **0** **NOTE** This parameter is valid only when **SwiperDisplayMode** is set to **STRETCH**. If **cachedCount** is set to a value less than or equal to 0, a small part of the previous item is displayed, but child components cannot be loaded. |
## SwiperDisplayMode
@@ -60,13 +66,13 @@ Controller of the **\** component. You can bind this object to the **\ void | No | Callback invoked when the animation stops.|
-## Events
+## Indicator10+
-### onChange
+Sets the distance between the navigation point indicator and the **\** component.
-onChange(event: (index: number) => void)
+| Name| Type| Mandatory.| Description |
+| ------ | -------- | ------ | ------------------------------------ |
+| left | [Length](ts-types.md#length) | No | Distance between the navigation point indicator and the left edge of the **\** component.|
+| top | [Length](ts-types.md#length) | No | Distance between the navigation point indicator and the top edge of the **\** component.|
+| right | [Length](ts-types.md#length) | No | Distance between the navigation point indicator and the right edge of the **\** component.|
+| bottom | [Length](ts-types.md#length) | No | Distance between the navigation point indicator and the bottom edge of the **\** component.|
-Triggered when the index of the currently displayed child component changes.
+### DotIndicator
-> **NOTE**
->
-> When the **\** component is used together with **LazyForEach**, the subpage UI cannot be refreshed in the **onChange** event.
+Defines the navigation point indicator of the dot style, which inherits attributes and features from **Indicator**.
+
+| Name | Type | Mandatory.| Description |
+| ------------------ | ------------- | ------ | ------------------------------------------------------ |
+| itemWidth | [Length](ts-types.md#length) | No | Width of the navigation point indicator of the dot style. Default value: **6** Unit: vp|
+| itemHeight | [Length](ts-types.md#length) | No | Height of the navigation point indicator of the dot style. Default value: **6** Unit: vp|
+| selectedItemWidth | [Length](ts-types.md#length) | No | Width of the selected indicator dot. Default value: **6** Unit: vp|
+| selectedItemHeight | [Length](ts-types.md#length) | No | Height of the selected indicator dot. Default value: **6** Unit: vp|
+| mask | boolean | No | Whether to enable the mask for the navigation point indicator of the dot style. Default value: **false**|
+| color | [ResourceColor](ts-types.md#resourcecolor) | No | Color of the navigation point indicator of the dot style. Default value: **'\#007DFF'**|
+| selectedColor | [ResourceColor](ts-types.md#resourcecolor) | No | Color of the selected indicator dot. Default value: **'\#182431'** (10% opacity)|
-**Return value**
+### DigitIndicator
+
+Defines the navigation point indicator of the digit style, which inherits attributes and features from **Indicator**.
+
+| Name | Type | Mandatory.| Description |
+| ----------------- | ------------------------------------------------------------ | ------ | ------------------------------------------------------------ |
+| fontColor | [ResourceColor](ts-types.md#resourcecolor) | No | Font color of the navigation point indicator of the digit style. Default value: **'\#ff182431'**|
+| selectedFontColor | [ResourceColor](ts-types.md#resourcecolor) | No | Font color of the selected indicator digit. Default value: **'\#ff182431'**|
+| digitFont | { size?:[Length](ts-types.md#length) weight?:number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string } | No | Font style of the navigation point indicator of the digit style. \- **size**: font size. Default value: **14vp** \- **weight**: font weight.|
+| selectedDigitFont | { size?:[Length](ts-types.md#length) weight?:number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string } | No | Font style of the selected indicator digit. \- **size**: font size. Default value: **14vp** \- **weight**: font weight.|
+
+## Events
-| Name | Type | Description|
-| --------- | ---------- | -------- |
-| index | number | Index of the currently displayed element.|
+In addition to the [universal events](ts-universal-events-click.md), the following events are supported.
+| Name | Description |
+| ------------------------------------------------------------ | ------------------------------------------------------------ |
+| onChange(event: (index: number) => void) | Triggered when the index of the currently displayed child component changes. - **index**: index of the currently displayed element. **NOTE** When the **\** component is used together with **LazyForEach**, the subpage UI update cannot be triggered in the **onChange** event.|
+| onAnimationStart9+ (event: (index: number) => void) | Triggered when the switching animation starts. - **index**: index of the currently displayed element. **NOTE** The **index** parameter indicates the index before the animation starts (not the one after). When the **\** component contains multiple columns, the index is of the leftmost element.|
+| onAnimationEnd9+ (event: (index: number) => void) | Triggered when the switching animation ends. - **index**: index of the currently displayed element. **NOTE** This event is triggered when the animation ends regardless of whether it is due to a user gesture or invocation of **finishAnimation** through **SwiperController**. The **index** parameter indicates the index after the animation ends. When the **\** component contains multiple columns, the index is of the leftmost element.|
## Example
diff --git a/en/application-dev/reference/arkui-ts/ts-container-tabcontent.md b/en/application-dev/reference/arkui-ts/ts-container-tabcontent.md
index 677690cdc8d8b6d05c2e7927f205a9569942f217..e72c5eb5c4eb4c0a9621d92feb10a5bd69082935 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-tabcontent.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-tabcontent.md
@@ -13,7 +13,7 @@ This component supports only one child component.
> **NOTE**
>
-> System components and custom components can be built in, and rendering control types ([if/else](../../quick-start/arkts-rendering-control-ifelse.md), [ForEach](../../quick-start/arkts-rendering-control-foreach.md), and [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md)) are supported.
+> Built-in components and custom components are allowed, with support for ([if/else](../../quick-start/arkts-rendering-control-ifelse.md), [ForEach](../../quick-start/arkts-rendering-control-foreach.md), and [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md)) rendering control.
## APIs
@@ -28,7 +28,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| Name| Type| Description|
| -------- | -------- | -------- |
| tabBar | string \| Resource \| { icon?: string \| Resource, text?: string \| Resource } \| [CustomBuilder](ts-types.md)8+ | Content displayed on the tab bar. **CustomBuilder**: builder, to which components can be passed (applicable to API version 8 and later versions). **NOTE** If an icon uses an SVG image, the width and height attributes of the SVG image must be deleted. Otherwise, the icon size will be determined by the width and height attributes of the SVG image. If the content set exceeds the space provided by the tab bar, it will be clipped.|
-| tabBar9+ | [SubTabBarStyle](#subtabbarstyle9) \| [BottomTabBarStyle](#bottomtabbarstyle9) | Content displayed on the tab bar. **SubTabBarStyle**: subtab style. It takes text as its input parameter. **BottomTabBarStyle**: bottom and side tab style. It takes text and images as its input parameters. **NOTE** The bottom tab style does not include an underline. When an icon display error occurs, a gray blank block is displayed.|
+| tabBar9+ | [SubTabBarStyle](#subtabbarstyle) \| [BottomTabBarStyle](#bottomtabbarstyle) | Content displayed on the tab bar. **SubTabBarStyle**: subtab style. It takes text as its input parameter. **BottomTabBarStyle**: bottom and side tab style. It takes text and images as its input parameters. **NOTE** The bottom tab style does not include an underline. When an icon display error occurs, a gray blank block is displayed.|
> **NOTE**
>
diff --git a/en/application-dev/reference/arkui-ts/ts-container-tabs.md b/en/application-dev/reference/arkui-ts/ts-container-tabs.md
index e33252888cc0e8c2a5cffebab76b519e6b20e824..0acc1c38aa5efa22aa3184facbf3c8ff69d154a7 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-tabs.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-tabs.md
@@ -18,11 +18,11 @@ Tabs(value?: {barPosition?: BarPosition, index?: number, controller?: [TabsContr
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----------- | --------------------------------- | ---- | ---------------------------------------- |
-| barPosition | BarPosition | No | Position of the **\** component. Default value: **BarPosition.Start** |
-| index | number | No | Initial tab index. Default value: **0** **NOTE** A value less than 0 evaluates to the default value. The value ranges from 0 to the number of **\** subnodes minus 1. When this parameter is set to different values, the slide animation for tab switching is enabled by default. To disable the animation, set **animationDuration** to **0**. |
-| controller | [TabsController](#tabscontroller) | No | Tab controller. |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------------- | ---- | ------------------------------------------------------------ |
+| barPosition | BarPosition | No | Position of the **\** component. Default value: **BarPosition.Start** |
+| index | number | No | Initial tab index. Default value: **0** **NOTE** A value less than 0 evaluates to the default value. The value ranges from 0 to the number of **\** subnodes minus 1. When this parameter is set to different values, the slide animation for tab switching is enabled by default. To disable the animation, set **animationDuration** to **0**. Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.|
+| controller | [TabsController](#tabscontroller) | No | Tab controller. |
## BarPosition
@@ -42,7 +42,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| scrollable | boolean | Whether the tabs are scrollable. The value **true** means that the tabs are scrollable, and **false** means the opposite. Default value: **true**|
| barMode | BarMode | Tab bar layout mode. For details, see **BarMode**. Default value: **BarMode.Fixed**|
| barWidth | number \| Length8+ | Width of the tab bar. **NOTE** A value less than 0 or greater than the width of the **\** component evaluates to the default value.|
-| barHeight | number \| Length8+ | Height of the tab bar. **NOTE** A value less than 0 or greater than the width of the **\** component evaluates to the default value.|
+| barHeight | number \| Length8+ | Height of the tab bar. **NOTE** A value less than 0 or greater than the width of the **\** component evaluates to the default value. |
| animationDuration | number | Duration of the slide animation for tab switching. If this parameter is set, the tab switching animation is played when the user switches between tabs by sliding or clicking. If this parameter is not set, the tab switching animation is played only when the user switches between tabs by sliding. Default value: **300** **NOTE** A value less than 0 or in percentage evaluates to the default value.|
| divider10+ | [DividerStyle](#dividerstyle10) \| null | Whether the divider is displayed for the **\** and **\** components and the divider style. By default, the divider is not displayed. **DividerStyle**: divider style. **null**: The divider is not displayed.|
| fadingEdge10+ | boolean | Whether the tab fades out when it exceeds the container width. Default value: **true** |
@@ -158,4 +158,3 @@ struct TabsExample {
```

-
\ No newline at end of file
diff --git a/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md b/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md
index 0f15335b6b4ba61a18b6ebe632e08a6f7fd7ea2c..343b5b85365a51387a3dada28d87029a831594f7 100644
--- a/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md
+++ b/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md
@@ -16,19 +16,19 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () => void, aut
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------------------- | ---------------------------------------- | ------------------------- | ---------------------- |
-| builder | [CustomDialog](../../quick-start/arkts-dynamic-ui-elememt-building.md#customdialog) | Yes | Constructor of the custom dialog box content. |
-| cancel | () => void | No | Callback invoked when the dialog box is closed after the overlay exits. |
-| autoCancel | boolean | No | Whether to allow users to click the overlay to exit. Default value: **true** |
-| alignment | [DialogAlignment](ts-methods-alert-dialog-box.md#dialogalignment) | No | Alignment mode of the dialog box in the vertical direction. Default value: **DialogAlignment.Default** |
-| offset | [Offset](ts-types.md#offset) | No | Offset of the dialog box relative to the alignment position.|
-| customStyle | boolean | No | Whether to use a custom style for the dialog box. Default value: **false**, which means that the dialog box automatically adapts its width to the grid system and its height to the child components; the maximum height is 90% of the container height; the rounded corner is 24 vp. |
-| gridCount8+ | number | No | Number of [grid columns](../../ui/ui-ts-layout-grid-container-new.md) occupied by the dialog box. The default value is 4, and the maximum value is the maximum number of columns supported by the system. If this parameter is set to an invalid value, the default value is used.|
-| maskColor10+ | [ResourceColor](ts-types.md#resourcecolor) | No | Custom mask color. Default value: **0x33000000** |
-| openAnimation10+ | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the open animation of the dialog box. **NOTE** If **iterations** is set to an odd number and **playMode** is set to **Reverse**, the dialog box will not be displayed when the animation ends. |
-| closeAniamtion10+ | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the close animation of the dialog box. |
-| showInSubWindow10+ | boolean | No | Whether to display a dialog box in a subwindow. Default value: **false**, indicating that the dialog box is not displayed in the subwindow **NOTE** A dialog box whose **showInSubWindow** attribute is **true** cannot trigger the display of another dialog box whose **showInSubWindow** attribute is also **true**. |
+| Name | Type | Mandatory | Description |
+| ----------------------------- | ---------------------------------------- | ---- | ---------------------------------------- |
+| builder | CustomDialog | Yes | Constructor of the custom dialog box content. |
+| cancel | () => void | No | Callback invoked when the dialog box is closed after the overlay exits. |
+| autoCancel | boolean | No | Whether to allow users to click the overlay to exit. Default value: **true** |
+| alignment | [DialogAlignment](ts-methods-alert-dialog-box.md#dialogalignment) | No | Alignment mode of the dialog box in the vertical direction. Default value: **DialogAlignment.Default**|
+| offset | [Offset](ts-types.md#offset) | No | Offset of the dialog box relative to the alignment position. |
+| customStyle | boolean | No | Whether to use a custom style for the dialog box. Default value: **false**, which means that the dialog box automatically adapts its width to the grid system and its height to the child components; the maximum height is 90% of the container height; the rounded corner is 24 vp.|
+| gridCount8+ | number | No | Number of [grid columns](../../ui/arkts-layout-development-grid-layout.md) occupied by the dialog box. The default value is 4, and the maximum value is the maximum number of columns supported by the system. If this parameter is set to an invalid value, the default value is used.|
+| maskColor10+ | [ResourceColor](ts-types.md#resourcecolor) | No | Custom mask color. Default value: **0x33000000** |
+| openAnimation10+ | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the open animation of the dialog box. **NOTE** If **iterations** is set to an odd number and **playMode** is set to **Reverse**, the dialog box will not be displayed when the animation ends.|
+| closeAniamtion10+ | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the close animation of the dialog box. |
+| showInSubWindow10+ | boolean | No | Whether to display a dialog box in a subwindow. Default value: **false**, indicating that the dialog box is not displayed in the subwindow **NOTE** A dialog box whose **showInSubWindow** attribute is **true** cannot trigger the display of another dialog box whose **showInSubWindow** attribute is also **true**.|
## CustomDialogController
@@ -38,7 +38,7 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () => void, aut
dialogController : CustomDialogController = new CustomDialogController(value:{builder: CustomDialog, cancel?: () => void, autoCancel?: boolean})
```
> **NOTE**
->
+>
> **CustomDialogController** is valid only when it is a member variable of the **@CustomDialog** and **@Component** decorated struct and is defined in the **@Component** decorated struct. For details, see the following example.
### open()
diff --git a/en/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md b/en/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
index 4c996f22ce50e78e700feef8e334d0961579af7e..f513d46ae5849a33ed8c1eb8c4b7255e4c8403cf 100644
--- a/en/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
+++ b/en/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
@@ -2215,7 +2215,7 @@ Since API version 9, this API is supported in ArkTS widgets.
**Parameters**
-| Parameters | Type | Mandatory | Default Value | Description |
+| Name | Type | Mandatory | Default Value | Description |
| ---- | ------ | ---- | ---- | ------------- |
| sw | number | Yes | 0 | Width of the **ImageData** object.|
| sh | number | Yes | 0 | Height of the **ImageData** object.|
diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md
index e9f1c5c337d47121ada8673d82f832f68a075134..0e588d01fb33704f46f3c33170df2de151020cf7 100644
--- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md
+++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md
@@ -10,45 +10,46 @@ You can bind a popup to a component, specifying its content, interaction logic,
## APIs
-| Name | Type | Description |
-| ---------- | ------------------------------------- | --------------------------------------- |
-| bindPopup | show: boolean, popup: [PopupOptions](#popupoptions) \| [CustomPopupOptions](#custompopupoptions8)8+ | Binds a popup to the component. **show**: whether to show the popup. The default value is **false**, indicating that the popup is hidden. **popup**: parameters of the popup.|
+| Name | Type | Description |
+| --------- | ---------------------------------------- | ---------------------------------------- |
+| bindPopup | show: boolean, popup: [PopupOptions](#popupoptions) \| [CustomPopupOptions](#custompopupoptions8)8+ | Binds a popup to the component. **show**: whether to show the popup. The default value is **false**, indicating that the popup is hidden. **popup**: parameters of the popup.|
## PopupOptions
-| Name | Type | Mandatory | Description |
-| -------------------------| ------------------------------------------------| -----| ----------------------------------------- |
-| message | string | Yes | Content of the popup message. |
-| placementOnTop | boolean | No | Whether to display the popup above the component. Default value: **false** |
-| primaryButton | { value: string, action: () => void } | No | Primary button. **value**: text of the primary button in the popup. **action**: callback for clicking the primary button.|
-| secondaryButton | { value: string, action: () => void } | No | Secondary button. **value**: text of the secondary button in the popup. **action**: callback for clicking the secondary button.|
-| onStateChange | (event: { isVisible: boolean }) => void | No | Callback for the popup status change event. **isVisible**: whether the popup is visible. |
-| arrowOffset9+ | [Length](ts-types.md#length) | No | Offset of the popup arrow relative to the popup. When the arrow is at the top or bottom of the popup: The value **0** indicates that the arrow is located on the leftmost, and any other value indicates the distance from the arrow to the leftmost; the arrow is centered by default. When the arrow is on the left or right side of the popup: The value indicates the distance from the arrow to the top; the arrow is centered by default. When the popup is displayed on either edge of the screen, it will automatically deviate leftward or rightward to stay within the safe area. When the value is **0**, the arrow always points to the bound component. |
-| showInSubWindow9+ | boolean | No | Whether to show the popup in the subwindow. Default value: **false** |
-| mask10+ | boolean \| [ResourceColor](ts-types.md#resourcecolor) | No | Whether to apply a mask to the popup. The value **true** means to apply a transparent mask to the popup, **false** means not to apply a mask to the popup, and a color value means to apply a mask in the corresponding color to the popup.|
-| messageOptions10+ | [PopupMessageOptions](#popupmessageoptions10) | No | Parameters of the popup message.|
-| targetSpace10+ | [Length](ts-types.md#length) | No | Space between the popup and the target.|
+| Name | Type | Mandatory| Description |
+| ------------------------------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| message | string | Yes | Content of the popup message. |
+| placementOnTop(deprecated) | boolean | No | Whether to display the popup above the component. Default value: **false** **NOTE** This API is deprecated since API version 10. You are advised to use **placement** instead. |
+| primaryButton | { value: string, action: () => void } | No | Primary button. **value**: text of the primary button in the popup. **action**: callback for clicking the primary button.|
+| secondaryButton | { value: string, action: () => void } | No | Secondary button. **value**: text of the secondary button in the popup. **action**: callback for clicking the secondary button.|
+| onStateChange | (event: { isVisible: boolean }) => void | No | Callback for the popup status change event. **isVisible**: whether the popup is visible. |
+| arrowOffset9+ | [Length](ts-types.md#length) | No | Offset of the popup arrow relative to the popup. When the arrow is at the top or bottom of the popup: The value **0** indicates that the arrow is located on the leftmost, and any other value indicates the distance from the arrow to the leftmost; the arrow is centered by default. When the arrow is on the left or right side of the popup: The value indicates the distance from the arrow to the top; the arrow is centered by default. When the popup is displayed on either edge of the screen, it will automatically deviate leftward or rightward to stay within the safe area. When the value is **0**, the arrow always points to the bound component. |
+| showInSubWindow9+ | boolean | No | Whether to show the popup in the subwindow. Default value: **false** |
+| mask10+ | boolean \| [ResourceColor](ts-types.md#resourcecolor) | No | Whether to apply a mask to the popup. The value **true** means to apply a transparent mask to the popup, **false** means not to apply a mask to the popup, and a color value means to apply a mask in the corresponding color to the popup.|
+| messageOptions10+ | [PopupMessageOptions](#popupmessageoptions10) | No | Parameters of the popup message. |
+| targetSpace10+ | [Length](ts-types.md#length) | No | Space between the popup and the target. |
+| placement10+ | [Placement](ts-appendix-enums.md#placement8) | No | Position of the popup relative to the target. The default value is **Placement.Bottom**. If both **placementOnTop** and **placement** are set, the latter prevails.|
## PopupMessageOptions10+
-| Name | Type | Mandatory| Description |
-| --------- | ------------------------------------------ | ---- | ---------------------- |
-| textColor | [ResourceColor](ts-types.md#resourcecolor) | No | Text color of the popup message.|
-| font | [Font](ts-types.md#Font) | No | Font attributes of the popup message.|
+| Name | Type | Mandatory | Description |
+| --------- | ---------------------------------------- | ---- | ----------- |
+| textColor | [ResourceColor](ts-types.md#resourcecolor) | No | Text color of the popup message.|
+| font | [Font](ts-types.md#Font) | No | Font attributes of the popup message.|
## CustomPopupOptions8+
-| Name | Type | Mandatory | Description |
-| -------------------------| ------------------------- | ---- | ---------------------------------------------------- |
-| builder | [CustomBuilder](ts-types.md#custombuilder8) | Yes | Popup builder. |
-| placement | [Placement](ts-appendix-enums.md#placement8) | No | Preferred position of the popup. If the set position is insufficient for holding the popup, it will be automatically adjusted. Default value: **Placement.Bottom** |
-| popupColor | [ResourceColor](ts-types.md#resourcecolor) | No | Color of the popup. |
-| enableArrow | boolean | No | Whether to display an arrow. Since API version 9, if the position set for the popup is not large enough, the arrow will not be displayed. For example, if **placement** is set to **Left**, but the popup height (80 vp) is less than the sum of the arrow width (32 vp) and diameter of popup rounded corner (48 vp), the arrow will not be displayed. Default value: **true**|
-| autoCancel | boolean | No | Whether to automatically close the popup when an operation is performed on the page. Default value: **true** |
-| onStateChange | (event: { isVisible: boolean }) => void | No | Callback for the popup status change event. **isVisible**: whether the popup is visible. |
-| arrowOffset9+ | [Length](ts-types.md#length) | No | Offset of the popup arrow relative to the popup. When the arrow is at the top or bottom of the popup: The value **0** indicates that the arrow is located on the leftmost, and any other value indicates the distance from the arrow to the leftmost; the arrow is centered by default. When the arrow is on the left or right side of the popup: The value indicates the distance from the arrow to the top; the arrow is centered by default. When the popup is displayed on either edge of the screen, it will automatically deviate leftward or rightward to stay within the safe area. When the value is **0**, the arrow always points to the bound component. |
-| showInSubWindow9+ | boolean | No | Whether to show the popup in the subwindow. Default value: **false** |
-| mask10+ | boolean \| [ResourceColor](ts-types.md#resourcecolor) | No| Whether to apply a mask to the popup. The value **true** means to apply a transparent mask to the popup, **false** means not to apply a mask to the popup, and a color value means to apply a mask in the corresponding color to the popup.|
-| targetSpace10+ | [Length](ts-types.md#length) | No| Space between the popup and the target.|
+| Name | Type | Mandatory | Description |
+| ---------------------------- | ---------------------------------------- | ---- | ---------------------------------------- |
+| builder | [CustomBuilder](ts-types.md#custombuilder8) | Yes | Popup builder. |
+| placement | [Placement](ts-appendix-enums.md#placement8) | No | Preferred position of the popup. If the set position is insufficient for holding the popup, it will be automatically adjusted. Default value: **Placement.Bottom**|
+| popupColor | [ResourceColor](ts-types.md#resourcecolor) | No | Color of the popup. |
+| enableArrow | boolean | No | Whether to display an arrow. Since API version 9, if the position set for the popup is not large enough, the arrow will not be displayed. For example, if **placement** is set to **Left**, but the popup height (80 vp) is less than the sum of the arrow width (32 vp) and diameter of popup rounded corner (48 vp), the arrow will not be displayed. Default value: **true**|
+| autoCancel | boolean | No | Whether to automatically close the popup when an operation is performed on the page. Default value: **true** |
+| onStateChange | (event: { isVisible: boolean }) => void | No | Callback for the popup status change event. **isVisible**: whether the popup is visible. |
+| arrowOffset9+ | [Length](ts-types.md#length) | No | Offset of the popup arrow relative to the popup. When the arrow is at the top or bottom of the popup: The value **0** indicates that the arrow is located on the leftmost, and any other value indicates the distance from the arrow to the leftmost; the arrow is centered by default. When the arrow is on the left or right side of the popup: The value indicates the distance from the arrow to the top; the arrow is centered by default. When the popup is displayed on either edge of the screen, it will automatically deviate leftward or rightward to stay within the safe area. When the value is **0**, the arrow always points to the bound component. |
+| showInSubWindow9+ | boolean | No | Whether to show the popup in the subwindow. The default value is **false**. |
+| mask10+ | boolean \| [ResourceColor](ts-types.md#resourcecolor) | No | Whether to apply a mask to the popup. The value **true** means to apply a transparent mask to the popup, **false** means not to apply a mask to the popup, and a color value means to apply a mask in the corresponding color to the popup.|
+| targetSpace10+ | [Length](ts-types.md#length) | No | Space between the popup and the target. |
## Example
```ts
@@ -111,7 +112,7 @@ struct PopupExample {
.bindPopup(this.customPopup, {
builder: this.popupBuilder,
placement: Placement.Top,
- mask: {color: 0x33000000},
+ maskColor: '0x33000000',
popupColor: Color.Yellow,
enableArrow: true,
showInSubWindow: false,
diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md
index 46af6ad7fc87c0cf7e1a268462d255a8c1337023..feb63e3f4a94158424dc7892e0abc8a7ea747d94 100644
--- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md
+++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md
@@ -2,7 +2,7 @@
Universal text attributes include text style attributes applicable to text containers.
-> **NOTE**
+> **NOTE**
>
> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md
index 7bf991c7db0e1cd9c291dd740496890f06dc1af6..ffe50fcf4f532d67625d7cd512914469587df77d 100644
--- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md
+++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md
@@ -10,7 +10,7 @@ The visibility attribute controls whether a component is visible.
| Name | Type | Description |
| ---------- | ---------------------------- | ------------------------------------------ |
-| visibility | [Visibility](ts-appendix-enums.md#visibility) | Whether the component is visible. Note that even if a component is invisible, it still needs to be re-created when the page is refreshed. Therefore, you are advised to use [conditional rendering](../../quick-start/arkts-rendering-control.md#conditional-rendering) instead under scenarios where consistently high performance is required. Default value: **Visibility.Visible** Since API version 9, this API is supported in ArkTS widgets.|
+| visibility | [Visibility](ts-appendix-enums.md#visibility) | Whether the component is visible. Note that even if a component is invisible, it still needs to be re-created when the page is refreshed. Therefore, you are advised to use [conditional rendering](../../quick-start/arkts-rendering-control-ifelse.md) instead under scenarios where consistently high performance is required. Default value: **Visibility.Visible** Since API version 9, this API is supported in ArkTS widgets.|
## Example
@@ -23,11 +23,11 @@ struct VisibilityExample {
build() {
Column() {
Column() {
- // The component is hidden, and no placeholder is used.
+ // The component is hidden and does not take up space in the layout.
Text('None').fontSize(9).width('90%').fontColor(0xCCCCCC)
Row().visibility(Visibility.None).width('90%').height(80).backgroundColor(0xAFEEEE)
- // The component is hidden, and a placeholder is used for it in the layout.
+ // The component is hidden but takes up space in the layout.
Text('Hidden').fontSize(9).width('90%').fontColor(0xCCCCCC)
Row().visibility(Visibility.Hidden).width('90%').height(80).backgroundColor(0xAFEEEE)
diff --git a/en/application-dev/reference/arkui-ts/ts-universal-events-keyboardshortcut.md b/en/application-dev/reference/arkui-ts/ts-universal-events-keyboardshortcut.md
new file mode 100644
index 0000000000000000000000000000000000000000..011fe91e02257575d4f11e08cc502e34e1dcf286
--- /dev/null
+++ b/en/application-dev/reference/arkui-ts/ts-universal-events-keyboardshortcut.md
@@ -0,0 +1,121 @@
+# Custom Keyboard Shortcuts
+
+You can set one or more custom keyboard shortcuts for a component. The behavior of these keyboard shortcuts is the same as that of clicks. Components can respond to custom keyboard shortcuts even when they are not focused.
+
+> **NOTE**
+>
+> The APIs of this module are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
+
+## APIs
+
+keyboardShortcut(value: string | [FunctionKey], keys: Array<[ModifierKey]>)
+
+**Parameters**
+
+| Name| Type | Mandatory| Description |
+| ------ | ------------------------------------- | ---- | ------------------------------------------------------------ |
+| value | string \| [FunctionKey](#functionkey) | Yes | Character key (which can be entered through the keyboard) or [function key](#functionkey). |
+| keys | Array<[ModifierKey](#modifierkey)> | Yes | Modifier keys. |
+
+## ModifierKey
+
+| Name | Description |
+| ----- | ------------------- |
+| CTRL | Ctrl key on the keyboard. |
+| SHIFT | Shift key on the keyboard.|
+| ALT | Alt key on the keyboard. |
+
+## FunctionKey
+
+| Name| Description |
+| ---- | --------------------- |
+| ESC | Esc key on the keyboard.|
+| F1 | F1 key on the keyboard. |
+| F2 | F2 key on the keyboard. |
+| F3 | F3 key on the keyboard. |
+| F4 | F4 key on the keyboard. |
+| F5 | F5 key on the keyboard. |
+| F6 | F6 key on the keyboard. |
+| F7 | F7 key on the keyboard. |
+| F8 | F8 key on the keyboard. |
+| F9 | F9 key on the keyboard. |
+| F10 | F10 key on the keyboard.|
+| F11 | F11 key on the keyboard.|
+| F12 | F12 key on the keyboard.|
+
+## Precautions for Using Keyboard Shortcuts
+
+| Scenario | Processing Logic | Example |
+| ------------------------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------ |
+| All components that support the **onClick** event | Custom keyboard shortcuts are supported. | – |
+| Requirements for custom keyboard shortcuts | A custom keyboard shortcut consists of one or more modifier keys (**Ctrl**, **Shift**, **Alt**, or any combination thereof) and a character key or function key.| Button('button1').keyboardShortcut('a',[ModifierKey.CTRL]) |
+| Setting one custom keyboard shortcut for multiple components | Only the first component in the component tree responds to the custom keyboard shortcut. | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL]) Button('button2').keyboardShortcut('a',[ModifierKey.CTRL]) |
+| When the component is focused or not | The component responds to the custom keyboard shortcut as long as the window is focused. | – |
+| When a single keyboard shortcut is set, it can be canceled by setting the **value**, **keys**, or both of them to null in the **keyboardShortcut** API. When multiple keyboard shortcuts are set, they cannot be canceled.| Canceling the custom keyboard shortcut settings | Button('button1').keyboardShortcut('',[ModifierKey.CTRL]) Button('button2').keyboardShortcut('a',[l]) Button('button3').keyboardShortcut('',[]) |
+| The independent pipeline sub-window and main window coexist | The focused window responds to the keyboard shortcut. | – |
+| Ctrl, Shift, or Alt key in the **keys** parameter of the **keyboardShortcut** API | Both the keys on the left or right sides of the keyboard work. | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL, ModifierKey.ALT]) |
+| Character key in the **value** parameter of the **keyboardShortcut** API | The response is case-insensitive. | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL]) Button('button2').keyboardShortcut('A',[ModifierKey.CTRL]) |
+| Response to keyboard shortcuts | The component responds continuously to the keyboard shortcut when all the set keys are pressed. | – |
+| Hidden component | The keyboard shortcut also works. | – |
+| Components in the disable state | The keyboard shortcut does not work. | – |
+| 1. The keyboard shortcut is the same as an existing one (including the system-defined ones). 2. The **value** parameter contains multiple character keys. 3. The **key** parameter has a duplicate modifier key.| In these cases, the keyboard shortcut is not added, and the previously added keyboard shortcuts still work. | Button('button1').keyboardShortcut('c',[ModifierKey.CTRL]) Button('button2').keyboardShortcut('ab',[ModifierKey.CTRL]) Button('button3').keyboardShortcut('ab',[ModifierKey.CTRL,ModifierKey.CTRL]) |
+
+## System-defined Keyboard Shortcuts
+
+| Keyboard Shortcut | Component |
+| -------------- | ------------------------------------------------------------ |
+| Ctrl + C | [Image](ts-basic-components-image.md), [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Ctrl+ A | [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Ctrl+ V | [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Ctrl+ X | [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Shift + arrow keys| [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Ctrl+ Shift+ Z | [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Ctrl+ Z | [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Ctrl+ Y | [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Arrow keys and Enter key| [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+| Tab key | [TextInput](ts-basic-components-textinput.md), [TextArea](ts-basic-components-textarea.md)|
+
+## Example
+
+Set a keyboard shortcut. You can then press the modifier key and accompanying key at the same time to trigger the component to respond to the shortcut and trigger the **onClick** event or other custom event.
+
+```ts
+// xxx.ets
+@Entry
+@Component
+struct Index {
+ @State message: string = 'Hello World'
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ Button("Test short cut 1").onClick((event) => {
+ this.message = "I clicked Button 1";
+ console.log("I clicked 1");
+ }).keyboardShortcut('.', [ModifierKey.SHIFT, ModifierKey.CTRL, ModifierKey.ALT])
+ .onKeyEvent((event)=>{
+ console.log("event.keyCode: " + JSON.stringify(event));
+ })
+ Button("Test short cut 2").onClick((event) => {
+ this.message = "I clicked Button 2";
+ console.log("I clicked 2");
+ }).keyboardShortcut('1', [ModifierKey.CTRL])
+ Button("Test short cut 3").onClick((event) => {
+ this.message = "I clicked Button 3";
+ console.log("I clicked 3");
+ }).keyboardShortcut('A', [ModifierKey.SHIFT])
+ Button("Test short cut 4").onClick((event) => {
+ this.message = "I clicked Button 4";
+ console.log("I clicked 4");
+ }).keyboardShortcut(FunctionKey.F5, [], () => {
+ this.message = "I clicked Button 4";
+ console.log("I clicked user callback.");
+ }).keyboardShortcut(FunctionKey.F3, [])
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+```
diff --git a/en/application-dev/ui/arkts-layout-development-create-looping.md b/en/application-dev/ui/arkts-layout-development-create-looping.md
new file mode 100644
index 0000000000000000000000000000000000000000..4845c9dc535a89a990eea9117271d1655d41476b
--- /dev/null
+++ b/en/application-dev/ui/arkts-layout-development-create-looping.md
@@ -0,0 +1,318 @@
+# Creating a Swiper
+
+
+The \<[Swiper](../reference/arkui-ts/ts-container-swiper.md)> component is a container that is able to display child components in looping mode. It is typically used in scenarios such as display of recommended content on the home page.
+
+
+## Layout and Constraints
+
+The size of the **\** component follows its own size settings (if configured) or adapts based on the size of its child components.
+
+
+## Loop Playback
+
+The **loop** attribute sets whether to enable loop playback. Its default value is **true**.
+
+When **loop** is set to **true**, the user can switch to the previous or next page when they are on the first or last page.
+
+ Example of setting **loop** to **true**:
+
+```ts
+...
+private swiperController: SwiperController = new SwiperController()
+...
+Swiper(this.swiperController) {
+ Text("0")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Gray)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("1")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Green)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("2")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Blue)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+}
+.loop(true)
+```
+
+
+
+ Example of setting **loop** to **false**:
+
+```ts
+Swiper(this.swiperController) {
+ Text("0")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Gray)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("1")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Green)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("2")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Blue)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+}
+.loop(false)
+```
+
+
+
+
+## Automatic Playback
+
+The **autoPlay** attribute sets whether to enable automatic playback for child component switching. Its default value is **false**.
+
+When **autoPlay** is set to **true**, automatic playback is enabled for child component switching. The playback interval is specified by the **interval** attribute, which is **3000** by default, in milliseconds.
+
+ Example of setting **autoPlay** to **true**:
+
+```ts
+Swiper(this.swiperController) {
+ Text("0")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Gray)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("1")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Green)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("2")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Pink)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+}
+.loop(true)
+.autoPlay(true)
+.interval(1000)
+```
+
+
+
+
+## Navigation Dots Indicator
+
+The **\** component provides a navigation dots indicator, which is displayed in the bottom center of the component. You can customize the position and style of the navigation dots indicator through the **indicatorStyle **attribute.
+
+With the **indicatorStyle** attribute, you can set the position of the navigation dots indicator relative to the edges of the **\** component, in addition to the size, color, and mask of each navigation dot as well as the color of the selected navigation dot.
+
+ Example of using the navigation dots indicator in its default style:
+
+```ts
+Swiper(this.swiperController) {
+ Text("0")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Gray)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("1")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Green)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("2")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Pink)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+}
+```
+
+
+
+ Example of customizing the style of the navigation dots indicator, with the diameter of 30 vp, left margin of 0, and color of red:
+
+```ts
+Swiper(this.swiperController) {
+ Text("0")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Gray)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("1")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Green)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+
+ Text("2")
+ .width('90%')
+ .height('100%')
+ .backgroundColor(Color.Pink)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+}
+.indicatorStyle({
+ size: 30,
+ left: 0,
+ color: Color.Red
+})
+```
+
+
+
+
+## Page Switching Mode
+
+The **\** component supports three page switching modes: using the swipe gesture, using the navigation dots indicator, and using the controller.
+
+ Switch pages through the controller:
+
+```ts
+@Entry
+@Component
+struct SwiperDemo {
+ private swiperController: SwiperController = new SwiperController();
+
+ build() {
+ Column({ space: 5 }) {
+ Swiper(this.swiperController) {
+ Text("0")
+ .width(250)
+ .height(250)
+ .backgroundColor(Color.Gray)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+ Text("1")
+ .width(250)
+ .height(250)
+ .backgroundColor(Color.Green)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+ Text("2")
+ .width(250)
+ .height(250)
+ .backgroundColor(Color.Pink)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+ }
+ .indicator(true)
+
+ Row({ space: 12 }) {
+ Button('showNext')
+ .onClick(() => {
+ this.swiperController.showNext(); // Switch to the next page through the controller.
+ })
+ Button('showPrevious')
+ .onClick(() => {
+ this.swiperController.showPrevious(); // Switch to the previous page through the controller.
+ })
+ }.margin(5)
+ }.width('100%')
+ .margin({ top: 5 })
+ }
+}
+```
+
+
+
+
+## Playback Direction
+
+You can set the playback direction for the \ component through its **vertical** attribute.
+
+When **vertical** is set to **true**, vertical swiping is used. The default value of **vertical** is **false**.
+
+
+ Example of using horizontal swiping:
+
+```ts
+Swiper(this.swiperController) {
+ ...
+}
+.indicator(true)
+.vertical(false)
+```
+
+
+
+
+
+ Example of using vertical swiping:
+
+```ts
+Swiper(this.swiperController) {
+ ...
+}
+.indicator(true)
+.vertical(true)
+```
+
+
+
+
+
+## Child Components Per Page
+
+You can set the number of child components per page for the **\** component through its [displayCount](../reference/arkui-ts/ts-container-swiper.md#attributes) attribute.
+
+ To display two child components per page:
+
+```ts
+Swiper(this.swiperController) {
+ Text("0")
+ .width(250)
+ .height(250)
+ .backgroundColor(Color.Gray)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+ Text("1")
+ .width(250)
+ .height(250)
+ .backgroundColor(Color.Green)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+ Text("2")
+ .width(250)
+ .height(250)
+ .backgroundColor(Color.Pink)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+ Text("3")
+ .width(250)
+ .height(250)
+ .backgroundColor(Color.Blue)
+ .textAlign(TextAlign.Center)
+ .fontSize(30)
+}
+.indicator(true)
+.displayCount(2)
+```
+
+
diff --git a/en/application-dev/ui/arkts-layout-development-grid-layout.md b/en/application-dev/ui/arkts-layout-development-grid-layout.md
new file mode 100644
index 0000000000000000000000000000000000000000..6b385b02e3f2ef361d43ea64897ea6118be9688c
--- /dev/null
+++ b/en/application-dev/ui/arkts-layout-development-grid-layout.md
@@ -0,0 +1,481 @@
+# Responsive Grid Layout
+
+
+## Overview
+
+As an auxiliary positioning tool, the responsive grid layout is handy in UI design on mobile devices. It exhibits the following advantages:
+
+1. Provides rules for layout design and resolves issues of dynamic layout across devices with different sizes. By dividing a page into equal-width columns and rows, you can easily locate and typeset page elements.
+
+2. Provides a unified positioning method for the system to ensure layout consistency across layouts on different devices. This can reduce the complexity of design and development and improve work efficiency.
+
+3. Provides a flexible spacing adjustment method for applications to accommodate special layout requirements. You can adjust the spacing between columns and between rows to control the typesetting of the entire page.
+
+4. Completes the wrapping and adaptation automatically when overflow occurs. When the number of page elements exceeds the capacity of a row or column, they automatically wrap to a new row or column and adapt the typesetting to different devices.
+
+The [\](../reference/arkui-ts/ts-container-gridrow.md) component is the responsive grid container component and must be used together with the [\](../reference/arkui-ts/ts-container-gridcol.md) child component.
+
+
+## GridRow
+
+
+### Grid Breakpoints
+
+The grid system defines breakpoints, which are screen width types in effect, based on the horizontal width (screen density pixels, in vp) of the screens. You can use the breakpoints to meet specific layout requirements.
+
+By default, the grid system provides four breakpoints: xs, sm, md, and lg.
+
+| Breakpoint| Value Range (vp) | Device Description |
+| ---- | --------------- | --------- |
+| xs | [0, 320) | Device of the minimum size.|
+| sm | [320, 520) | Small-sized device. |
+| md | [520, 840) | Medium-sized device.|
+| lg | [840, +∞) | Large-sized device. |
+
+In the **\** component, you can use **breakpoints** to customize the value range of breakpoints. A maximum of six breakpoints are supported. In addition to the four default breakpoints, you can also enable the xl and xxl breakpoints for your application window layout.
+
+| Breakpoint| Device Description |
+| ---- | --------- |
+| xs | Device of the minimum size.|
+| sm | Small-sized device. |
+| md | Medium-sized device.|
+| lg | Large-sized device. |
+| xl | Extra-large-sized device.|
+| xxl | Ultra-large-sized device.|
+
+- Set **breakpoints** with a monotonically increasing array based on the use case. Because **breakpoints** supports a maximum of six breakpoints, the maximum length of the monotonically increasing array is 5.
+
+
+ ```ts
+ breakpoints: {value: ['100vp', '200vp']}
+ ```
+
+ Enables three breakpoints: xs, sm, and md. If the value is less than 100 vp, the breakpoint is xs. If the value is 100–200 vp, the breakpoint is sm. If the value is greater than 200 vp, the breakpoint is md.
+
+
+ ```ts
+ breakpoints: {value: ['320vp', '520vp', '840vp', '1080vp']}
+ ```
+
+ Enables five breakpoints: xs, sm, md, lg, and xl. If the value is less than 320 vp, the breakpoint is xs. If the value is 320–520 vp, the breakpoint is sm. If the value is 520–840 vp, the breakpoint is md. If the value is 840–1080vp, the breakpoint is lg. If the value is greater than 1080 vp, the breakpoint is xl.
+
+- The grid system implements breakpoints by listening for the changes in the window or container size, and sets the breakpoint references through **reference**. Considering that the application may be displayed in non-full-screen mode, design the breakpoints with the application window width as the reference.
+
+In the following example, the default number of columns of a grid is 12. Breakpoints are used to divide the application window width into six ranges, where different grid items occupy a different number of columns.
+
+
+```ts
+@State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown];
+...
+GridRow({
+ breakpoints: {
+ value: ['200vp', '300vp', '400vp', '500vp', '600vp'],
+ reference: BreakpointsReference.WindowSize
+ }
+}) {
+ ForEach(this.bgColors, (color, index) => {
+ GridCol({
+ span: {
+ xs: 2,
+ sm: 3,
+ md: 4,
+ lg: 6,
+ xl: 8,
+ xxl: 12
+ }
+ }) {
+ Row() {
+ Text(`${index}`)
+ }.width("100%").height('50vp')
+ }.backgroundColor(color)
+ })
+}
+```
+
+
+
+
+### Columns
+
+In the **\**, **columns** is used to set the total number of columns in the responsive grid layout.
+
+- The default value of **columns** is 12. If **columns** is not set, the responsive grid layout is divided into 12 columns at any breakpoint.
+
+
+ ```ts
+ @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown];
+ ...
+ GridRow() {
+ ForEach(this.bgColors, (item, index) => {
+ GridCol() {
+ Row() {
+ Text(`${index + 1}`)
+ }.width('100%').height('50')
+ }.backgroundColor(item)
+ })
+ }
+ ```
+
+ 
+
+- When **columns** is set to a number, the responsive grid layout is divided into the specified number of columns regardless of the screen size. The following example sets the number of grid layout columns to 4 and 8 in sequence, where a child component occupies one column by default.
+
+
+ ```ts
+ @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown];
+ @State currentBp: string = 'unknown';
+ ...
+ Row() {
+ GridRow({ columns: 4 }) {
+ ForEach(this.bgColors, (item, index) => {
+ GridCol() {
+ Row() {
+ Text(`${index + 1}`)
+ }.width('100%').height('50')
+ }.backgroundColor(item)
+ })
+ }
+ .width('100%').height('100%')
+ .onBreakpointChange((breakpoint) => {
+ this.currentBp = breakpoint
+ })
+ }
+ .height(160)
+ .border({ color: Color.Blue, width: 2 })
+ .width('90%')
+
+ Row() {
+ GridRow({ columns: 8 }) {
+ ForEach(this.bgColors, (item, index) => {
+ GridCol() {
+ Row() {
+ Text(`${index + 1}`)
+ }.width('100%').height('50')
+ }.backgroundColor(item)
+ })
+ }
+ .width('100%').height('100%')
+ .onBreakpointChange((breakpoint) => {
+ this.currentBp = breakpoint
+ })
+ }
+ .height(160)
+ .border({ color: Color.Blue, width: 2 })
+ .width('90%')
+ ```
+
+ 
+
+- When **columns** is set to a value of the **GridRowColumnOption** type, you can assign values specific to the screen size (xs, sm, md, lg, xl, xxl).
+
+
+ ```ts
+ @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown]
+ GridRow({ columns: { sm: 4, md: 8 }, breakpoints: { value: ['200vp', '300vp', '400vp', '500vp', '600vp'] } }) {
+ ForEach(this.bgColors, (item, index) => {
+ GridCol() {
+ Row() {
+ Text(`${index + 1}`)
+ }.width('100%').height('50')
+ }.backgroundColor(item)
+ })
+ }
+ ```
+
+ 
+
+ If **columns** is only set for the sm and md screen size types, screen sizes smaller than sm use the default value **12**, and screen sizes larger than md (lg, xl, and xxl) use the value of **columns** of the md type.
+
+
+### Alignment
+
+In the responsive grid layout, you can set the **direction** attribute of **\** to define the direction in which child components are arranged. The options are **GridRowDirection.Row** (from left to right) or **GridRowDirection.RowReverse** (from right to left). An appropriate **direction** value can make the page layout more flexible and meet the design requirements.
+
+- When child components are arranged from left to right (default):
+
+
+ ```ts
+ GridRow({ direction: GridRowDirection.Row }){}
+ ```
+
+ 
+
+- When child components are arranged from right to left (default):
+
+
+ ```ts
+ GridRow({ direction: GridRowDirection.RowReverse }){}
+ ```
+
+ 
+
+
+### Gutters
+
+In the **\** component, **gutter** is used to set the spacing between adjacent child components in the horizontal and vertical directions.
+
+- When **gutter** is set to a number, the number applies to both the horizontal and vertical directions. In the following example, the horizontal and vertical spacing between adjacent child components is set to **10**.
+
+
+ ```ts
+ GridRow({ gutter: 10 }){}
+ ```
+
+ 
+
+- When **gutter** is set to a value of the **GutterOption** type, the **x** attribute of the value indicates the horizontal gutter, and the **y** attribute indicates the vertical gutter.
+
+
+ ```ts
+ GridRow({ gutter: { x: 20, y: 50 } }){}
+ ```
+
+ 
+
+
+## GridCol
+
+The **\** component is a child component of the **\** component. You can set the **span**, **offset**, and **order** attributes of this component by passing parameters or using setters.
+
+- Setting **span**
+
+
+ ```ts
+ GridCol({ span: 2 }){}
+ GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 } }){}
+ GridCol(){}.span(2)
+ GridCol(){}.span({ xs: 1, sm: 2, md: 3, lg: 4 })
+ ```
+
+- Setting **offset**
+
+
+ ```ts
+ GridCol({ offset: 2 }){}
+ GridCol({ offset: { xs: 2, sm: 2, md: 2, lg: 2 } }){}
+ GridCol(){}.offset(2)
+ GridCol(){}.offset({ xs: 1, sm: 2, md: 3, lg: 4 })
+ ```
+
+- Setting **order**
+
+
+ ```ts
+ GridCol({ order: 2 }){}
+ GridCol({ order: { xs: 1, sm: 2, md: 3, lg: 4 } }){}
+ GridCol(){}.order(2)
+ GridCol(){}.order({ xs: 1, sm: 2, md: 3, lg: 4 })
+ ```
+
+
+### span
+
+Sets the number of columns occupied by a child component in the grid layout, which determines the child component width. The default value is **1**.
+
+- When the value type is number, the number of columns occupied by the child component is the same across screen sizes.
+
+
+ ```ts
+ @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown];
+ ...
+ GridRow({ columns: 8 }) {
+ ForEach(this.bgColors, (color, index) => {
+ GridCol({ span: 2 }) {
+ Row() {
+ Text(`${index}`)
+ }.width('100%').height('50vp')
+ }
+ .backgroundColor(color)
+ })
+ }
+ ```
+
+ 
+
+- When the value type is **GridColColumnOption**, you can assign values specific to the screen size (xs, sm, md, lg, xl, xxl).
+
+
+ ```ts
+ @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown];
+ ...
+ GridRow({ columns: 8 }) {
+ ForEach(this.bgColors, (color, index) => {
+ GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 } }) {
+ Row() {
+ Text(`${index}`)
+ }.width('100%').height('50vp')
+ }
+ .backgroundColor(color)
+ })
+ }
+ ```
+
+ 
+
+
+### offset
+
+Sets the column offset of a child component relative to the previous child component. The default value is **0**.
+
+- When the value type is number, the column offset of the child component is the same across screen sizes.
+
+
+ ```ts
+ @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown];
+ ...
+ GridRow() {
+ ForEach(this.bgColors, (color, index) => {
+ GridCol({ offset: 2 }) {
+ Row() {
+ Text('' + index)
+ }.width('100%').height('50vp')
+ }
+ .backgroundColor(color)
+ })
+ }
+ ```
+
+ 
+
+ By default, a grid is divided into 12 columns and each child component occupies one column with an offset of two columns. Each row holds four child components, with three columns per child component plus the gutter.
+
+- When the value type is **GridColColumnOption**, you can assign values specific to the screen size (xs, sm, md, lg, xl, xxl).
+
+
+ ```ts
+ @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown];
+ ...
+
+ GridRow() {
+ ForEach(this.bgColors, (color, index) => {
+ GridCol({ offset: { xs: 1, sm: 2, md: 3, lg: 4 } }) {
+ Row() {
+ Text('' + index)
+ }.width('100%').height('50vp')
+ }
+ .backgroundColor(color)
+ })
+ }
+ ```
+
+ 
+
+
+### order
+
+Sets the sequence number of a child component in the grid layout. If a child component shares an **order** value with another child component or does not have **order** set, it is displayed based on its code sequence number. A child component with a smaller **order** value is placed before the one with a larger **order** value.
+
+If **order** is not set for all child components, those that have **order** set are displayed after those that do not have **order** set and are sorted in ascending order based on the value.
+
+- When the value type is number, child components are sorted in the same order across screen sizes.
+
+
+ ```ts
+ GridRow() {
+ GridCol({ order: 4 }) {
+ Row() {
+ Text('1')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Red)
+ GridCol({ order: 3 }) {
+ Row() {
+ Text('2')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Orange)
+ GridCol({ order: 2 }) {
+ Row() {
+ Text('3')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Yellow)
+ GridCol({ order: 1 }) {
+ Row() {
+ Text('4')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Green)
+ }
+ ```
+
+ 
+
+- When the value type is **GridColColumnOption**, you can assign values specific to the screen size (xs, sm, md, lg, xl, xxl). You can set 1234 for xs, 2341 for sm, 3412 for md, and 2431 for lg.
+
+
+ ```ts
+ GridRow() {
+ GridCol({ order: { xs:1, sm:5, md:3, lg:7}}) {
+ Row() {
+ Text('1')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Red)
+ GridCol({ order: { xs:2, sm:2, md:6, lg:1} }) {
+ Row() {
+ Text('2')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Orange)
+ GridCol({ order: { xs:3, sm:3, md:1, lg:6} }) {
+ Row() {
+ Text('3')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Yellow)
+ GridCol({ order: { xs:4, sm:4, md:2, lg:5} }) {
+ Row() {
+ Text('4')
+ }.width('100%').height('50vp')
+ }.backgroundColor(Color.Green)
+ }
+ ```
+
+ 
+
+
+## Nesting of Responsive Grid Components
+
+Responsive grid components can be contained in other responsive grid components.
+
+In the following example, the responsive grid divides the entire space into 12 parts. **\** is nested in **\** at the first layer, which is divided into the large area in the center and the footer area. **\** is nested in **\** at the second layer, which is divided into the left and right areas. The child component space is divided based on the space allocation of the parent component at the upper layer. For example, the pink area is made up of 12 columns of the screen space, and the green and blue areas are made up of 12 columns of the **\** parent component.
+
+
+
+```ts
+@Entry
+@Component
+struct GridRowExample {
+ build() {
+ GridRow() {
+ GridCol({ span: { sm: 12 } }) {
+ GridRow() {
+ GridCol({ span: { sm: 2 } }) {
+ Row() {
+ Text('left').fontSize(24)
+ }
+ .justifyContent(FlexAlign.Center)
+ .height('90%')
+ }.backgroundColor('#ff41dbaa')
+
+ GridCol({ span: { sm: 10 } }) {
+ Row() {
+ Text('right').fontSize(24)
+ }
+ .justifyContent(FlexAlign.Center)
+ .height('90%')
+ }.backgroundColor('#ff4168db')
+ }
+ .backgroundColor('#19000000')
+ .height('100%')
+ }
+
+ GridCol({ span: { sm: 12 } }) {
+ Row() {
+ Text('footer').width('100%').textAlign(TextAlign.Center)
+ }.width('100%').height('10%').backgroundColor(Color.Pink)
+ }
+ }.width('100%').height(300)
+ }
+}
+```
+
+
+
+
+
+To sum up, the responsive grid components are powerful tools with a wide range of customization capabilities. With the required attributes set at different breakpoints, such as **Columns**, **Margin**, **Gutter**, and **span**, the layout is created automatically. You do not need to pay attention to the specific device type and device state (such as landscape and portrait).
diff --git a/en/application-dev/ui/arkts-popup-and-menu-components-popup.md b/en/application-dev/ui/arkts-popup-and-menu-components-popup.md
new file mode 100644
index 0000000000000000000000000000000000000000..2176e02b39dfaf3b7bc59141835578f1ff0c55d9
--- /dev/null
+++ b/en/application-dev/ui/arkts-popup-and-menu-components-popup.md
@@ -0,0 +1,158 @@
+# Popup
+
+
+You can bind the **Popup** attribute to a component to create a popup, specifying its content and interaction logic, and display state. It is mainly used for screen recording and message notification.
+
+
+Popups can be defined with [PopupOptions](../reference/arkui-ts/ts-universal-attributes-popup.md#popupoptions) or [CustomPopupOptions](../reference/arkui-ts/ts-universal-attributes-popup.md#custompopupoptions8). In **PopupOptions**, you can set **primaryButton** and **secondaryButton** to include buttons in the popup. In **CustomPopupOptions**, you can create a custom popup through the [builder](../quick-start/arkts-builder.md) parameter.
+
+
+## Text Popup
+
+Text popups are usually used to display text only and do not allow for user interactions. Bind the **Popup** attribute to a component. When the **show** parameter in the **bindPopup** attribute is set to **true**, a popup is displayed.
+
+If you bind the **Popup** attribute to a **\** component, each time the **\** button is clicked, the Boolean value of **handlePopup** changes. When it changes to **true**, the popup is displayed.
+
+
+
+```ts
+@Entry
+@Component
+struct PopupExample {
+ @State handlePopup: boolean = false
+
+ build() {
+ Column() {
+ Button('PopupOptions')
+ .onClick(() => {
+ this.handlePopup = !this.handlePopup
+ })
+ .bindPopup(this.handlePopup, {
+ message: 'This is a popup with PopupOptions',
+ })
+ }.width('100%').padding({ top: 5 })
+ }
+}
+```
+
+
+
+
+
+## Popup with a Button
+
+You can add a maximum of two buttons to a popup through the **primaryButton** and **secondaryButton** attributes. For each of the buttons, you can set the **action** parameter to specify the operation to be triggered.
+
+
+
+```ts
+@Entry
+@Component
+struct PopupExample22 {
+ @State handlePopup: boolean = false
+ build() {
+ Column() {
+ Button('PopupOptions').margin({top:200})
+ .onClick(() => {
+ this.handlePopup = !this.handlePopup
+ })
+ .bindPopup(this.handlePopup, {
+ message: 'This is a popup with PopupOptions',
+ primaryButton:{
+ value:'Confirm',
+ action: () => {
+ this.handlePopup = !this.handlePopup
+ console.info('confirm Button click')
+ }
+ },
+ secondaryButton: {
+ value: 'Cancel',
+ action: () => {
+ this.handlePopup = !this.handlePopup
+ }
+ },
+ })
+ }.width('100%').padding({ top: 5 })
+ }
+}
+```
+
+
+
+
+
+## Custom Popup
+
+You can create a custom popup with **CustomPopupOptions**, defining custom content in \@Builder. In addition, you can use parameters such as **popupColor** to control the popup style.
+
+
+
+```ts
+@Entry
+@Component
+struct Index {
+ @State customPopup: boolean = false
+ // Define the popup content in the popup builder.
+ @Builder popupBuilder() {
+ Row({ space: 2 }) {
+ Image($r("app.media.icon")).width(24).height(24).margin({ left: 5 })
+ Text('This is Custom Popup').fontSize(15)
+ }.width(200).height(50).padding(5)
+ }
+ build() {
+ Column() {
+ Button('CustomPopupOptions')
+ .position({x:100,y:200})
+ .onClick(() => {
+ this.customPopup = !this.customPopup
+ })
+ .bindPopup(this.customPopup, {
+ builder: this.popupBuilder, // Content of the popup.
+ placement:Placement.Bottom, // Position of the popup.
+ popupColor:Color.Pink // Background color of the popup.
+ })
+ }
+ .height('100%')
+ }
+}
+```
+
+
+To place the popup in a specific position, set the **placement** parameter. The popup builder triggers a popup message to instruct the user to complete the operation.
+
+
+
+
+
+
+```ts
+@Entry
+@Component
+struct Index {
+ @State customPopup: boolean = false
+ // Define the popup content in the popup builder.
+ @Builder popupBuilder() {
+ Row({ space: 2 }) {
+ Image('/images/shengWhite.png').width(30).objectFit(ImageFit.Contain)
+ Column(){
+ Text('Savor Life').fontSize(14).fontWeight(900).fontColor(Color.White).width('100%')
+ Text('A treasure trove of sing-along songs').fontSize(12).fontColor('#ffeeeeee').width('100%')
+ }
+ }.width(230).height(80).padding(5)
+ }
+ build() {
+ Row() {
+ Text ('Sing along')
+ Image('/images/sheng.png').width(35).objectFit(ImageFit.Contain)
+ .onClick(() => {
+ this.customPopup = !this.customPopup
+ })
+ .bindPopup(this.customPopup, {
+ builder: this.popupBuilder,
+ })
+ }
+ .margin(20)
+ .height('100%')
+ }
+}
+```
diff --git a/en/application-dev/ui/figures/autoPlay.gif b/en/application-dev/ui/figures/autoPlay.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bc75b78ba2bd3bf34f76a351779af874598c33d3
Binary files /dev/null and b/en/application-dev/ui/figures/autoPlay.gif differ
diff --git a/en/application-dev/ui/figures/controll.gif b/en/application-dev/ui/figures/controll.gif
new file mode 100644
index 0000000000000000000000000000000000000000..583ea20ede42d5201c523d5b0f3dba2af879de85
Binary files /dev/null and b/en/application-dev/ui/figures/controll.gif differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511421264.png b/en/application-dev/ui/figures/en-us_image_0000001511421264.png
new file mode 100644
index 0000000000000000000000000000000000000000..fe59d441c386189694b3185e23279f14c6dd4a97
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511421264.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511421268.png b/en/application-dev/ui/figures/en-us_image_0000001511421268.png
new file mode 100644
index 0000000000000000000000000000000000000000..5e549b42338ffe87b944807cec7e57144b5cbe74
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511421268.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511421272.gif b/en/application-dev/ui/figures/en-us_image_0000001511421272.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f2e18ecafe8202705a34e6c76b4fdc59d5cca8d6
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511421272.gif differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511580892.png b/en/application-dev/ui/figures/en-us_image_0000001511580892.png
new file mode 100644
index 0000000000000000000000000000000000000000..297dea381d85074e91edfb664bac5b8e3151f7bb
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511580892.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511740476.png b/en/application-dev/ui/figures/en-us_image_0000001511740476.png
new file mode 100644
index 0000000000000000000000000000000000000000..3b246c32f1079b06c18c1a14cbcb286c241a8623
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511740476.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511740488.png b/en/application-dev/ui/figures/en-us_image_0000001511740488.png
new file mode 100644
index 0000000000000000000000000000000000000000..1153aade7a6764fe871d63783abdcd09366fba13
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511740488.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511740492.gif b/en/application-dev/ui/figures/en-us_image_0000001511740492.gif
new file mode 100644
index 0000000000000000000000000000000000000000..eba3ab4a41c44642c47f1864858094771043dcc7
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511740492.gif differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511740524.png b/en/application-dev/ui/figures/en-us_image_0000001511740524.png
new file mode 100644
index 0000000000000000000000000000000000000000..4d6634a697640a8c0a3d390e0e3e9e300162fff2
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511740524.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511900444.gif b/en/application-dev/ui/figures/en-us_image_0000001511900444.gif
new file mode 100644
index 0000000000000000000000000000000000000000..315c82e417d240d0624a8206c9adf47c4c0a3ec3
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511900444.gif differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001511900456.png b/en/application-dev/ui/figures/en-us_image_0000001511900456.png
new file mode 100644
index 0000000000000000000000000000000000000000..534c169420509639cf21b30b41d65ccb34758b66
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511900456.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001562700433.gif b/en/application-dev/ui/figures/en-us_image_0000001562700433.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b517e892ed6ff4ad337e57d044aa518ff78a8792
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001562700433.gif differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001562940517.png b/en/application-dev/ui/figures/en-us_image_0000001562940517.png
new file mode 100644
index 0000000000000000000000000000000000000000..e0a74253389934179d0cbcbaf4a43c01df18f7e5
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001562940517.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001563060689.gif b/en/application-dev/ui/figures/en-us_image_0000001563060689.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e44df1b36066095ed6e8741e26d9f04a4c9a2b0b
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001563060689.gif differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001563060697.png b/en/application-dev/ui/figures/en-us_image_0000001563060697.png
new file mode 100644
index 0000000000000000000000000000000000000000..b46c1ea016b3f018d9729499e3df2b98e10467f9
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001563060697.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001563060705.png b/en/application-dev/ui/figures/en-us_image_0000001563060705.png
new file mode 100644
index 0000000000000000000000000000000000000000..e760daef7809d60e1c7b9323bffc267f592c8fc5
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001563060705.png differ
diff --git a/en/application-dev/ui/figures/en-us_image_0000001563060709.png b/en/application-dev/ui/figures/en-us_image_0000001563060709.png
new file mode 100644
index 0000000000000000000000000000000000000000..f7e2c38a9b5f22ebf44eaae8eb9fea461d198018
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001563060709.png differ
diff --git a/en/application-dev/ui/figures/en-us_other_0000001500740342.jpeg b/en/application-dev/ui/figures/en-us_other_0000001500740342.jpeg
new file mode 100644
index 0000000000000000000000000000000000000000..ace71361eb29956ec0f80cab785122b546b64bc1
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_other_0000001500740342.jpeg differ
diff --git a/en/application-dev/ui/figures/en-us_other_0000001500900234.jpeg b/en/application-dev/ui/figures/en-us_other_0000001500900234.jpeg
new file mode 100644
index 0000000000000000000000000000000000000000..5741b5407f11587de9f927dd29d5e1a199fe65bd
Binary files /dev/null and b/en/application-dev/ui/figures/en-us_other_0000001500900234.jpeg differ
diff --git a/en/application-dev/ui/figures/horizontal-swiping.PNG b/en/application-dev/ui/figures/horizontal-swiping.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..1a9ff7709260b87c724834631bb5723b2ccaaba8
Binary files /dev/null and b/en/application-dev/ui/figures/horizontal-swiping.PNG differ
diff --git a/en/application-dev/ui/figures/ind.PNG b/en/application-dev/ui/figures/ind.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..4bc8211932e96bf6dd1c806cbd7a4b88e3414084
Binary files /dev/null and b/en/application-dev/ui/figures/ind.PNG differ
diff --git a/en/application-dev/ui/figures/indicator.PNG b/en/application-dev/ui/figures/indicator.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..6ff8a073e6fb1414628c75641097de248e0873f5
Binary files /dev/null and b/en/application-dev/ui/figures/indicator.PNG differ
diff --git a/en/application-dev/ui/figures/loop_false.gif b/en/application-dev/ui/figures/loop_false.gif
new file mode 100644
index 0000000000000000000000000000000000000000..29da104b99cad5fedbe41ea99593741497596b90
Binary files /dev/null and b/en/application-dev/ui/figures/loop_false.gif differ
diff --git a/en/application-dev/ui/figures/loop_true.gif b/en/application-dev/ui/figures/loop_true.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1c999814a654ef2a1fc55c096c616350abe058ee
Binary files /dev/null and b/en/application-dev/ui/figures/loop_true.gif differ
diff --git a/en/application-dev/ui/figures/two.PNG b/en/application-dev/ui/figures/two.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..c692643e6b500ec305d9cab801a40f5dbc2fcbca
Binary files /dev/null and b/en/application-dev/ui/figures/two.PNG differ
diff --git a/en/application-dev/ui/figures/vertical-swiping.PNG b/en/application-dev/ui/figures/vertical-swiping.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..07e1c228c93ccc4f45d88a82f6b2e5773bc4629a
Binary files /dev/null and b/en/application-dev/ui/figures/vertical-swiping.PNG differ
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-arkui.md
index 3e4d9a57601c4d8b930451927c91bb209c4954b9..8b4e22b93cf9d6124ac0ac1082ad903fb25ba11d 100644
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-arkui.md
+++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-arkui.md
@@ -214,4 +214,4 @@ N/A
To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them.
-2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-state-mgmt-page-level.md).
+2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-observed-and-objectlink.md).
diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-arkui.md
index 22da0d9e759e54eb8cfbe9bad7c77745a924697c..cb91d8c6854e5a39c552f2cb3016d671aa0664c5 100644
--- a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-arkui.md
+++ b/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-arkui.md
@@ -214,7 +214,7 @@ N/A
To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them.
-2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-state-mgmt-page-level.md).
+2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-observed-and-objectlink.md).
## cl.arkui.3 Change of the onScrollBegin Event of the \ and \ Components
@@ -231,8 +231,8 @@ The **onScrollBegin** event is deprecated and must be replaced with the **onScro
| onScrollBegin(event: (dx: number, dy: number) => { dxRemain: number, dyRemain: number }) | onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }) |
For details about the **onScrollFrameBegin** event, see the following:
-- [Scroll](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/arkui-ts/ts-container-scroll.md#events)
-- [List](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md#events)
+- [Scroll](../../../application-dev/reference/arkui-ts/ts-container-scroll.md#events)
+- [List](../../../application-dev/reference/arkui-ts/ts-container-list.md#events)
**Adaptation Guide**
diff --git a/zh-cn/application-dev/IDL/idl-guidelines.md b/zh-cn/application-dev/IDL/idl-guidelines.md
index c9c92172d7154c7e24d48256b1d8577aafaf4577..f2f89c45fe75c039447ce53593ccaa98b0c51dcd 100644
--- a/zh-cn/application-dev/IDL/idl-guidelines.md
+++ b/zh-cn/application-dev/IDL/idl-guidelines.md
@@ -160,7 +160,7 @@ OpenHarmony IDL容器数据类型与Ts数据类型、C++数据类型的对应关
若不存在,可对应版本前往[docs仓版本目录](../../release-notes)下载SDK包,以[3.2Beta3版本](../../release-notes/OpenHarmony-v3.2-beta3.md)为例,可通过镜像站点获取。
-关于如何替换DevEco Studio的SDK包具体操作,参考[full-SDK替换指南](../quick-start/full-sdk-compile-guide.md)中的替换方法。
+关于如何替换DevEco Studio的SDK包具体操作,参考[full-SDK替换指南](../faqs/full-sdk-compile-guide.md)中的替换方法。
得到idl工具的可执行文件后,根据具体场景进行后续开发步骤。
diff --git a/zh-cn/application-dev/application-models/Readme-CN.md b/zh-cn/application-dev/application-models/Readme-CN.md
index 791c5a8f7660d90c6561665120d58d07fe08d3c3..9127d61840ae5a458f2a7499979477920f52e557 100644
--- a/zh-cn/application-dev/application-models/Readme-CN.md
+++ b/zh-cn/application-dev/application-models/Readme-CN.md
@@ -20,7 +20,7 @@
- [AccessibilityExtensionAbility](accessibilityextensionability.md)
- [EnterpriseAdminExtensionAbility](enterprise-extensionAbility.md)
- [InputMethodExtensionAbility](inputmethodextentionability.md)
- - [WindowExtensionAbility](windowextensionability.md)
+ - [WindowExtensionAbility(仅对系统应用开放)](windowextensionability.md)
- 服务卡片开发指导(Stage模型)
- [服务卡片概述](service-widget-overview.md)
- 开发基于ArkTS UI的卡片
@@ -73,15 +73,15 @@
- [静态订阅公共事件(仅对系统应用开放)](common-event-static-subscription.md)
- [取消动态订阅公共事件](common-event-unsubscription.md)
- [公共事件发布](common-event-publish.md)
- - [移除粘性公共事件](common-event-remove-sticky.md)
+ - [移除粘性公共事件(仅对系统应用开放)](common-event-remove-sticky.md)
- [后台服务](background-services.md)
- 了解线程模型
- [线程模型概述](thread-model-stage.md)
- [使用Emitter进行线程间通信](itc-with-emitter.md)
- [使用Worker进行线程间通信](itc-with-worker.md)
- - 任务管理
- - [任务管理场景介绍](mission-management-overview.md)
- - [任务管理与启动模式](mission-management-launch-type.md)
+ - 任务(Mission)管理
+ - [任务(Mission)管理场景介绍](mission-management-overview.md)
+ - [任务(Mission)与启动模式](mission-management-launch-type.md)
- [页面栈及任务链](page-mission-stack.md)
- [设置任务快照的图标和名称](mission-set-icon-name-for-task-snapshot.md)
- [Stage模型应用配置文件](config-file-stage.md)
diff --git a/zh-cn/application-dev/application-models/application-component-configuration-stage.md b/zh-cn/application-dev/application-models/application-component-configuration-stage.md
index 4506a00c7b3c2961dee41a3df6fe7e4da6498041..4ee90958c0fb0c17655fc3fa6b09ff1819e956f5 100644
--- a/zh-cn/application-dev/application-models/application-component-configuration-stage.md
+++ b/zh-cn/application-dev/application-models/application-component-configuration-stage.md
@@ -2,12 +2,12 @@
在开发应用时,需要配置应用的一些标签,例如应用的包名、图标等标识特征的属性。本文描述了在开发应用需要配置的一些关键标签。
-图标和标签通常一起配置,可以分为应用图标、应用标签和入口图标、入口标签,分别对应[app.json5配置文件](../quick-start/app-configuration-file.md)和[module.json5配置文件](../quick-start/module-configuration-file.md)文件中的icon和label标签。
+图标和标签通常一起配置,可以分为应用图标、应用标签和入口图标、入口标签,分别对应[app.json5配置文件](../quick-start/app-configuration-file.md)和[module.json5配置文件](../quick-start/module-configuration-file.md)中的icon和label标签。
-应用图标和标签是在设置应用中使用,例如设置应用中的应用列表。入口图标是应用安装完成后在设备桌面上显示出来的,如图一所示。入口图标是以[UIAbility](uiability-overview.md)为粒度,支持同一个应用存在多个入口图标和标签,点击后进入对应的UIAbility界面。
+应用图标和标签是在设置应用中使用,例如设置应用中的应用列表。入口图标是应用安装完成后在设备桌面上显示出来的,如下图所示。入口图标是以[UIAbility](uiability-overview.md)为粒度,支持同一个应用存在多个入口图标和入口标签,点击后进入对应的UIAbility界面。
**图1** 应用图标和标签
-、
+
- **应用包名配置**
@@ -62,6 +62,33 @@
}
}
```
+ OpenHarmony系统对无图标应用严格管控,防止一些恶意应用故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户的手机安全。
+
+ 如果应用确需隐藏入口图标,需要配置AllowAppDesktopIconHide应用特权,具体配置方式参考[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md)。详细的入口图标及入口标签的显示规则如下。
+
+ * HAP中包含UIAbility
+ * 在module.json5配置文件的abilities标签中设置了入口图标
+ * 该应用没有隐藏图标的特权
+ * 系统将使用该UIAbility配置的icon作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到该UIAbility首页。
+ * 系统将使用该UIAbility配置的label作为入口标签,并显示在桌面上,如果没有配置label,系统将使用app.json5中的label作为入口标签,并显示在桌面上。
+ * 该应用具有隐藏图标的特权
+ * 桌面应用查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
+ * 在module.json5配置文件的abilities标签中未设置入口图标
+ * 该应用没有隐藏图标的特权
+ * 系统将使用app.json5中的icon作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到应用管理中对应的应用详情页面,如下图所示。
+ * 系统将使用app.json5中的label作为入口标签,并显示在桌面上。
+ * 该应用具有隐藏图标的特权
+ * 桌面应用查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
+ * HAP中不包含UIAbility
+ * 该应用没有隐藏图标的特权
+ * 系统将使用app.json5中的icon作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到应用管理中对应的应用详情页面,如下图所示。
+ * 系统将使用app.json5中的label作为入口标签,并显示在桌面上。
+ * 该应用具有隐藏图标的特权
+ * 桌面应用查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
+
+ **图2** 应用的详情页示意图
+ 
+
- **应用版本声明配置**
应用版本声明需要在工程的AppScope目录下的[app.json5配置文件](../quick-start/app-configuration-file.md)中配置versionCode标签和versionName标签。versionCode用于标识应用的版本号,该标签值为32位非负整数。此数字仅用于确定某个版本是否比另一个版本更新,数值越大表示版本越高。versionName标签标识版本号的文字描述。
diff --git a/zh-cn/application-dev/application-models/common-event-overview.md b/zh-cn/application-dev/application-models/common-event-overview.md
index 08445abe772f5863b17dc68cc1cf2c20232128ac..4789a84f3cb05653c0dc5778e5be10445d2098c5 100644
--- a/zh-cn/application-dev/application-models/common-event-overview.md
+++ b/zh-cn/application-dev/application-models/common-event-overview.md
@@ -7,18 +7,15 @@ OpenHarmony通过CES(Common Event Service,公共事件服务)为应用程
公共事件从系统角度可分为:系统公共事件和自定义公共事件。
-- 系统公共事件:CES内部定义的公共事件,只有系统应用和系统服务才能发布,例如HAP安装,更新,卸载等公共事件。目前支持的系统公共事件详见[系统公共事件列表](../reference/apis/commonEventManager-definitions.md)。
-
-- 自定义公共事件:应用自定义一些公共事件用来实现跨进程的事件通信能力。
+- 系统公共事件:CES内部定义的公共事件,当前仅支持系统应用和系统服务发布,例如HAP安装,更新,卸载等公共事件。目前支持的系统公共事件请参见[系统公共事件列表](../reference/apis/commonEventManager-definitions.md)。
+- 自定义公共事件:应用定义的公共事件,可用于实现跨进程的事件通信能力。
公共事件按发送方式可分为:无序公共事件、有序公共事件和粘性公共事件。
-- 无序公共事件:CES转发公共事件时,不考虑订阅者是否接收到,且订阅者接收到的顺序与其订阅顺序无关。
-
-- 有序公共事件:CES转发公共事件时,根据订阅者设置的优先级等级,在接收到优先级较高的一个订阅者回复后,再向下一个优先级较低的订阅者转发公共事件。具有相同优先级的订阅者将按随机顺序收到公共事件。
-
+- 无序公共事件:CES在转发公共事件时,不考虑订阅者是否接收到该事件,也不保证订阅者接收到该事件的顺序与其订阅顺序一致。
+- 有序公共事件:CES在转发公共事件时,根据订阅者设置的优先级等级,优先将公共事件发送给优先级较高的订阅者,等待其成功接收该公共事件之后再将事件发送给优先级较低的订阅者。如果有多个订阅者具有相同的优先级,则他们将随机接收到公共事件。
- 粘性公共事件:能够让订阅者收到在订阅前已经发送的公共事件就是粘性公共事件。普通的公共事件只能在订阅后发送才能收到,而粘性公共事件的特殊性就是可以先发送后订阅,同时也支持先订阅后发送。发送粘性事件必须是系统应用或系统服务,粘性事件发送后会一直存在系统中,且发送者需要申请`ohos.permission.COMMONEVENT_STICKY`权限,配置方式请参见[配置文件权限声明](../security/accesstoken-guidelines.md#配置文件权限声明)。
diff --git a/zh-cn/application-dev/application-models/common-event-remove-sticky.md b/zh-cn/application-dev/application-models/common-event-remove-sticky.md
index 5311f6e9aacf92631f847315deffcd83a2c39e6e..7205bf98b521425753f558512dc550ea949b8d5f 100644
--- a/zh-cn/application-dev/application-models/common-event-remove-sticky.md
+++ b/zh-cn/application-dev/application-models/common-event-remove-sticky.md
@@ -1,4 +1,4 @@
-# 移除粘性公共事件
+# 移除粘性公共事件(仅对系统应用开放)
## 场景介绍
@@ -16,13 +16,19 @@
## 开发步骤
-1. 导入模块。
-
+1. 需要申请`ohos.permission.COMMONEVENT_STICKY`权限,配置方式请参见[配置文件权限声明](../security/accesstoken-guidelines.md#配置文件权限声明)。
+
+2. 导入模块。
+
```ts
import commonEventManager from '@ohos.commonEventManager';
```
-2. 移除的粘性公共事件,必须是本应用之前已发布的粘性公共事件,发布粘性公共事件参考[公共事件发布](common-event-publish.md)章节。
+3. 调用[`removeStickyCommonEvent()`](../reference/apis/js-apis-commonEventManager.md#commoneventmanagerremovestickycommonevent10)方法移除对应的粘性公共事件。
+
+ > **说明:**
+ >
+ > 移除的粘性公共事件,必须是本应用之前已发布的粘性公共事件,发布粘性公共事件参考[公共事件发布](common-event-publish.md)章节。
```ts
commonEventManager.removeStickyCommonEvent("sticky_event", (err) => { // sticky_event粘性公共事件名
diff --git a/zh-cn/application-dev/application-models/common-event-static-subscription.md b/zh-cn/application-dev/application-models/common-event-static-subscription.md
index 5cbe408e03c07950ca0e337fb5f76c992765442d..3c77b9fd6e6846773bab03f4616a5592278598e0 100644
--- a/zh-cn/application-dev/application-models/common-event-static-subscription.md
+++ b/zh-cn/application-dev/application-models/common-event-static-subscription.md
@@ -2,29 +2,37 @@
## 场景介绍
-静态订阅者在未接收订阅的目标事件时,处于未拉起状态,当系统或应用发布了指定的公共事件后,静态订阅者将被拉起,并执行onReceiveEvent回调,开发者可通过在onReceiveEvent回调中执行业务逻辑,实现当应用接收到特定公共事件时执行业务逻辑的目的。例如,某应用希望在设备开机的时候执行一些初始化任务,那么该应用可以静态订阅开机事件,在收到开机事件后会拉起该应用,然后执行初始化任务。静态订阅是通过配置文件声明和实现继承自StaticSubscriberExtensionAbility的类实现对公共事件的订阅。**需要注意的是,静态订阅公共事件对系统功耗有一定影响,建议谨慎使用**。
+静态订阅者在未接收订阅的目标事件时,处于未拉起状态。当系统或应用发布了指定的公共事件后,静态订阅者将被拉起,并执行[`onReceiveEvent()`](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md#staticsubscriberextensionabilityonreceiveevent)回调。
+
+开发者可以通过在[`onReceiveEvent()`](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md#staticsubscriberextensionabilityonreceiveevent)回调中执行业务逻辑,实现当应用接收到特定公共事件时执行业务逻辑的目的。例如,应用希望在设备开机时执行一些初始化任务,那么该应用可以静态订阅开机事件,在收到开机事件后会拉起该应用,然后执行初始化任务。
+
+静态订阅是通过配置文件声明和实现继承自[`StaticSubscriberExtensionAbility`](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md)的类实现对公共事件的订阅。
+
+> **说明:**
+>
+> 需要注意的是,静态订阅公共事件对系统功耗有一定影响,建议谨慎使用。
## 开发步骤
-1. 静态订阅者声明
+1. 静态订阅者声明。
- 声明一个静态订阅者,首先需要在工程中新建一个ExtensionAbility,该ExtensionAbility从StaticSubscriberExtensionAbility派生,其代码实现如下:
+ 声明一个静态订阅者,首先需要在工程中新建一个ExtensionAbility,该ExtensionAbility从StaticSubscriberExtensionAbility派生。
+
+ 开发者可以在[`onReceiveEvent()`](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md#staticsubscriberextensionabilityonreceiveevent)回调中实现业务逻辑。
```ts
import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriberExtensionAbility'
export default class StaticSubscriber extends StaticSubscriberExtensionAbility {
onReceiveEvent(event) {
- console.info('onReceiveEvent, event:' + event.event);
+ console.info('onReceiveEvent, event: ' + event.event);
}
}
```
- 开发者可以在onReceiveEvent中实现业务逻辑。
-
-2. 静态订阅者工程配置
+2. 静态订阅者工程配置。
- 在完成静态订阅者的代码实现后,需要将该订阅者配置到系统的module.json5中,配置形式如下:
+ 在完成静态订阅者的代码实现后,需要在[module.json5配置文件](../quick-start/module-configuration-file.md)中进行配置订阅者信息。
```ts
{
@@ -33,7 +41,7 @@
"extensionAbilities": [
{
"name": "StaticSubscriber",
- "srcEntry": "./ets/StaticSubscriber/StaticSubscriber.ts",
+ "srcEntry": "./ets/staticsubscriber/StaticSubscriber.ts",
"description": "$string:StaticSubscriber_desc",
"icon": "$media:icon",
"label": "$string:StaticSubscriber_label",
@@ -52,19 +60,20 @@
}
```
- 上述json文件主要关注以下字段:
+ 其中部分字段解释如下:
- - srcEntry : 表示ExtensionAbility的入口文件路径,即步骤2中声明的静态订阅者所在的文件路径
+ - srcEntry:表示ExtensionAbility的入口文件路径,即步骤2中声明的静态订阅者所在的文件路径。
- - type: 表示ExtensionAbility的类型,对于静态订阅者需要声明为“staticSubscriber”
+ - type:表示ExtensionAbility的类型,对于静态订阅者需要声明为`staticSubscriber`。
- - metadata: 表示ExtensionAbility的二级配置文件信息。由于不同的ExtensionAbility类型其配置信息不尽相同,因此需要使用不同的config文件表示其具体配置信息。
- - name:表示ExtensionAbility的类型名称,对于静态订阅类型,name必须声明为“ohos.extension.staticSubscriber”,否则无法识别为静态订阅者;
- - resource: 字段表示ExtensionAbility的配置信息路径,由开发者自行定义,在本例中表示路径为“resources/base/profile/subscribe.json"。
+ - metadata:表示ExtensionAbility的二级配置文件信息。由于不同的ExtensionAbility类型其配置信息不尽相同,因此需要使用不同的config文件表示其具体配置信息。
+ - name:表示ExtensionAbility的类型名称,对于静态订阅类型,name必须声明为`ohos.extension.staticSubscriber`,否则无法识别为静态订阅者。
+ - resource:字段表示ExtensionAbility的配置信息路径,由开发者自行定义,在本例中表示路径为`resources/base/profile/subscribe.json`。
- metadata指向的二级配置文件的通常形式如下:
- ```ts
+3. 配置metadata指向的二级配置文件。
+
+ ```json
{
"commonEvents": [
{
@@ -78,28 +87,32 @@
}
```
- 需要注意二级配置文件必须按照此形式进行声明,否则会无法正确识别。下面对字段进行介绍:
-
- - name: 静态订阅ExtensionAbility的名称,需要和module.json5中声明的ExtensionAbility的name一致
+ 需要注意二级配置文件必须按照此形式进行声明,否则会无法正确识别。部分字段解释如下:
- - permission:订阅者要求的发布者需要具备的权限,对于发布了目标事件但不具备permission中声明的权限的发布者将被视为非法事件不予发布
+ - name: 静态订阅ExtensionAbility的名称,需要和module.json5中声明的ExtensionAbility的name一致。
+ - permission:订阅者要求的发布者需要具备的权限,对于发布了目标事件但不具备permission中声明的权限的发布者将被视为非法事件不予发布。
+ - events:订阅的目标事件列表。
- - events: 订阅的目标事件列表
+4. 修改设备的[预置配置文件](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_permissions.json)。[预置配置文件](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_permissions.json)在设备上的路径为`/system/etc/app/install_list_permission.json`,设备开机启动时会读取该配置文件,在应用安装会对在文件中配置的`allowCommonEvent`公共事件类型进行授权。预授权配置文件字段内容包括`bundleName`、`app_signature`和`allowCommonEvent`。
-3. 修改设备系统配置文件
+ - `bundleName`字段配置为应用的Bundle名称。
+ - `app_signature`字段配置为应用的指纹信息。指纹信息的配置参见[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md#install_list_capabilityjson中配置)。
+ - `allowCommonEvent`字段配置为允许静态广播拉起的公共事件项。
- 修改设备系统配置文件 **/system/etc/app/install_list_capability.json**,将静态订阅应用者的包名添加至该json文件中即可。
+ > **说明**:当前仅支持预置应用配置该文件。
- ```json
- {
- "install_list": [
- {
- "bundleName": "ohos.extension.staticSubscriber",
- "allowCommonEvent": ["usual.event.A", "usual.event.B"],
- }
- ]
- }
+ ```json
+ [
+ ...
+ {
+ "bundleName": "com.example.myapplication", // Bundle名称
+ "app_signature": ["****"], // 指纹信息
+ "allowCommonEvent": ["usual.event.A", "usual.event.B"], // 允许静态广播拉起的公共事件项
+ ]
+ }
+ ]
```
+
## 相关示例
针对StaticSubscriberExtensionAbility开发,可参考如下实例:
diff --git a/zh-cn/application-dev/application-models/dataability-overview.md b/zh-cn/application-dev/application-models/dataability-overview.md
index fdee07b53dc8a777eb3a5937ad550e506eeb978c..40a2b556a376ace6c5f4eb9dcc77d052ae175c22 100644
--- a/zh-cn/application-dev/application-models/dataability-overview.md
+++ b/zh-cn/application-dev/application-models/dataability-overview.md
@@ -8,4 +8,3 @@ DataAbility,即"使用Data模板的Ability",主要用于对外部提供统
数据的存放形式多样,可以是数据库,也可以是磁盘上的文件。DataAbility对外提供对数据的增、删、改、查,以及打开文件等接口,这些接口的具体实现由开发者提供。
-
diff --git a/zh-cn/application-dev/application-models/datashareextensionability.md b/zh-cn/application-dev/application-models/datashareextensionability.md
deleted file mode 100644
index 9b20dbce43e538872b6a6f117f87fce6a8391e20..0000000000000000000000000000000000000000
--- a/zh-cn/application-dev/application-models/datashareextensionability.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# DataShareExtensionAbility(仅对系统应用开放)
-
-
-DataShareExtensionAbility提供了数据分享的能力,系统应用可以实现一个DataShareExtensionAbility,也可以访问系统中已有的DataShareExtensionAbility,针对三方应用仅开放访问系统中已有DataShareExtensionAbility的能力,详细介绍请参见[同设备跨应用数据共享](../database/share-device-data-across-apps-overview.md)。
diff --git a/zh-cn/application-dev/application-models/extensionability-overview.md b/zh-cn/application-dev/application-models/extensionability-overview.md
index 0ddc21e83ce993a410eaacbfb3c1402da335527e..dbde61db3b29bab9f689cb20d30b16a38a4e23f2 100644
--- a/zh-cn/application-dev/application-models/extensionability-overview.md
+++ b/zh-cn/application-dev/application-models/extensionability-overview.md
@@ -17,11 +17,11 @@ ExtensionAbility组件是基于特定场景(例如服务卡片、输入法等
- [AccessibilityExtensionAbility](../reference/apis/js-apis-application-accessibilityExtensionAbility.md):ACCESSIBILITY类型的ExtensionAbility组件,用于提供辅助功能业务的能力。
-- [DataShareExtensionAbility](../reference/apis/js-apis-application-dataShareExtensionAbility.md):DATA_SHARE类型的ExtensionAbility组件,用于提供支持数据共享业务的能力。
+- [DataShareExtensionAbility(仅对系统应用开放)](../reference/apis/js-apis-application-dataShareExtensionAbility.md):DATA_SHARE类型的ExtensionAbility组件,用于提供支持数据共享业务的能力。
- [StaticSubscriberExtensionAbility](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md):STATIC_SUBSCRIBER类型的ExtensionAbility组件,用于提供静态广播的能力。
-- [WindowExtensionAbility](../reference/apis/js-apis-application-windowExtensionAbility.md):WINDOW类型的ExtensionAbility组件,用于提供界面组合扩展能力,允许系统应用进行跨应用的界面拉起和嵌入。
+- [WindowExtensionAbility(仅对系统应用开放)](../reference/apis/js-apis-application-windowExtensionAbility.md):WINDOW类型的ExtensionAbility组件,用于提供界面组合扩展能力,允许系统应用进行跨应用的界面拉起和嵌入。
- [EnterpriseAdminExtensionAbility](../reference/apis/js-apis-EnterpriseAdminExtensionAbility.md):ENTERPRISE_ADMIN类型的ExtensionAbility组件,用于提供企业管理时处理管理事件的能力,比如设备上应用安装事件、锁屏密码输入错误次数过多事件等。
diff --git a/zh-cn/application-dev/application-models/figures/application_details.jpg b/zh-cn/application-dev/application-models/figures/application_details.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a2ba04f9143be7ca224ea77257e4ada4f76943c1
Binary files /dev/null and b/zh-cn/application-dev/application-models/figures/application_details.jpg differ
diff --git a/zh-cn/application-dev/application-models/hop-cross-device-migration.md b/zh-cn/application-dev/application-models/hop-cross-device-migration.md
index edd2b838a2edf7130300a91ea5f713148dd48520..a7b82f117b886ab995e22cfb90c10d4a912f9c39 100644
--- a/zh-cn/application-dev/application-models/hop-cross-device-migration.md
+++ b/zh-cn/application-dev/application-models/hop-cross-device-migration.md
@@ -16,7 +16,7 @@
跨端迁移流程如下图所示。
- **图1** 跨端迁移流程图
+**图1** 跨端迁移流程图

diff --git a/zh-cn/application-dev/application-models/inputmethodextentionability.md b/zh-cn/application-dev/application-models/inputmethodextentionability.md
index 0c48d7750ad017f88dfebb648ee3e04502602cb3..53b3e6124398b5284bca31f73e8212fd2dad4ae6 100644
--- a/zh-cn/application-dev/application-models/inputmethodextentionability.md
+++ b/zh-cn/application-dev/application-models/inputmethodextentionability.md
@@ -16,6 +16,7 @@
服务被首次创建时触发该回调,开发者可以在此进行一些初始化的操作,例如注册公共事件监听等。
> **说明:**
+ >
> 如果服务已创建,再次启动该InputMethodExtensionAbility不会触发onCreate()回调。
- **onDestroy**
diff --git a/zh-cn/application-dev/application-models/mission-management-launch-type.md b/zh-cn/application-dev/application-models/mission-management-launch-type.md
index 2c4cb855d36cf5822a31c6226fec4b74df368fa0..93b7811f18f9480de3f3f659b9e91d63a437e0d8 100644
--- a/zh-cn/application-dev/application-models/mission-management-launch-type.md
+++ b/zh-cn/application-dev/application-models/mission-management-launch-type.md
@@ -1,4 +1,4 @@
-# 任务管理与启动模式
+# 任务(Mission)与启动模式
如前文所述,一个UIAbility实例对应一个任务。UIAbility实例个数与UIAbility配置的启动模式有关。在FA模型下,通过config.json配置文件中的“launchType”属性配置;在Stage模型下,通过[module.json5配置文件](../quick-start/module-configuration-file.md)中的“launchType”属性配置。
diff --git a/zh-cn/application-dev/application-models/mission-management-overview.md b/zh-cn/application-dev/application-models/mission-management-overview.md
index b7dc61505981fd00d6863909d39465b5d8f817dd..fff740fe26ef54d4bb85ac5bfd759f6519f9a681 100644
--- a/zh-cn/application-dev/application-models/mission-management-overview.md
+++ b/zh-cn/application-dev/application-models/mission-management-overview.md
@@ -1,7 +1,7 @@
-# 任务管理场景介绍
+# 任务(Mission)管理场景介绍
-任务管理相关的基本概念如下:
+任务(Mission)管理相关的基本概念如下:
- AbilityRecord:系统服务侧管理一个UIAbility实例的最小单元,对应一个应用侧的UIAbility组件实例。系统服务侧管理UIAbility实例数量上限为512个。
diff --git a/zh-cn/application-dev/application-models/module-switch.md b/zh-cn/application-dev/application-models/module-switch.md
index b915e2dcf58f5e79c6e4af3bf13516dff8fd6b12..a820a0fb19d5f806fb9dfa896117c78964b8c565 100644
--- a/zh-cn/application-dev/application-models/module-switch.md
+++ b/zh-cn/application-dev/application-models/module-switch.md
@@ -3,7 +3,7 @@
从FA模型切换到Stage模型时,开发者需要将config.json文件module标签下的配置迁移到module.json5配置文件module标签下,具体差异见下列表格。
-### **表1** FA模型module标签与Stage模型module标签差异对比
+**表1** FA模型module标签与Stage模型module标签差异对比
| FA标签 | 标签说明 | 对应的Stage标签 | 差异说明 |
| -------- | -------- | -------- | -------- |
@@ -15,8 +15,8 @@
| distro对象中的moduleType | 标识当前HAP的类型,包括两种类型:entry和feature。另外,如果表示HAR包类型,请设置为har | type | 标签变更。 |
| distro对象中的installationFree | 标识当前HAP是否支持免安装特性 | installationFree | 标签变更。 |
| distro对象中的deliveryWithInstall | 标识当前HAP是否支持随应用安装 | deliveryWithInstall | 标签变更。 |
-| metaData | 标识HAP的元信息 | metadata | 具体差异如[表2](#表2-fa模型metadata和stage中metadata对比)。 |
-| abilities | 标识当前模块内的所有Ability | abilities | 具体差异如[表5](#表5-fa模型和stage中abilities差异对比)。 |
+| metaData | 标识HAP的元信息 | metadata | 具体差异见表2。 |
+| abilities | 标识当前模块内的所有Ability | abilities | 具体差异见表5。 |
| js | 标识基于ArkUI框架开发的JS模块集合,其中的每个元素代表一个JS模块的信息 | pages | Stage模型在module标签下保留该对象中的pages,window配置与pages的下一级。 |
| shortcuts | 标识应用的快捷方式信息 | shortcut_config.json文件 | 在开发视图的resources/base/profile下面定义配置文件shortcut_config.json。 |
| reqPermissions | 标识应用运行时向系统申请的权限 | requestPermissions | 标签名称变更。 |
@@ -27,38 +27,38 @@
| entryTheme | 此标签标识OpenHarmony内部主题的关键字 | / | Stage模型不支持。 |
-### 表2 FA模型metaData和Stage中metadata对比
+**表2** FA模型metaData和Stage中metadata对比
| FA标签 | 标签说明 | 对应的Stage模型标签 | 差异对比 |
| -------- | -------- | -------- | -------- |
| parameters | 标识调用Ability时所有调用参数的元信息 | / | Stage模型不支持。 |
| results | 标识Ability返回值的元信息 | / | Stage模型不支持。 |
-| customizeData | 该标签标识父级组件的自定义元信息,Parameters和results在application不可配 | metadata | 具体差异见[表3](#表3-fa模型metadata的customizedata和stage中metadata对比)。 |
+| customizeData | 该标签标识父级组件的自定义元信息,Parameters和results在application不可配 | metadata | 具体差异见表3。 |
-### 表3 FA模型metaData的customizeData和Stage中metadata对比
+**表3** FA模型metaData的customizeData和Stage中metadata对比
| FA标签 | 标签说明 | 对应的Stage模型标签 | 差异对比 |
| -------- | -------- | -------- | -------- |
| name | 标识数据项的键名称。字符串最大长度为255字节 | name | 无。 |
| value | 标识数据项的值。字符串最大长度为255字节。 | value | 无。 |
-| extra | 标识当前custom数据的格式,取值为表示extra的资源值。 | resource | 标签变更。具体实例见[表4](#表4-fa模型metadata和stage中metadata示例)。 |
+| extra | 标识当前custom数据的格式,取值为表示extra的资源值。 | resource | 标签变更。具体实例见表4。 |
-### 表4 FA模型metaData和Stage中metadata示例
+**表4** FA模型metaData和Stage中metadata示例
| FA模型示例 | Stage模型示例 |
| -------- | -------- |
| “meteData”: { "customizeDate": [{ "name": "label", "value": "string", "extra": "$string:label", }] } | “meteData”: [{ "name": "label", "value": "string", "resource": "$string:label", }] |
-### 表5 FA模型和Stage中abilities差异对比
+**表5** FA模型和Stage中abilities差异对比
| FA模型的abilities对象标签 | 描述 | Stage模型中abilities对象标签 | 差异对比 |
| -------- | -------- | -------- | -------- |
| process | 运行应用程序或Ability的进程名称 | / | Stage模型不支持abilities中配置,在module标签下配置process |
| uri | 标识Ability的统一资源标识符 | / | Stage模型不支持 |
| deviceCapability | 标识Ability运行时要求设备具有的能力,采用字符串数组的格式表示 | / | Stage模型不支持 |
-| metaData | 该标签标识ability的元信息。 | metadata | 具体差异如[表2](#表2-fa模型metadata和stage中metadata对比) |
+| metaData | 该标签标识ability的元信息。 | metadata | 具体差异见表2 |
| type | 标识Ability的类型 | / | Stage模型不支持 |
| grantPermission | 指定是否可以向Ability内任何数据授予权限 | / | abilities内不支持; |
| readPermission | 标识读取Ability的数据所需的权限。该标签仅适用于data类型的Ability | / | abilities内不支持;在extensionAbilities标签中支持 |
diff --git a/zh-cn/application-dev/application-models/process-model-stage.md b/zh-cn/application-dev/application-models/process-model-stage.md
index 0717b4c02d45622ddb2606ee7f0b6c6f0bda4ecf..cf030e0ba0931f75a7ebd64757d8a355b8df36a1 100644
--- a/zh-cn/application-dev/application-models/process-model-stage.md
+++ b/zh-cn/application-dev/application-models/process-model-stage.md
@@ -1,16 +1,17 @@
# 进程模型概述
-OpenHarmony的进程模型如下图所示:
+OpenHarmony的进程模型如下图所示。
-- 应用中(同一Bundle名称)的所有UIAbility、ServiceExtensionAbility、DataShareExtensionAbility运行在同一个独立进程中,即图中绿色部分的“Main Process”。
+- 应用中(同一Bundle名称)的所有UIAbility、ServiceExtensionAbility、DataShareExtensionAbility运行在同一个独立进程中,如下图中绿色部分的“Main Process”。
-- 应用中(同一Bundle名称)的同一类型ExtensionAbility(除ServiceExtensionAbility和DataShareExtensionAbility外)运行在一个独立进程中,即图中蓝色部分的“FormExtensionAbility Process”、“InputMethodExtensionAbility Process”、其他ExtensionAbility Process。
+- 应用中(同一Bundle名称)的同一类型ExtensionAbility(除ServiceExtensionAbility和DataShareExtensionAbility外)运行在一个独立进程中,如下图中蓝色部分的“FormExtensionAbility Process”、“InputMethodExtensionAbility Process”、其他ExtensionAbility Process。
-- WebView拥有独立的渲染进程,即图中黄色部分的“Render Process”。
+- WebView拥有独立的渲染进程,如下图中黄色部分的“Render Process”。
- **图1** 进程模型示意图
+
+**图1** 进程模型示意图

> 说明:
@@ -20,7 +21,7 @@ OpenHarmony的进程模型如下图所示:
在上述模型基础上,对于系统应用可以通过申请多进程权限(如下图所示),为指定HAP配置一个自定义进程名,该HAP中的UIAbility、DataShareExtensionAbility、ServiceExtensionAbility就会运行在自定义进程中。不同的HAP可以通过配置不同的进程名运行在不同进程中。
- **图2** 多进程示意图
+**图2** 多进程示意图

@@ -29,4 +30,4 @@ OpenHarmony的进程模型如下图所示:
- [公共事件机制](common-event-overview.md):多用于一对多的通信场景,公共事件发布者可能存在多个订阅者同时接收事件。
-- [后台服务机制](background-services.md):当前主要通过[ServiceExtensionAbility](serviceextensionability.md)的能力实现。
+- [后台服务机制](background-services.md):通过[ServiceExtensionAbility](serviceextensionability.md)的能力实现。
diff --git a/zh-cn/application-dev/application-models/serviceextensionability.md b/zh-cn/application-dev/application-models/serviceextensionability.md
index a94629215d8c537f94f107101db9effa4eb93dee..1845ff4f140437db44b27c7b4b0eb553322c8761 100644
--- a/zh-cn/application-dev/application-models/serviceextensionability.md
+++ b/zh-cn/application-dev/application-models/serviceextensionability.md
@@ -67,7 +67,7 @@
只有系统应用才允许实现ServiceExtensionAbility,因此开发者在开发之前需做如下准备:
-- **替换Full SDK**:ServiceExtensionAbility相关接口都被标记为System-API,默认对开发者隐藏,因此需要手动从镜像站点获取Full SDK,并在DevEco Studio中替换,具体操作可参考[替换指南](../quick-start/full-sdk-switch-guide.md)。
+- **替换Full SDK**:ServiceExtensionAbility相关接口都被标记为System-API,默认对开发者隐藏,因此需要手动从镜像站点获取Full SDK,并在DevEco Studio中替换,具体操作可参考[替换指南](../faqs/full-sdk-switch-guide.md)。
- **申请AllowAppUsePrivilegeExtension特权**:只有具有AllowAppUsePrivilegeExtension特权的应用才允许开发ServiceExtensionAbility,具体申请方式可参考[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md)。
diff --git a/zh-cn/application-dev/application-models/thread-model-stage.md b/zh-cn/application-dev/application-models/thread-model-stage.md
index b05ced9d92e3d3578e2b29de3aea52fd4ea99718..57ac44d934cee35e9b57e1a67bd8dd8047fa239a 100644
--- a/zh-cn/application-dev/application-models/thread-model-stage.md
+++ b/zh-cn/application-dev/application-models/thread-model-stage.md
@@ -2,19 +2,20 @@
在OpenHarmony应用中,每个进程都会有一个主线程,主线程具有以下职责:
-1. 执行UI绘制;
-2. 管理主线程的ArkTS引擎实例,使多个UIAbility组件能够运行在其之上;
-3. 管理其他线程(例如Worker线程)的ArkTS引擎实例,例如启动和终止其他线程;
-4. 分发交互事件;
-5. 处理应用代码的回调,包括事件处理和生命周期管理;
-6. 接收Worker线程发送的消息;
+1. 执行UI绘制。
+2. 管理主线程的ArkTS引擎实例,使多个UIAbility组件能够运行在其之上。
+3. 管理其他线程(例如Worker线程)的ArkTS引擎实例,例如启动和终止其他线程。
+4. 分发交互事件。
+5. 处理应用代码的回调,包括事件处理和生命周期管理。
+6. 接收Worker线程发送的消息。
除了主线程外,还有一类独立的Worker线程,用于执行耗时操作。Worker线程在主线程中创建,与主线程相互独立,但不能直接操作UI。最多可以创建7个Worker线程。

-基于OpenHarmony的线程模型,不同的业务功能运行在不同的线程上,业务功能的交互就需要线程间通信。同一个进程内,线程间通信目前主要有Emitter和Worker两种方式,其中Emitter主要适用于线程间的事件同步, Worker主要用于新开一个线程执行耗时任务。
+基于OpenHarmony的线程模型,不同的业务功能运行在不同的线程上,业务功能的交互就需要线程间通信。同一个进程内,线程间通信目前主要有Emitter和Worker两种方式,其中Emitter主要适用于线程间的事件同步,Worker主要用于新开一个线程执行耗时任务。
> **说明:**
>
-> - Stage模型只提供了主线程和Worker线程,Emitter主要用于主线程内或者主线程和Worker线程的事件同步。
-> - 执行`hdc shell`命令,进入设备的shell命令行。在shell命令行中,执行`ps -p -T`命令,可以查看指定应用进程的线程信息。其中,``为需要指定的应用进程的进程ID。
+> - Stage模型只提供了主线程和Worker线程,Emitter主要用于主线程和Worker线程、Worker线程和Worker线程之间的事件同步。
+> - UIAbility组件与UI均在主线程中,他们之间的数据同步请参见[UIAbility组件与UI的数据同步](uiability-data-sync-with-ui.md)。
+> - 执行`hdc shell`命令,进入设备的shell命令行。在shell命令行中,执行`ps -p -T`命令,可以查看指定应用进程的线程信息。其中,``为需要指定的应用进程的[进程ID](process-model-stage.md)。
diff --git a/zh-cn/application-dev/application-models/windowextensionability.md b/zh-cn/application-dev/application-models/windowextensionability.md
index d97632ebf035af0a936df9c3544335a5518a0135..2d0cd23f2fe5622afa472bdf60248e14ff61836c 100644
--- a/zh-cn/application-dev/application-models/windowextensionability.md
+++ b/zh-cn/application-dev/application-models/windowextensionability.md
@@ -11,7 +11,7 @@ WindowExtensionAbility必须和[AbilityComponent](../reference/arkui-ts/ts-conta
> **说明:**
>
-> 本接口为系统接口,如果三方开发者想要实现应用进行跨应用的界面拉起和嵌入,请参考[full-SDK替换指南](../../application-dev/quick-start/full-sdk-switch-guide.md)将SDK替换为full-SDK。
+> 本接口为系统接口,如果三方开发者想要实现应用进行跨应用的界面拉起和嵌入,请参考[full-SDK替换指南](../faqs/full-sdk-switch-guide.md)将SDK替换为full-SDK。
>
diff --git a/zh-cn/application-dev/application-test/arkxtest-guidelines.md b/zh-cn/application-dev/application-test/arkxtest-guidelines.md
index 98187a4d39b924da3de43b9cb3c7217a5f426716..f638915e4b248b6cb63c19901cfb5a4db4ccff4e 100644
--- a/zh-cn/application-dev/application-test/arkxtest-guidelines.md
+++ b/zh-cn/application-dev/application-test/arkxtest-guidelines.md
@@ -58,7 +58,7 @@ DevEco Studio可参考其官网介绍进行[下载](https://developer.harmonyos.
## 新建测试脚本
1. 在DevEco Studio中新建应用开发工程,其中ohos目录即为测试脚本所在的目录。
-2. 在工程目录下打开待测试模块下的ets文件,将光标置于代码中任意位置,单击**右键 > Show Context Actions** **> Create Ohos Test**或快捷键**Alt+enter** **> Create Ohos Test**创建测试类,更多指导请参考DevEco Studio中[指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-openharmony-test-framework-0000001263160453)。
+2. 在工程目录下打开待测试模块下的ets文件,将光标置于代码中任意位置,单击**右键 > Show Context Actions** **> Create Ohos Test**或快捷键**Alt+enter** **> Create Ohos Test**创建测试类,更多指导请参考DevEco Studio中[指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/harmonyos_jnit_jsunit-0000001092459608-V3?catalogVersion=V3#section13366184061415)。
## 编写单元测试脚本
diff --git a/zh-cn/application-dev/faqs/Readme-CN.md b/zh-cn/application-dev/faqs/Readme-CN.md
index fa5c1943ee2b736011b685d53b6515f596d61c53..366f8f2131c0aa9ece85717e33a82ea8afeec735 100644
--- a/zh-cn/application-dev/faqs/Readme-CN.md
+++ b/zh-cn/application-dev/faqs/Readme-CN.md
@@ -1,7 +1,10 @@
# 常见问题
+- [如何编译full-SDK](full-sdk-compile-guide.md)
+- [如何替换full-SDK](full-sdk-switch-guide.md)
- [Ability开发常见问题](faqs-ability.md)
- [ArkUI框架开发常见问题](faqs-arkui.md)
+- [ArkUI开发框架开发-ArkTS语法常见问题](faqs-arkui-arkts.md)
- [Web开发常见问题](faqs-arkui-web.md)
- [包管理开发常见问题](faqs-bundle-management.md)
- [资源管理开发常见问题](faqs-globalization.md)
@@ -19,4 +22,5 @@
- [启动恢复开发常见问题](faqs-startup.md)
- [分布式DeviceProfrofile开发常见问题](faqs-distributed-device-profile.md)
- [SDK使用常见问题](faqs-sdk.md)
-- [三四方库使用常见问题](faqs-third-fourth-party-library.md)
+- [语言编译运行时常见问题](faqs-compiler-runtime.md)
+- [三四方库使用常见问题](faqs-third-fourth-party-library.md)
\ No newline at end of file
diff --git a/zh-cn/application-dev/faqs/faqs-ability-access-control.md b/zh-cn/application-dev/faqs/faqs-ability-access-control.md
index 55e422cb0812eacc8b9236cfcfda9a780500c5c0..938a3a05ac3801542009d664f6051aea21ddf8d7 100644
--- a/zh-cn/application-dev/faqs/faqs-ability-access-control.md
+++ b/zh-cn/application-dev/faqs/faqs-ability-access-control.md
@@ -5,3 +5,47 @@
适用于:OpenHarmony 3.1 Beta5 API 9
在系统设置修改了应用权限,三方应用无法监听到权限变化的。
+
+## 应用申请LOCATION位置信息权限为什么没有弹窗
+
+适用于:OpenHarmny 3.2 Release API 9
+
+使用API version 9以下版本的SDK开发的应用,可以直接申请ohos.permission.LOCATION权限。
+使用API version 9及API version 9以上版本的SDK开发的应用,需要先申请权限ohos.permission.APPROXIMATELY\_LOCATION,才可申请此权限。
+
+**参考链接**
+
+[应用权限列表](../security/permission-list.md#ohospermissionlocation)
+
+## 向用户申请授予权限但被用户拒绝后,如何处理才能避免应用二次进入时崩溃
+
+适用于:OpenHarmony SDK 3.2 Beta5
+
+**可能原因**
+
+- 业务功能所需要的权限被用户拒绝后不再弹窗请求权限而是直接返回结果。
+- 若开发者在请求权限后未进行相关判断,会导致应用直接访问受权限管控的目标对象,此时应用可能会因为没有对应权限而被拒绝访问,从而导致应用意外终止。
+
+**解决措施**
+
+1. 应用在调用受权限保护的接口前,需要先校验应用是否已经获取该权限。如果校验结果显示,应用已经获取了该权限,那么应用可以直接访问该目标接口,否则,应用需要通过动态弹框先申请用户授权,并根据授权结果进行相应处理。
+
+2. 如果用户拒绝授予某个权限时,需要确保与此权限无关的其他业务功能应能正常使用,不能影响应用的正常注册或登录。
+
+3. 当用户主动触发使用此业务功能或为实现业务功能所必须时,应用程序可通过界面内文字引导,让用户主动到“系统设置”中授权。
+
+**参考链接**
+
+[访问控制(权限)开发概述](../security/accesstoken-overview.md)
+
+## module.json5配置文件中extensionAbilities和requestPermissions的权限声明有何区别
+
+适用于:OpenHarmony SDK 3.2 Beta5
+
+- requestPermissions:标识当前应用运行时需向系统申请的权限集合,应用申请的权限只有在此处配置的才会生效。
+- extensionAbilitie.permissions:标识当前ExtensionAbility组件自定义的权限信息,表示当其他应用访问该ExtensionAbility时,需要申请相应的权限信息,仅做权限校验使用。
+
+**参考链接**
+
+[module.json5配置文件](../quick-start/module-configuration-file.md)
+
diff --git a/zh-cn/application-dev/faqs/faqs-ability.md b/zh-cn/application-dev/faqs/faqs-ability.md
index 717b7bc6a432c221e54fca784e986a1adbffc940..d58b91d2de259706121f5f491d7f210b33766c47 100644
--- a/zh-cn/application-dev/faqs/faqs-ability.md
+++ b/zh-cn/application-dev/faqs/faqs-ability.md
@@ -254,7 +254,7 @@ DevEco Studio默认下载是public-sdk。
**解决措施**
-三方应用不支持开发ServiceExtensionAbility和DataShareExtensionAbility。若开发系统应用,请[下载full-sdk](../quick-start/full-sdk-switch-guide.md)。
+三方应用不支持开发ServiceExtensionAbility和DataShareExtensionAbility。若开发系统应用,请[下载full-sdk](../faqs/full-sdk-switch-guide.md)。
## 如何获取应用级别的temp路径和files路径
@@ -268,6 +268,56 @@ DevEco Studio默认下载是public-sdk。
[获取应用开发路径](../application-models/application-context-stage.md#获取应用开发路径)
+## terminateSelf方法销毁当前应用之后并没有在后台任务列表中删除
+
+适用于:OpenHarmony 3.2 Beta5
+
+**解决措施**
+
+在当前应用对应UIAbility的module.json5配置文件中,配置abilities标签的removeMissionAfterTerminate字段,设置为true即为销毁应用的同时删除应用快照记录,缺省值为false。
+
+**参考链接**
+
+[module.json5配置文件](../quick-start/module-configuration-file.md)
+
+## Stage模型下开发的应用如何拉起 FA 模型开发的应用
+
+适用于:OpenHarmony 3.2 Beta 5,API 9
+
+**问题现象**
+
+已在stage模型下的应用如何拉起FA模型
+
+**解决措施**
+
+该功能目前已支持,具体实现可参考如下代码:
+
+示例:
+
+```
+let want = {
+ deviceId: "", // deviceId为空表示本设备
+ bundleName: "com.example.myapplication",
+ abilityName: "EntryAbility",
+ moduleName: "Module1", // moduleName非必选
+ parameters: { // 自定义信息
+ },
+}
+// context为意图拉起的FA模型的AbilityContext
+context.startAbility(want).then(() => {
+ ...
+}).catch((err) => {
+ ...
+})
+```
+
+## 原子化服务是否可以全程使用js实现
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**解决措施**
+
+目前新建的卡片的目录结构都是css+hml+json,不能完全靠js实现,事件的触发和参数的传递都可以在json文件里面处理。
## FA卡片上架后在用户的服务中心展示时可否触发生命周期,从而实现用户没有打开过FA应用的情况下获取到用户的登录信息
@@ -279,7 +329,44 @@ FA卡片的生命周期以及信息显示
**解决措施**
-服务卡片在添加卡片后就触发了oncreat()生命周期,在不启用app的情况下也可以显示相关的用户信息-静默登录,但服务卡片目前要在app安装之后手动添加。
+服务卡片在添加卡片后就触发了oncreat\(\)生命周期,在不启用app的情况下也可以显示相关的用户信息-静默登录,但服务卡片目前要在app安装之后手动添加。
+
+## JS/ArkTS跳转到其他应用时报错“\[c4d4d3492eb8531, 0, 0\] ContextDeal::startAbility fetchAbilities failed”
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**问题现象**
+
+JS/ArkTS跳转时, startAbility报错
+
+**解决措施**
+
+一般用startAbility,实现如下:
+
+```
+import featureAbility from '@ohos.ability.featureAbility'
+function onStartRemoteAbility() {
+console.info('onStartRemoteAbility begin');
+let params;
+let wantValue = {
+ bundleName: 'ohos.samples.etsDemo',
+ abilityName: 'ohos.samples.etsDemo.RemoteAbility',
+ deviceId: getRemoteDeviceId(),
+ parameters: params
+};
+console.info('onStartRemoteAbility want=' + JSON.stringify(wantValue));
+featureAbility.startAbility({
+ want: wantValue
+}).then((data) => {
+console.info('onStartRemoteAbility finished, ' + JSON.stringify(data));
+});
+console.info('onStartRemoteAbility end');
+}
+```
+
+**参考链接**
+
+可参考[启动本地PageAbility](../application-models/start-local-pageability.md)。
## 如何通过卡片点击实现业务登录场景
@@ -332,30 +419,28 @@ this.context.startAbility(
**代码示例**
```
-import UIAbility from '@ohos.app.ability.UIAbility';
+import common from '@ohos.app.ability.common';
-let UIAbilityContext = UIAbility.context;
-let ApplicationContext = UIAbility.context.getApplicationContext();
@Entry
@Component
struct AbilityContextTest {
// abilityContext
- @State UIabilityInfo: string = '获取 abilityInfo'
- UIabilityContext: UIAbilityContext
+ @State UIAbilityInfo: string = '获取 abilityInfo'
+ UIAbilityContext: common.UIAbilityContext
aboutToAppear() {
- // getContext获取Context,转为abilityContext
- this.UIabilityContext = getContext(this) as UIAbilityContext
+ // getContext获取Context,转为abilityContext
+ this.UIAbilityContext = getContext(this) as common.UIAbilityContext
}
build() {
Row() {
Column({ space: 20 }) {
- Text(this.abilityInfo)
+ Text(this.UIAbilityInfo)
.fontSize(20)
- .onClick(()=>{
- this.UIabilityInfo = JSON.stringify(this.UIabilityContext.UIabilityInfo)
- console.log(`ContextDemo abilityInfo= ${this.UIabilityInfo}`)
+ .onClick(() => {
+ this.UIAbilityInfo = JSON.stringify(this.UIAbilityContext.abilityInfo)
+ console.log(`ContextDemo abilityInfo = ${this.UIAbilityInfo}`)
})
}
.width('100%')
@@ -364,3 +449,51 @@ struct AbilityContextTest {
}
}
```
+
+## 后台长时任务启动失败
+
+适用于:OpenHarmony 3.2 Release API9
+
+**问题现象**
+
+调用featureAbility.startAbility\(\)接口启动ServiceAbility,在ServiceAbility中启动后台长时任务报错,错误信息:\{"code":201,"message":"BussinessError 201: Permission denied."\}
+
+**解决措施**
+
+启动后台长时任务需要在module.json5文件中配置长时任务权限ohos.permission.KEEP\_BACKGROUND\_RUNNING、同时为需要使用长时任务的ability声明相应的后台模式类型。
+
+```
+"module": {
+ "abilities": [
+ {
+ "backgroundModes": [
+ "dataTransfer",
+ "location"
+ ], // 后台模式类型
+ }
+ ],
+ "requestPermissions": [
+ {
+ "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" // 长时任务权限
+ }
+ ]
+}
+```
+
+**参考链接**
+
+[ServiceAbility组件配置-后台模式类型](../application-models/serviceability-configuration.md)
+
+[长时任务权限](../security/permission-list.md#ohospermissionkeep_background_running)
+
+[长时任务开发指导](../task-management/continuous-task-dev-guide.md#基于stage模型)
+
+## FA卡片如何进行数据交互
+
+适用于:OpenHarmony SDK 3.2 Beta 5 API9
+
+卡片通过postCardAction接口触发和提供方的交互,在提供方中通过updateForm方法更新数据。
+
+**参考链接**
+
+[服务卡片开发指导](../application-models/widget-development-fa.md)
diff --git a/zh-cn/application-dev/faqs/faqs-arkui-arkts.md b/zh-cn/application-dev/faqs/faqs-arkui-arkts.md
new file mode 100644
index 0000000000000000000000000000000000000000..dcccf95ebbd9b6a553cc2541bdc2950e528968ee
--- /dev/null
+++ b/zh-cn/application-dev/faqs/faqs-arkui-arkts.md
@@ -0,0 +1,994 @@
+# ArkUI开发框架(ArkTS语法)
+
+## ArkUI如何通过代码动态创建组件
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+ArkUI使用ArkTS声明式开发范式,开发者无法持有组件实例,在声明时通过渲染控制语法以及动态构建UI元素的方式,控制组件的创建。
+
+**代码示例**
+
+```
+// 条件渲染语句创建组件
+if(this.isTrue) {
+ Text("创建文本组件").fontSize(30)
+}
+// 循环渲染语句创建组件
+ForEach(this.nums,(item) => {
+ Text(item + '').fontSize(30)
+},item => JSON.stringify(item))
+```
+
+**参考链接**
+
+[渲染控制语法](../quick-start/arkts-rendering-control-overview.md)
+
+## 使用@Builder装饰器包含自定义组件的方法与普通方法的区别是什么
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+@Builder装饰的方法中使用了自定义组件,那么该方法每次被调用时,对应的自定义组件均会重新创建,普通方法中不使用@builder装饰,无法容纳自定义组件。
+
+**参考链接**
+
+[@BuilderParam](../quick-start/arkts-builderparam.md)
+
+## 如何使用@BuilderParam装饰器进行组件传参
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+- 不带参数
+
+ 对@BuilderParam修饰的属性进行赋值时不带参数(如:content: this.specificParam),则此属性的类型需定义成无返回值的函数(如:@BuilderParam content: \(\) =\> void)。
+
+- 带参数
+
+ 对@BuilderParam修饰的属性进行赋值时带参数(如:callContent: this.specificParam1\("111"\)),则此属性的类型需定义成any(如:@BuilderParam callContent: any)。
+
+
+**参考链接**
+
+[@BuilderParam](../quick-start/arkts-builderparam.md)
+
+## 如何监听数组内对象属性变化
+
+适用于:OpenHarmony 3.2 Beta5 API9
+
+**问题现象**
+
+数组内存储对象示例,需要对对象的属性变化进行监听。
+
+**解决措施**
+
+通过@Observed配合@ObjectLink装饰符实现。@Observed用于类,@ObjectLink用于变量。
+
+**代码示例**
+
+1. 在类上使用@Observed。
+
+ ```
+ @Observed
+ class ClassA {
+ public name: string
+ public c: number
+ public id: number
+
+ constructor(c: number, name: string = 'OK') {
+ this.name = name
+ this.c = c
+ }
+ }
+ ```
+
+2. 在组件变量使用@ObjectLink。
+
+ ```
+ @Component
+ struct ViewA {
+ label: string = 'ViewA1'
+ @ObjectLink a: ClassA
+
+ build() {
+ Row() {
+ Button(`ViewA [${this.label}] this.a.c= ${this.a.c} +1`)
+ .onClick(() => {
+ this.a.c += 1
+ })
+ }.margin({ top: 10 })
+ }
+ }
+ ```
+
+
+**参考链接**
+
+[Observed和ObjectLink数据管理](../quick-start/arkts-observed-and-objectlink.md)
+
+## 子组件使用@Link修饰成员变量时,如何通过父组件传值
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+子组件使用@Link接受父组件的值时,需要使用'$'建立变量之间的引用关系。才能实现同步。
+
+**代码示例**
+
+\@Link语义是从'$'操作符引出,即\$isPlaying是this.isPlaying内部状态的双向数据绑定。当单击子组件PlayButton中的按钮时,\@Link变量更改,PlayButton与父组件中的Text和Button将同时进行刷新,同样地,当点击父组件中的Button修改this.isPlaying时,子组件PlayButton与父组件中的Text和Button也将同时刷新。
+
+1. 在父组件使用\@State装饰器,传递数据使用\$符创建引用。
+
+ ```
+ @Entry
+ @Component
+ struct Player {
+ @State isPlaying: boolean = false
+ build() {
+ Column() {
+ PlayButton({ buttonPlaying: $isPlaying })
+ Text(`Player is ${this.isPlaying ? '' : 'not'} playing`).fontSize(18)
+ Button('Parent:' + this.isPlaying)
+ .margin(15)
+ .onClick(() => {
+ this.isPlaying = !this.isPlaying
+ })
+ }
+ }
+ }
+
+
+ ```
+
+2. 在子组件使用\@Link接受数据。
+
+ ```
+ @Component
+ struct PlayButton {
+ @Link buttonPlaying: boolean
+
+ build() {
+ Column() {
+ Button(this.buttonPlaying ? 'pause' : 'play')
+ .margin(20)
+ .onClick(() => {
+ this.buttonPlaying = !this.buttonPlaying
+ })
+ }
+ }
+ }
+ ```
+
+
+**参考链接**
+
+[@Link](../quick-start/arkts-link.md)
+
+## 父组件如何与孙子组件进行状态同步
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+- 方式一(推荐):使用@Provide和@Consume装饰器。在父组件使用@Provide,在孙子组件使用@Consume,可以实现父组件和孙子组件进行双向数据绑定。
+
+- 方式二:使用@State和@Link装饰器。在父组件使用@State,在每一层子组件(子组件和孙子组件)都使用@Link。
+
+**代码示例一**
+
+1. 父组件中使用子组件,通过Provide提供reviewVote参数,供跨级传递给孙子组件。
+
+ ```
+ @Entry
+ @Component
+ struct Father{
+ @Provide("reviewVote") reviewVotes: number = 0;
+
+ build() {
+ Column() {
+ Son()
+ Button(`Father: ${this.reviewVotes}`)
+ ...
+ }
+ }
+ }
+ ```
+
+2. 子组件中使用孙组件。
+
+ ```
+ @Component
+ struct Son{
+ build() {
+ Column() {
+ GrandSon()
+ }
+ }
+ }
+ ```
+
+3. 孙子组件中使用Consume来接受reviewVote的参数。
+
+ ```
+ @Component
+ struct GrandSon{
+ @Consume("reviewVote") reviewVotes: number
+
+ build() {
+ Column() {
+ Button(`GrandSon: ${this.reviewVotes}`)
+ ...
+ }.width('100%')
+ }
+ }
+ ```
+
+
+**代码示例二**
+
+1. 父组件Father使用@State绑定数据reviewVote。
+
+ ```
+ @Entry
+ @Component
+ struct Father {
+ @State reviewVotes: number = 0;
+
+ build() {
+ Column() {
+ Son({reviewVotes:$reviewVotes})
+ Button(`Father: ${this.reviewVotes}`)
+ ...
+ }
+ }
+ }
+ ```
+
+2. 子组件Son中使用@Link接受由父组件Father传递的参数reviewVote。
+
+ ```
+ @Component
+ struct Son{
+ @Link reviewVotes: number;
+ build() {
+ Column() {
+ Grandson({reviewVotes:$reviewVotes})
+ }
+ }
+ }
+
+
+ ```
+
+3. 孙子组件GrandSon使用@Link接受由Son组件传递的参数reviewVote。
+
+ ```
+ @Component
+ struct Grandson{
+ @Link reviewVotes: number;
+
+ build() {
+ Column() {
+ Button(`Grandson: ${this.reviewVotes}`)
+ ...
+ }.width('100%')
+ }
+ }
+ ```
+
+
+## Js如何定义callback函数
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+定义个callback函数的样例,**示例如下:**
+
+1. 定义回调函数
+
+ ```
+ // 页面中定义个2个参数,空返回的callback函数
+ myCallback: (a:number,b:string) => void
+ ```
+
+2. 在使用时进行初始化赋值
+
+ ```
+ aboutToAppear() {
+ // callback函数初始化
+ this.myCallback= (a,b)=>{
+ console.info(`handle myCallback a=${a},b=${b}`)
+ }}
+ ```
+
+
+## 组件需要多次更新时如何优化性能
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+使用状态管理模块,目前已经支持最小化更新,当数据依赖变化时,不再是重新刷新整个自定义组件,而是只更新依赖数据的视图内容。
+
+## 对象中函数的this如何指向外层
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**解决措施**
+
+通过箭头函数实现。
+
+**代码示例**
+
+```
+const obj = {
+ start:() => {
+ return this.num
+ }
+}
+```
+
+## 如何实现页面加载前从接口获取数据
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**问题现象**
+
+页面生命周期相关问题,在页面渲染前从接口获取数据,渲染时将数据渲染到页面上。
+
+**解决措施**
+
+在声明周期函数aboutToAppear中使用异步接口获取页面数据,数据变量使用@State修饰,数据获取完成后根据变量自动刷新页面。
+
+**代码示例**
+
+```
+@Entry
+@Component
+struct Test6Page {
+ // 数据获取成功,会自动刷新页面
+ @State message: string = 'loading.....'
+ aboutToAppear(){
+ // 模拟异步接口获取数据
+ setTimeout(()=>{
+ this.message = 'new msg'
+ },3000)
+ }
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+```
+
+## 如何将传感器的数据实时显示在UI的Text中
+
+适用于:Openharmony 3.2 Beta5 API9
+
+**解决措施**
+
+传感器返回数据类型为double,可将double转为string,再显示在text中。
+
+## 如何监听屏幕旋转
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**解决措施**
+
+屏幕旋转可使用媒体查询接口进行监听。
+
+```
+import mediaquery from '@ohos.mediaquery'
+let listener = mediaquery.matchMediaSync('(orientation: landscape)'); //监听横屏事件
+function onPortrait(mediaQueryResult) {
+ if (mediaQueryResult.matches) {
+ // do something here
+ } else {
+ // do something here
+ }
+}
+listener.on('change', onPortrait) // 注册回调
+listener.off('change', onPortrait) // 去注册回调
+```
+
+**参考链接**
+
+[媒体查询](../reference/apis/js-apis-mediaquery.md)
+
+## 创建的单例换了页面后不生效问题
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**问题现象**
+
+单例只有在同一个流程中才有效,换了页面后之前的实例都全是undefined。
+
+**解决措施**
+
+对于每个Page都会生成一个js文件,定义的单例会在每个js中都生成一份,所以单例的作用范围只是Page的范围。
+
+如果想共享一个实例,创建范围需要提升至UIAbility或者App级别。
+
+## 如何将时间格式的字符串string转换为Date对象
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**解决措施**
+
+如果字符string满足格式“yyyy-MM-dd”格式,则可直接使用函数new Date\("yyyy-MM-dd"\)来获取对应的Date对象。
+
+```
+new Date("2021-05-23");
+new Date("2020/2/29");
+new Date("2020-14-03");
+new Date("14-02-2021");
+```
+
+其他格式字符串可使用new Date\(year:number,month:number,day?:number,hour?:number,mintue?:number,second?:number,ms?:number\)方法来获取Date对象。
+
+```
+// 根据参数创建日期的语法:
+new Date(yearValue, IndexOfMonth, dayValue, hours, minutes, seconds)
+```
+
+其中每一个参数换算为对应时间参数传入即可。
+
+- yearValue:应符合 ISO 8061 YYYY 格式。例如 2021。如果我们以 YY 格式指定一个值,它将会被错误地接受。例如,仅将 2021 提到 21 会被认为是 1921 年而不是 2021 年。
+- IndexOfMonth:从索引 0 开始。因此,从 Month 值中减去 1。例如,对于 3 月,该值为 3,但 monthIndex 将为 2(即 3-1 = 2)。本月指数通常应在 0-11 范围内
+- dayValue:表示一个月中的某天。它应在 1-31 范围内,具体取决于一个月中的天数。例如:对于 21-05-2021,日期值为 21
+- hours:一天中的小时。例如 10 点。
+- minutes:过去一个小时的分钟数
+- seconds:保留超过一分钟的秒数。
+
+## ArkTS如何把string转为byte数组
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**解决措施**
+
+参考如下代码实现,示例:
+
+```
+stringToArray(str:string) {
+ var arr = [];
+ for(var i = 0,j = str.length;i {
+ /* 原数据,GBK编码
+
+
+ xxxxx
+ xxxx
+ xxxx
+
+
+ xxxx
+
+
+
+ xxxx
+
+
+ 1
+ For Outsourcing Staff/xxxx
+
+ xxxx
+ xxxx
+
+
+ */
+ let src = 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iR0JLIj8+CjxkYXRhPgo8YXNzZXRfbm8+eHh4eHg8L2Fzc2V0X25vPgo8bWFjaGluZV9zbj54eHh4PC9tYWNoaW5lX3NuPgo8Ymlvc19pZD54eHh4PC9iaW9zX2lkPgo8cmVzcG9uc2libGVfZW1wX25hbWU+PCFbQ0RBVEFbeHh4eF1dPjwvcmVzcG9uc2libGVfZW1wX25hbWU+CjxyZXNwb25zaWJsZV9hY2NvdW50PjwhW0NEQVRBW3h4eHggeHh4eF1dPjwvcmVzcG9uc2libGVfYWNjb3VudD4KPHJlc3BvbnNpYmxlX2VtcF9ubz54eHh4PC9yZXNwb25zaWJsZV9lbXBfbm8+CjxyZXNwb25zaWJsZV9kZXB0PjwhW0NEQVRBW3h4eHhdXT48L3Jlc3BvbnNpYmxlX2RlcHQ+Cjx1c2VyX2RlcHQ+PCFbQ0RBVEFbeHh4eF1dPjwvdXNlcl9kZXB0Pgo8dXNlcl9uYW1lPjwhW0NEQVRBW3h4eF1dPjwvdXNlcl9uYW1lPgo8Y3VyX2RvbWFpbl9hY2NvdW50Pnh4eHg8L2N1cl9kb21haW5fYWNjb3VudD4KPGFzc2V0X2xvYz48IVtDREFUQVstLV1dPjwvYXNzZXRfbG9jPgo8YXNzZXRfbG9jX2N1cj48IVtDREFUQVtdXT48L2Fzc2V0X2xvY19jdXI+Cjxhc3NldF90eXBlPjE8L2Fzc2V0X3R5cGU+Cjxhc3NldF91c2U+Rm9yIE91dHNvdXJjaW5nIFN0YWZmL3h4eHg8L2Fzc2V0X3VzZT4KPG92ZXJkdWVfZGF0ZT48L292ZXJkdWVfZGF0ZT4KPGFzc2V0X3N0YXR1cz54eHh4PC9hc3NldF9zdGF0dXM+Cjxhc3NldF9wZXJpb2Q+eHh4eDwvYXNzZXRfcGVyaW9kPgo8bGljZW5zZT48L2xpY2Vuc2U+CjwvZGF0YT4='
+ let base64 = new util.Base64Helper();
+ // base解码
+ let src_uint8Array = base64.decodeSync(src);
+ // 解码为utf-8的字符串
+ let textDecoder = util.TextDecoder.create("utf-8",{ignoreBOM: true})
+ let src_str = textDecoder.decodeWithStream(src_uint8Array)
+ //替换encoding字段
+ src_str = src_str.replace("GBK","utf-8")
+ console.log('Test src_str: ' + JSON.stringify(src_str));
+ // 转换 xml-> json
+ let conv = new convertxml.ConvertXML();
+ let options = {trim : false, declarationKey:"_declaration",
+ instructionKey : "_instruction", attributesKey : "_attributes",
+ textKey : "_text", cdataKey:"_cdata", doctypeKey : "_doctype",
+ commentKey : "_comment", parentKey : "_parent", typeKey : "_type",
+ nameKey : "_name", elementsKey : "_elements"}
+ let src_json = JSON.stringify(conv.convertToJSObject(src_str, options));
+ console.log('Test json: ' + JSON.stringify(src_json));
+ })
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+```
+
+## 在生成器函数中编译TS语言有哪些使用限制
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**解决措施**
+
+TS语言的使用在生成器函数中存在以下限制:
+
+- 表达式仅允许在字符串\(\$\{expression\}\)、if条件、ForEach的参数和组件的参数中使用。
+- 这些表达式中的任何一个都不能导致任何应用程序状态变量(@State、@Link、@Prop)的改变,否则会导致未定义和潜在不稳定的框架行为。
+- 生成器函数内部不能有局部变量。
+
+上述限制都不适用于事件处理函数(例如onClick)的匿名函数实现。
+
+## 如何设置一张图片上面四个角都分别有一个角标
+
+适用于 OpenHarmony 3.2 Beta5
+
+**问题现象**
+
+应用需求,在一张图片上面四个角分别设置一个角标。
+
+**解决措施**
+
+可以使用绝对定位,设置元素锚点相对于父容器顶部起点的偏移位置。在布局容器中,设置该属性不影响父容器布局。
+
+示例:
+
+```
+@Entry
+@Component
+struct PositionExample2 {
+ build() {
+ Column({ space: 20 }) {
+ Stack({ alignContent: Alignment.TopStart }) {
+ Row()
+ .size({ width: '100', height: '100' })
+ .backgroundColor(0xdeb887)
+ Image($r('app.media.app_icon'))
+ .size({ width: 25, height: 25 })
+ .markAnchor({ x: 0, y: 0 })
+ Image($r('app.media.app_icon'))
+ .size({ width: 25, height: 25 })
+ .markAnchor({ x: 25, y: 25 })
+ .position({ x: '100%', y: '100%' })
+ }.margin({ top: 25 }).width('100').height('100')
+ }
+ .width('100%').margin({ top: 25 })
+ }
+}
+```
+
+## util.generateRandomUUID参数问题
+
+适用于 OpenHarmony 3.2 Beta5
+
+**解决措施**
+
+generateRandomUUID底层使用Node.js crypto.randomUUID\(\)接口,传递参数为false时会生成uuid,并缓存到系统里,参数为true时使用系统已缓存的UUID。
+
+参考文档:[util.generateRandomUUID](../reference/apis/js-apis-util.md#utilgeneraterandomuuid9)
+
+## worker线程与主线程是否运行在相同的全局上下文中
+
+适用于 OpenHarmony 3.2 Beta5
+
+**解决措施**
+
+worker线程与主线程不在同一个上下文中,它们使用数据通信的方式交互。
+
+**参考链接**
+
+worker:[启动一个Worker](../reference/apis/js-apis-worker.md)
+
+## 应用图标一多设置
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**问题现象**
+
+希望可以按照设备的不同类型,显示相应的应用图标
+
+**解决措施**
+
+借助资源限定词能力,可以实现应用图标的一多配置
+
+**示例代码**
+
+1.创建资源目录,并在资源目录中添加资源文件,以Tablet为例,在src/main/resources下创建tablet资源目录,在tablet目录下创建media资源文件夹
+
+```
+├─base
+│ ├─element
+│ ├─media
+│ └─profile
+├─rawfile
+├─tablet
+│ ├─element
+│ └─media
+```
+
+2.在1中创建的media文件夹下添加设备类型为tablet时希望显示的图标文件,在UI界面进行引用
+
+```
+@Entry @Component struct Index { build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Text($r("app.string.my_string"))
+ .fontSize($r("app.float.my_float"))
+ .fontColor($r("app.color.my_color"))
+ Image($r("app.media.my_image"))
+ .width(100)
+ .height(100)
+ }
+ .width('100%')
+ .height('100%') } }
+```
+
+**参考链接**
+
+[资源使用](../key-features/multi-device-app-dev/resource-usage.md)
+
+## 调用方法的时候,如何解决方法内部的this变成undefined?
+
+适用于:OpenHarmony SDK 3.2,API 9
+
+**问题现象**
+
+ArkTS里的this指向
+
+**解决措施**
+
+方式一:在调用方法的时候加上.bind\(this\);
+
+方式二:使用箭头函数。
+
+## OpenHarmony的systemTime.getCurrentTime\(\)接口和JS的new Date\(\).getTime\(\)有区别吗
+
+适用于:OpenHarmony SDK 3.2,API 9
+
+**解决措施**
+
+systemTime.getCurrentTime\(false\)和new Date\(\).getTime\(\)一样,都是返回1970年1月1日至今的毫秒数;systemTime.getCurrentTime\(true\)返回1970年1月1日至今的纳秒数。两种方式都是系统时间。
+
+## 如何实现类似js中的slot插槽功能
+
+适用于:OpenHarmony SDK 3.2,API 9
+
+**解决措施**
+
+适用于:OpenHarmony SDK3.2.5.5, API9 Stage模型
+
+该功能在ArkTS中使用@Build和@BuilderParam方式来实现,具体可参考文档:[@BuilderParam:引用@Builder函数](../quick-start/arkts-builderparam.md)
+
+## 加上lineHeight,Text垂直不居中的原因
+
+适用于 OpenHarmony 3.2 Beta5 API 9
+
+**原因分析**
+
+Text组件不用设置lineHeight属性,默认就是居中的。绘制文本是从底部开始绘制的,设置合适的lineHeight可以让文本有居中效果,但如果lineHeight设置的过高,文本就会显得偏下一些,一般lineHeight属性用来联合padding属性调整Text内的上下行间距。
+
+**参考链接**
+
+[Text](../reference/arkui-ts/ts-basic-components-text.md#示例1)
+
+## SideBarContainer如何设置controlButton属性
+
+适用于 OpenHarmony 3.2 Beta5,API9
+
+**解决措施**
+
+示例代码:
+
+```
+@Entry
+@Component
+struct SideBarContainerExample {
+ normalIcon : Resource = $r("app.media.icon")
+ selectedIcon: Resource = $r("app.media.icon")
+ @State arr: number[] = [1, 2, 3]
+ @State current: number = 1
+
+ build() {
+ SideBarContainer(SideBarContainerType.Embed)
+ {
+ Column() {
+ ForEach(this.arr, (item, index) => {
+ Column({ space: 5 }) {
+ Image(this.current === item ? this.selectedIcon : this.normalIcon).width(64).height(64)
+ Text("Index0" + item)
+ .fontSize(25)
+ .fontColor(this.current === item ? '#0A59F7' : '#999')
+ .fontFamily('source-sans-pro,cursive,sans-serif')
+ }
+ .onClick(() => {
+ this.current = item
+ })
+ }, item => item)
+ }.width('100%')
+ .justifyContent(FlexAlign.SpaceEvenly)
+ .backgroundColor('#19000000')
+
+
+ Column() {
+ Text('SideBarContainer content text1').fontSize(25)
+ Text('SideBarContainer content text2').fontSize(25)
+ }
+ .margin({ top: 50, left: 20, right: 30 })
+ }
+ .sideBarWidth(150)
+ .minSideBarWidth(50)
+ .controlButton({left:32,
+ top:32,
+ width:32,
+ height:32,
+ icons:{shown: $r("app.media.icon"),
+ hidden: $r("app.media.icon"),
+ switching: $r("app.media.icon")}})
+ .maxSideBarWidth(300)
+ .onChange((value: boolean) => {
+ console.info('status:' + value)
+ })
+ }
+}
+```
+
+## Grid如何实现拖拽功能
+
+适用于 OpenHarmony 3.2 Beta5 ,API9
+
+**解决措施**
+
+1. grid组件下设置属性editMode\(true\)设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem
+2. 在[onItemDragStart](../reference/arkui-ts/ts-container-grid.md#事件)回调中设置拖拽过程中显示的图片
+3. 在[onItemDrop](../reference/arkui-ts/ts-container-grid.md#事件)中获取拖拽起始位置,和拖拽插入位置,在[onDrag](../reference/arkui-ts/ts-universal-events-drag-drop.md#事件)回调中完成交换数组位置逻辑。示例代码:
+
+ ```
+ @Entry
+ @Component
+ struct GridExample {
+ @State numbers: String[] = []
+ scroller: Scroller = new Scroller()
+ @State text: string = 'drag'
+
+ @Builder pixelMapBuilder() { //拖拽过程样式
+ Column() {
+ Text(this.text)
+ .fontSize(16)
+ .backgroundColor(0xF9CF93)
+ .width(80)
+ .height(80)
+ .textAlign(TextAlign.Center)
+ }
+ }
+
+ aboutToAppear() {
+ for (let i = 1;i <= 15; i++) {
+ this.numbers.push(i + '')
+ }
+ }
+
+ changeIndex(index1: number, index2: number) { //交换数组位置
+ [this.numbers[index1], this.numbers[index2]] = [this.numbers[index2], this.numbers[index1]];
+ }
+
+ build() {
+ Column({ space: 5 }) {
+ Grid(this.scroller) {
+ ForEach(this.numbers, (day: string) => {
+ GridItem() {
+ Text(day)
+ .fontSize(16)
+ .backgroundColor(0xF9CF93)
+ .width(80)
+ .height(80)
+ .textAlign(TextAlign.Center)
+ .onTouch((event: TouchEvent) => {
+ if (event.type === TouchType.Up) {
+ this.text = day
+ }
+ })
+ }
+ })
+ }
+ .columnsTemplate('1fr 1fr 1fr')
+ .columnsGap(10)
+ .rowsGap(10)
+ .onScrollIndex((first: number) => {
+ console.info(first.toString())
+ })
+ .width('90%')
+ .backgroundColor(0xFAEEE0)
+ .height(300)
+ .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem
+ .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。
+ return this.pixelMapBuilder() //设置拖拽过程中显示的图片。
+ })
+ .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。
+ console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置
+ this.changeIndex(itemIndex, insertIndex)
+ })
+ }.width('100%').margin({ top: 5 })
+ }
+ }
+ ```
+
+
+## 使用什么接口进行url编码
+
+适用于:OpenHarmony 3.2 Beta5,API9
+
+**解决措施**
+
+使用全局函数encodeURI进行编码,使用decodeURI进行解码。例如空格字符““,编码后为%20。
+
+```
+let a = encodeURI(" ")
+console.log(a) // %20
+```
+
+## 如何解析xml
+
+适用于:OpenHarmony 3.2 Beta5,API9
+
+**解决措施**
+
+使用ConvertXML的convert接口可以将xml文本解析为JavaScript对象。
+
+参考文档:[转换xml](../reference/apis/js-apis-convertxml.md)
+
+## 使用Styles装饰器,编译报错.stateStyles doesn't conform standard
+
+适用于:OpenHarmony 3.2 Beta5,API9
+
+**原因分析**
+
+Styles装饰器内部只支持通用属性,使用了非通用属性作为Style的代码
+
+**解决措施**
+
+去掉非通用属性,或者使用Builder来提取公共组件。
+
+## Radio组件\$\$双向绑定
+
+适用于:OpenHarmony 3.2 Beta5,API9
+
+**解决措施**
+
+Radio组件使用\$\$绑定的变量变更时,仅渲染当前组件,提高渲染速度。
+
+当Radio组件的状态发生改变时,不会自动修改绑定的变量。
+
+参考:[内置组件双向绑定](../quick-start/arkts-two-way-sync.md)
+
+## ForEach组件在真机上无法执行
+
+适用于:OpenHarmony 3.2 beta5,API9
+
+**问题现象**
+
+ForEach组件预览器可以正常执行,但在真机上无法执行。
+
+**原因分析**
+
+真机上系统版本大于等于3.2beta5版本,真机会默认开启最小化更新策略。
+
+旧版IDE默认没有开启最小化更新,导致组件运行异常。
+
+**解决措施**
+
+module.json5添加"metadata"配置项:
+
+```
+{
+ "module": {
+ "metadata": [
+ {
+ "name": "ArkTSPartialUpdate",
+ "value": "true"
+ }
+ }
+}
+```
diff --git a/zh-cn/application-dev/faqs/faqs-arkui-web.md b/zh-cn/application-dev/faqs/faqs-arkui-web.md
index a79302bdd7ef2a42265748b69eb3be6769b5cdc6..f7261602d61df292c4741cd19a05d9db7931c354 100644
--- a/zh-cn/application-dev/faqs/faqs-arkui-web.md
+++ b/zh-cn/application-dev/faqs/faqs-arkui-web.md
@@ -172,3 +172,102 @@ Web({ src: 'www.example.com', controller: this.controller })
**参考链接**
[domStorageAccess](../reference/arkui-ts/ts-basic-components-web.md#domstorageaccess)
+
+## 如何解决Web组件加载的HTML页面内检测网络状态失败
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**问题现象**
+
+在HTML页面内通过window.navigator.onLine获取网络状态,联网和断网情况下均为false。
+
+**解决措施**
+
+配置应用获取网络信息权限: ohos.permission.GET\_NETWORK\_INFO
+
+**参考链接**
+
+[GET\_NETWORK\_INFO](../security/permission-list.md#ohospermissionget_network_info)
+
+## 如何自定义拼接设置UserAgent参数
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+默认UserAgent需要通过WebviewController获取。WebviewController对象必须在Web组件绑定后,才能调用WebviewController上的方法getUserAgent获取默认UserAgent。因此在页面加载前通过自定义字符串拼接修改UserAgent,可采用此方式:
+
+1. 使用@State定义初始UserAgent,绑定到Web组件;
+2. 在Web组件的onUrlLoadIntercept回调中,通过WebviewController.getUserAgent\(\)获取默认UserAgent,并修改Web组件绑定的UserAgent
+
+**代码示例**
+
+```
+import web_webview from '@ohos.web.webview'
+@Entry
+@Component
+struct Index {
+ private controller: web_webview.WebviewController = new web_webview.WebviewController()
+ @State userAgentPa: string = ''
+ build() {
+ Row() {
+ Column() {
+ Web({ src: 'http://www.example.com', controller: this.controller }) //需要手动替换为真实网站
+ .width('100%')
+ .userAgent(this.userAgentPa)
+ .onUrlLoadIntercept((event) => {
+ let userAgent = this.controller.getUserAgent();
+ this.userAgentPa = userAgent + ' 111111111'
+ return false;
+ })
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+```
+
+**参考链接**
+
+[userAgent](../reference/arkui-ts/ts-basic-components-web.md#useragent)、[getUserAgent](../reference/apis/js-apis-webview.md#getuseragent)
+
+## Web组件中如何通过手势滑动返回上一个Web页面
+
+适用于:Openharmony 3.2 Beta5 API 9
+
+**解决措施**
+
+通过重写onBackPress函数来自定义返回逻辑,使用WebviewController判断是否返回上一个Web页面。
+
+**示例代码**
+
+```
+import web_webview from '@ohos.web.webview';
+@Entry
+@Component
+struct Index {
+ controller: web_webview.WebviewController = new web_webview.WebviewController();
+ build() {
+ Column() {
+ Web({ src: 'http://www.example.com', controller: this.controller })//需要手动替换为真实网站
+ }
+ }
+ onBackPress() {
+ // 当前页面是否可前进或者后退给定的step步(-1),正数代表前进,负数代表后退
+ if (this.controller.accessStep(-1)) {
+ this.controller.backward(); // 返回上一个web页
+ // 执行用户自定义返回逻辑
+ return true
+ } else {
+ // 执行系统默认返回逻辑,返回上一个page页
+ return false
+ }
+ }
+}
+```
+
+**参考链接**
+
+[Web组件](../reference/apis/js-apis-webview.md#accessstep)
+
diff --git a/zh-cn/application-dev/faqs/faqs-bundle-management.md b/zh-cn/application-dev/faqs/faqs-bundle-management.md
index 70d2dd7518b5674b41fb40d8e6c09945e3cb4bb5..a3f3a969f8be8b20e440cd558814b6aa84517e19 100644
--- a/zh-cn/application-dev/faqs/faqs-bundle-management.md
+++ b/zh-cn/application-dev/faqs/faqs-bundle-management.md
@@ -121,6 +121,86 @@ console.log(`bundleName: ${context.abilityInfo.bundleName}`)
## 能否在本应用中获取到其他应用的HAP包信息
-适用于:OpenHarmony 3.2 Beta API 9
+适用于:OpenHarmony 3.2 API 9
+
+**问题现象**
+
+如何查询系统内其他应用的信息
+
+**解决措施**
+
+查询系统内其他应用信息的API暂时只提供给系统应用使用,具体使用方法:
+
+- 查询系统内指定应用信息需要获取normal级权限ohos.permission.GET\_BUNDLE\_INFO,使用接口bundleManager.getApplicationInfo\(\)。
+
+- 查询系统内所有应用信息需要获取system\_basic级权限ohos.permission.GET\_BUNDLE\_INFO\_PRIVILEGED,使用接口bundleManager.getAllApplicationInfo\(\)。
+
+**参考链接**
+
+[@ohos.bundle.bundleManager \(bundleManager模块\)](../reference/apis/js-apis-bundleManager.md)
+
+## 如何查询进程的pid
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**解决措施**
+
+可以通过接口@ohos.process来获取。
+
+**代码示例**
+
+```
+import process from '@ohos.process';
+private pid = process.pid;
+```
+
+**参考链接**
+
+[@ohos.process \(获取进程相关的信息\)](../reference/apis/js-apis-process.md)
+
+## 如何让最大化按钮不可用
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**解决措施**
+
+可以通过supportWindowModes字段去指定是否显示。
+
+- full\_screen表示支持全屏显示
+
+- split表示支持分屏显示
+
+- floating表示支持窗口化显示
+
+**代码示例**
+
+```
+"abilities": [
+ {
+ "name": "EntryAbility",
+ "srcEntry": "./ets/entryability/EntryAbility.ts",
+ "description": "$string:EntryAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:EntryAbility_label",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:start_window_background",
+ "exported": true,
+ "supportWindowMode": ["split", "floating"],
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+]
+```
+
+**参考链接**
+
+[supportWindowModes参考文档](../reference/apis/js-apis-bundleManager-abilityInfo.md)
-根据OpenHarmony的安全设计规范,SDK不提供接口能力给三方应用查询其他应用的包信息(包括但不限于应用名称、版本号等)。
diff --git a/zh-cn/application-dev/faqs/faqs-compiler-runtime.md b/zh-cn/application-dev/faqs/faqs-compiler-runtime.md
new file mode 100644
index 0000000000000000000000000000000000000000..df36c62b07cd4e7945e2799bfe8cc3b77f22dd4b
--- /dev/null
+++ b/zh-cn/application-dev/faqs/faqs-compiler-runtime.md
@@ -0,0 +1,18 @@
+# 语言编译运行时常见问题
+
+## 从rawfile中获取json格式的字符串后,转换成对应的object对象后,再去调用实例方法时直接崩溃
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**问题现象**
+
+直接报错:jscrash happened in xxxxxxxxx,crash日志中错误信息:Error message: Unexpected Object in JSON
+
+**解决措施**
+
+通过json解析字符串得到的对象的原型是object,其原型链中不存在自有的实例方法,故无法调用。
+
+如需调用该方法,则有以下两种方式:
+1. 在解析后的对象上添加对应的原型。
+2. 将该实例方法改为静态方法,通过类名去调用。
+
diff --git a/zh-cn/application-dev/faqs/faqs-dfx.md b/zh-cn/application-dev/faqs/faqs-dfx.md
index 565f2de33dfad073ca60a7260ebbe0164dd1e689..e5779c96d03e2c13f89f88f2aa92f9f34bf65eea 100644
--- a/zh-cn/application-dev/faqs/faqs-dfx.md
+++ b/zh-cn/application-dev/faqs/faqs-dfx.md
@@ -4,10 +4,6 @@
适用于:OpenHarmony 3.2Beta API 9
-**问题现象**
-
-hilog日志如何落盘存储
-
**解决措施**
使用命令:hilog -w start -f ckTest -l 1M -n 5 -m zlib -j 11
@@ -26,3 +22,129 @@ hilog日志如何落盘存储
更多参数含义请使用hilog --help查看。
```
+## Hilog日志如何设置为只打印当前应用的日志
+
+适用于:OpenHarmony 3.2Beta API 9
+
+**解决措施**
+
+通过hilog命令行工具来过滤保留当前应用的日志日志。
+
+hilog -T xxx 按tag过滤;
+
+hilog –D xxx 按domain过滤;
+
+hilog -e 对日志内容匹配,支持正则式tag, domain, pid都支持多重过滤,组合过滤以及反向过滤。
+
+## 程序打开直接崩溃了,如何定位问题
+
+适用于:OpenHarmony 3.2Beta API 9
+
+**解决措施**
+
+方法1:通过业务日志打印,定位崩溃的代码位置。
+
+方法2:通过Crash文件查看报错信息,Crash文件路径是:/data/log/faultlog/faultlogger/。
+
+## 应用如何打印日志是使用hilog还是console,hilog接口参数domain的设置范围是什么
+
+适用于:OpenHarmony 3.2Beta API 9
+
+console是对hilog日志系统的封装,其采用默认参数,主要用于应用开发调试阶段。
+
+推荐使用hilog,可以对日志系统进行分类和统一处理,具体参考文档:[hilog日志系统](../reference/apis/js-apis-hilog.md#hilogisloggable)
+
+hilog接口参数domain的取值范围0x0\~0xFFFF,建议开发者在应用内根据需要自定义划分。
+
+## hilog日志打印长度限制是多少,是否可以配置
+
+适用于:OpenHarmony 3.2Beta API 9
+
+日志打印的长度限制为1024个字符,该长度不能配置
+
+## 格式化日志打印时,使用private的作用是什么
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**问题现象**
+
+C++代码中hilog的格式参数类型为%d或者%s时,日志打印为何显示private
+
+**解决措施**
+
+直接使用%d、%s等格式化参数时,标准系统默认使用private替换真实数据进行打印,防止数据泄露。如果需要打印出真实数据,需要使用%\{public\}d替换%d或者%\{public\}s替换%s。
+
+## 如何解决hilog.debug日志无法打印
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**解决措施**
+
+通过hdc命令 hdc shell hilog -b D开启调试开关
+
+## hilog接口的tag参数是否支持用空格隔开的多个字符串
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+支持。
+
+## hilog如何打印\{private\}隐私标志的内容
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**解决措施**
+
+使用命令关闭隐私模式即可。命令如下:hdc shell hilog -p off
+
+## 有关崩溃日志收集和性能问题排查的功能有哪些
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**问题现象**
+
+有关崩溃日志收集和性能问题排查的功能有哪些
+
+**解决措施**
+
+faultLogger:崩溃日志收集,参考文档:[故障日志获取](../reference/apis/js-apis-faultLogger.md)
+
+hichecker:问题检测,参考文档:[检测模式](../reference/apis/js-apis-hichecker.md)
+
+hiTraceMeter:性能打点,参考文档:[性能打点](../reference/apis/js-apis-hitracemeter.md)
+
+## 如何控制日志输出
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+**问题现象**
+
+根据不同的环境要求,输出不同的日志信息。
+
+**解决措施**
+
+通过hilog命令调整日志打印级别,输出不同级别的日志信息。命令如下:
+
+hdc shell hilog -L
+
+## hilog的TAG长度有限制吗
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+整个tag的长度是32。
+
+## 日志里面的appfreeze文件的怎么查看,要看哪些内容
+
+适用于:OpenHarmony 3.2 Beta API 9
+
+主要查看方向:
+
+1、先看一下Reason是什么事件的;根据不同的Reason下面有大致的检测原理和分析样例。
+
+2、关注MSG有什么信息,根据MSG的信息看一下大致的方向;
+
+3、分析OpenStacktraceCatcher里面的应用栈信息,并且结合流水日志一起确定一下当前在干什么事情;
+
+4、看一下PeerBinderCatcher当前进程是否有对端的binder卡住,如果有跟当前进程相关的同步wait,则会有相应的PeerBinder Stacktrace信息——这个是卡住你当前进程的对端进程的栈信息。
+
+5、还有整机进程的cpu信息和当前进程的内存信息辅助定位。
+
diff --git a/zh-cn/application-dev/faqs/faqs-distributed-data-management.md b/zh-cn/application-dev/faqs/faqs-distributed-data-management.md
index 935a31ebc67a2e390812c5745cd4aa924180082c..990e948258281788f189a759b82832ef4c06493a 100644
--- a/zh-cn/application-dev/faqs/faqs-distributed-data-management.md
+++ b/zh-cn/application-dev/faqs/faqs-distributed-data-management.md
@@ -25,8 +25,6 @@
关系型数据库rdb使用Sqlite数据库, 它不支持 TRUNCATE TABLE 语句,建议使用delete语句,如:DELETE FROM sqlite\_sequence WHERE name = 'table\_name' ,另外发生该错误会抛出空异常。
-
-
## 关系型数据库rdb支持哪些数据类型
适用于:OpenHarmony SDK 3.0版本以上,API 9 Stage模型
@@ -35,13 +33,43 @@
关系型数据库rdb支持的数据类型有:number、string、boolean。其中number为数字类型,支持Double,Long,Float,Int,Int64,最大精度为十进制17位数字。
-## 如何将PixelMap的数据存储到数据库中
+## 如何实现应用数据持久化存储
-适用于:OpenHarmony 3.2 Beta5 API 9
+适用于 OpenHarmony 3.2 Beta5 API 9
-**问题现象**
+**解决措施**
+
+通过PersistentStorage类实现管理应用持久化数据,可以将特定标记的持久化数据链接到AppStorage中,并由AppStorage接口访问对应持久化数据。PersistentStorage持久化后的数据会生成本地xml文件保存,文件路径为/data/app/el2/100/base//haps//files/persistent\_storage。
+
+示例:
-存储PixelMap的数据
+```
+AppStorage.Link('varA')
+PersistentStorage.PersistProp("varA", "111");
+@Entry
+@Component
+struct Index {
+ @StorageLink('varA') varA: string = ''
+ build() {
+ Column() {
+ Text('varA: ' + this.varA).fontSize(20)
+ Button('Set').width(100).height(100).onClick(() => {
+ this.varA += '333'
+ })
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
+```
+
+**参考链接**
+
+[持久化数据管理\(OpenHarmony\)](../quick-start/arkts-persiststorage.md)
+
+## 如何将PixelMap的数据存储到数据库中
+
+适用于:OpenHarmony 3.2 Beta5 API 9
**解决措施**
@@ -49,7 +77,7 @@ PixelMap应该被转换成相应的ArrayBuffer再放进数据库。
**参考链接**
-[readPixelsToBuffer](../reference/apis/js-apis-image.md#readpixelstobuffer7-1)
+[readPixelsToBuffer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md#readpixelstobuffer7-1)
## 如何获取rdb关系型数据库文件
@@ -105,6 +133,27 @@ API8版本rdb关系型数据库中TEXT类型保存超长文本失败
**解决措施**
API9版本之前对TEXT文本存储长度限制在1024字节,所以会存在超长文本保存失败的情况。
-
在API9的版本中已经放开了长度限制。
+## Preferences.put缓存成功,但get的结果一直是undefined
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**问题现象**
+
+使用首选项保存数据成功,但是获取数据为空。
+
+**解决措施**
+
+1. 使用put操作后,使用flush持久化数据,然后再使用get获取数据。
+
+2. 由于flush操作是异步执行,将Storage实例通过异步线程回写入文件中, 所以需要等待flush操作执行完成后,再执行get操作。
+
+## 使用RDB数据库时,能否指定内存数据库模式
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+RDB数据库底层使用的是SQLite,默认的内存数据库模式是文件,不支持修改。
+
diff --git a/zh-cn/application-dev/faqs/faqs-event-notification.md b/zh-cn/application-dev/faqs/faqs-event-notification.md
index f4b06e9496b2a5a0d156363a603c339012d419e7..4e15feed41b80437433db8fdc3a212d5e490a173 100644
--- a/zh-cn/application-dev/faqs/faqs-event-notification.md
+++ b/zh-cn/application-dev/faqs/faqs-event-notification.md
@@ -149,3 +149,64 @@ import UIAbility from '@ohos.app.ability.UIAbility';
**参考链接**
[使用EventHub进行数据](../application-models/uiability-data-sync-with-ui.md#使用eventhub进行数据通信)
+
+## 如何实现点击Notification通知打开App功能
+
+适用于:OpenHarmony 3.1 Beta5 API 9
+
+**解决措施**
+
+通过配置Notification.publish发布通知接口的参数NotificationRequest中wantAgent属性实现
+
+**代码示例**
+
+```
+import notificationManager from '@ohos.notificationManager';
+import WantAgent from '@ohos.app.ability.wantAgent';
+
+async function publishNotification() {
+ let wantAgentInfo = {
+ wants: [
+ {
+ bundleName: "com.example.webuseragent", // 自己应用的bundleName
+ abilityName: "EntryAbility",
+ }
+ ],
+ operationType: WantAgent.OperationType.START_ABILITIES,
+ requestCode: 1,
+ }
+ const wantAgent = await WantAgent.getWantAgent(wantAgentInfo)
+ let contentType = notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT;
+ await notificationManager.publish({
+ content: {
+ contentType: contentType,
+ normal: {
+ title: "测试标题",
+ text: "测试内容",
+ }
+ },
+ id: 1,
+ wantAgent: wantAgent
+ })
+}
+```
+
+**参考链接**
+
+[Notification](../reference/apis/js-apis-notificationManager.md)、[WantAgent](../reference/apis/js-apis-app-ability-wantAgent.md)
+
+## 调用notificationManager.publish发布通知失败
+
+适用于:OpenHarmony 3.2 Beta5
+
+**问题现象**
+
+发布通知后,无错误日志信息,通知栏没有通知显示
+
+**解决措施**
+
+发布通知时,需要在真机端系统设置中,开启对应应用的通知开关,然后才能在通知栏中看到发布的通知。
+
+手动开启步骤:设置 \> 通知和状态栏 \> 应用名称 \> 允许通知。
+
+也可通过接口notificationManager.requestEnableNotification\(\)来弹窗让用户授权(仅弹一次)。
diff --git a/zh-cn/application-dev/faqs/faqs-file-management.md b/zh-cn/application-dev/faqs/faqs-file-management.md
index 13dfb4b635a437205cfac776d39dbbb70df0c9ac..c3d0db10dc2282e883918ca0d6f9c9c467ec800a 100644
--- a/zh-cn/application-dev/faqs/faqs-file-management.md
+++ b/zh-cn/application-dev/faqs/faqs-file-management.md
@@ -20,4 +20,91 @@
输入命令 hdc shell mount -o remount,rw /,正确执行无提示信息。
+## 如何实现文件不存在则创建文件
+适用于:OpenHarmony 3.2 版本 API 9
+
+**解决措施**
+
+可以通过调用函数fs.open来实现,open\(path: string, mode?: number\),指定第二个参数mode为fs.OpenMode.CREATE,表示若文件不存在,则创建文件。
+
+## 如何解决文件的中文乱码问题
+
+适用于:OpenHarmony 3.2 版本 API 9
+
+**解决措施**
+
+读取文件内容的buffer数据后,通过@ohos.util的TextDecoder对文件内容进行解码。
+
+```
+let filePath = getContext(this).filesDir + "/test0.txt";
+let stream = fs.createStreamSync(filePath, "r+");
+let buffer = new ArrayBuffer(4096)
+let readOut = stream.readSync(buffer);
+let textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true })
+let readString = textDecoder.decodeWithStream(new Uint8Array(buffer), { stream: false });
+console.log("读取的文件内容:" + readString);
+```
+
+## “datashare://”路径使用fs.open可以打开,但使用fs.copyFile会报错
+
+适用于:OpenHarmony 3.2 版本 API 9
+
+**解决措施**
+
+copyfile不支持uri,可以先使用open接口打开datashare uri后,拿到fd后再调用copyfile接口。
+
+```
+let file = fs.openSync("datashare://...")
+fs.copyFile(file.fd, 'dstPath', 0).then(() => {
+ console.info('copyFile success')
+}).catch((err) => {
+ console.info("copy file failed with error message: " + err.message + ", error code: " + err.code);
+})
+```
+
+## 如何修改沙箱路径下json文件的指定内容
+
+适用于:OpenHarmony 3.2 版本 API 9
+
+**解决措施**
+
+可以通过以下步骤来完成:
+
+1、使用fs.openSyn获取json文件的fd。
+
+```
+import fs from '@ohos.file.fs';
+let sanFile = fs.open(basePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
+let fd = sanFile.fd;
+```
+
+2、通过fs.readSync读取json文件内容。
+
+```
+let content = fs.readSync(basePath);
+```
+
+3、修改内容。
+
+```
+obj.name = 'new name';
+```
+
+4、重新写入json文件。
+
+```
+fs.writeSync(file.fd, JSON.stringify(obj));
+```
+
+fs的具体使用可以参考:[@ohos.file.fs](../reference/apis/js-apis-file-fs.md)
+
+## 通过fileAccess模块获取的文件路径对应的实际路径是什么
+
+适用于:OpenHarmony 3.2 版本 API 9 Stage模型
+
+**解决措施**
+
+此类文件是保存在/storage/media/100/local/files目录下,具体位置与文件类型和来源有关。知道文件名时,可在此目录下通过如下命令查找:find . -name \[filename\]
+
+[应用文件上传下载](../file-management/app-file-upload-download.md)
diff --git a/zh-cn/application-dev/faqs/faqs-globalization.md b/zh-cn/application-dev/faqs/faqs-globalization.md
index 9c42388f55a0a8ecd34de67d069bca30d0a70660..bcec6c810b7d5cc912e8c78e6a8a58d95dc38500 100644
--- a/zh-cn/application-dev/faqs/faqs-globalization.md
+++ b/zh-cn/application-dev/faqs/faqs-globalization.md
@@ -116,3 +116,35 @@ Resource为string支持限定词目录使用this.context.resourceManager.getStri
适用于:OpenHarmony 3.2 Beta5 API 9
form\_config.json文件中不支持使用\$引用常量。
+
+## ArkTS如何解析xml文件
+
+适用于:OpenHarmony 3.2 Beta5 API 9
+
+**解决措施**
+
+1. 在rawfile目录下创建如下xml文件**。**
+
+ ```
+
+
+ Jacky
+ 18
+
+ ```
+
+2. 使用resourceManager.getRawFileContent获取xml文件字节数组。
+
+ ```
+ import resourceManager from '@ohos.resourceManager';
+ resourceManager.getRawFileContent("test.xml", (error, value) => {
+ if (error != null) {
+ console.log("error is " + error);
+ return
+ }
+ let arrayBuffer = value.buffer; // unit8Array
+ var xmpParser = new xml.XmlPullParser(arrayBuffer);
+ var tagName = ""
+ //do something
+ }
+ ```
diff --git a/zh-cn/application-dev/faqs/faqs-graphics.md b/zh-cn/application-dev/faqs/faqs-graphics.md
index 6f2c98331f3a50ca08c1de6460b91069c1c2bc73..426529f1568fba9f53c85da3d9c70a0a8aa0f01a 100644
--- a/zh-cn/application-dev/faqs/faqs-graphics.md
+++ b/zh-cn/application-dev/faqs/faqs-graphics.md
@@ -23,7 +23,7 @@ try {
## 如何隐藏状态栏实现沉浸式效果
-适用于:OpenHarmony 3.2 Beta5,API 9 Stage模型
+适用于:OpenHarmony 3.2 Beta5,API 9
**解决措施**
@@ -59,7 +59,7 @@ try {
## 如何获取窗口的宽高信息
-适用于:OpenHarmony SDK 3.2 Beta5,API 9 Stage模型
+适用于:OpenHarmony 3.2 Beta5,API 9 Stage模型
**解决措施**
@@ -91,3 +91,32 @@ try {
}
```
+## 如何对图片进行高斯模糊处理
+
+适用于:OpenHarmony 3.2 Beta5,API 9
+
+**解决措施**
+
+导入图像处理(@ohos.multimedia.image)和图像效果(@ohos.effectKit)模块,对图像进行处理并添加模糊效果。
+
+**代码示例**
+
+```
+import image from "@ohos.multimedia.image";
+import effectKit from "@ohos.effectKit";
+
+ const color = new ArrayBuffer(96);
+ let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } };
+ image.createPixelMap(color, opts).then((pixelMap) => {
+ let radius = 5;
+ let headFilter = effectKit.createEffect(pixelMap);
+ if (headFilter != null) {
+ headFilter.blur(radius);
+ }
+ })
+```
+
+**参考链接:**
+
+[图片添加模糊效果](../reference/apis/js-apis-effectKit.md#blur)
+
diff --git a/zh-cn/application-dev/faqs/faqs-multimedia.md b/zh-cn/application-dev/faqs/faqs-multimedia.md
index d2cec03590cf9ac47434dab0d24d911c2bd89835..f22280c5696d4dfaf74e72ded586c69597d07ad9 100644
--- a/zh-cn/application-dev/faqs/faqs-multimedia.md
+++ b/zh-cn/application-dev/faqs/faqs-multimedia.md
@@ -2,7 +2,7 @@
## 使用XComponent组件显示相机的预览输出流时,如何获取相机的帧数据
-适用于:OpenHarmony 3.2 版本 API 9 Stage模型
+适用于:OpenHarmony 3.2 版本 API 9
**问题现象**
@@ -35,7 +35,7 @@
## 如何获取前置摄像头的预览图像
-适用于:OpenHarmony 3.2版本 API 9 Stage模型
+适用于:OpenHarmony 3.2版本 API 9
**解决措施**
@@ -76,7 +76,7 @@
## 如何设置相机焦距
-适用于:OpenHarmony 3.2版本 API 9 Stage模型
+适用于:OpenHarmony 3.2版本 API 9
**解决措施**
@@ -86,7 +86,7 @@
## 如何后台播放音乐
-适用于:OpenHarmony 3.2版本 API 9 Stage模型
+适用于:OpenHarmony 3.2版本 API 9
**问题现象**
@@ -105,7 +105,7 @@ AVSession对媒体播放做了管控,当三方应用从前台切入后台或
## 创建多个视频组件无法播放
-适用于:OpenHarmony 3.2版本 API 9 Stage模型
+适用于:OpenHarmony 3.2版本 API 9
**问题现象**
@@ -115,10 +115,9 @@ AVSession对媒体播放做了管控,当三方应用从前台切入后台或
当前限制最多创建13个媒体播放实例。
-
## 如何直接调起图片库
-适用于:OpenHarmony 3.2版本 API 9 Stage模型
+适用于:OpenHarmony 3.2版本 API 9
**解决措施**
@@ -134,3 +133,67 @@ let context = getContext(this) as common.UIAbilityContext;
context.startAbility(want);
```
+## 如何申请设备上的媒体读写权限
+
+适用于:OpenHarmony 3.2版本 API 9 Stage模型
+
+**解决措施**
+
+1. 在module.json5配置文件中配置媒体读写权限ohos.permission.READ\_MEDIA和ohos.permission.WRITE\_MEDIA。
+
+ 示例:
+
+ ```
+ {
+ "module" : {
+ "requestPermissions":[
+ {
+ "name" : "ohos.permission.READ_MEDIA",
+ "reason": "$string:reason"
+ },
+ {
+ "name" : "ohos.permission.WRITE_MEDIA",
+ "reason": "$string:reason"
+ }
+ ]
+ }
+ }
+ ```
+
+2. 这两个权限的授权方式均为user\_grant,因此需要调用requestPermissionsFromUser接口,以动态弹窗的方式向用户申请授权。
+
+ ```
+ let context = getContext(this) as common.UIAbilityContext;
+ let atManager = abilityAccessCtrl.createAtManager();
+ let permissions: Array = ['ohos.permission.READ_MEDIA','ohos.permission.WRITE_MEDIA']
+ atManager.requestPermissionsFromUser(context, permissions)
+ .then((data) => {
+ console.log("Succeed to request permission from user with data: " + JSON.stringify(data))
+ }).catch((error) => {
+ console.log("Failed to request permission from user with error: " + JSON.stringify(error))
+ })
+ ```
+
+## 如何检测当前相机服务的状态
+
+适用于:OpenHarmony 3.2版本 API 9 Stage模型
+
+**解决措施**
+
+cameraManager通过设置状态回调返回相机状态。
+
+```
+cameraManager.on('cameraStatus', (cameraStatusInfo) => {
+ console.log(`camera : ${cameraStatusInfo.camera.cameraId}`);
+ console.log(`status: ${cameraStatusInfo.status}`);
+})
+```
+相机状态:CameraStatus
+枚举,相机状态。
+CAMERA_STATUS_APPEAR 0 新的相机出现。
+CAMERA_STATUS_DISAPPEAR 1 相机被移除。
+CAMERA_STATUS_AVAILABLE 2 相机可用。
+CAMERA_STATUS_UNAVAILABLE 3 相机不可用。
+
+参考文档:[CameraStatus](../reference/apis/js-apis-camera.md#oncamerastatus)
+
diff --git a/zh-cn/application-dev/faqs/faqs-sdk.md b/zh-cn/application-dev/faqs/faqs-sdk.md
index ec62b97108d16192f52ebeea388e589a7f289dfc..f31cd09dec76138408c9e423d7b5f315b4bcfb82 100644
--- a/zh-cn/application-dev/faqs/faqs-sdk.md
+++ b/zh-cn/application-dev/faqs/faqs-sdk.md
@@ -39,3 +39,39 @@ target_link_libraries(entry PUBLIC
)
```
+## 在Native代码中使用OH\_LOG\_Print打印日志报错
+
+适用于:OpenHarmony 3.1 Beta5 API 9
+
+**问题现象**
+
+在Native代码中使用OH\_LOG\_Print打印日志,上报错误:undefined symbol: OH\_LOG\_Print
+
+**原因分析**
+
+缺少链接库文件。
+
+**解决措施**
+
+打开CMakeLists.txt文件,在target\_link\_libraries最后追加libhilog\_ndk.z.so。
+
+```
+set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries(entry PUBLIC
+ libace_napi.z.so
+ libhilog_ndk.z.so
+)
+```
+
+## 如何遍历rawfiles中的文件
+
+适用于:OpenHarmony 3.1 Beta5 API 9
+
+**解决方案:**
+
+使用Native API中的OH\_ResourceManager\_OpenRawDir\(\)方法获取到rawfile的根目录,然后对其进行遍历。
+
+**参考文档:**
+
+[Native开发指导](../reference/native-apis/rawfile.md)
+
diff --git a/zh-cn/application-dev/faqs/faqs-sensor.md b/zh-cn/application-dev/faqs/faqs-sensor.md
index 19a1a3a9d4061be371c6e9a410f0726dd9d0a8de..1e8249432e9d149b10dcc96004f754efbdfe0730 100644
--- a/zh-cn/application-dev/faqs/faqs-sensor.md
+++ b/zh-cn/application-dev/faqs/faqs-sensor.md
@@ -6,3 +6,19 @@
PPG和ECG的血压监测传感器属于可穿戴设备传感器,传感器数据设计个人隐私数据,暂未对个人开发者开放接口。
+## 如何正确使用震动模块接口
+
+适用于:OpenHarmony 3.2版本 API 9 Stage模型
+
+**问题现象**
+
+震动模块接口调用报错,错误码201。
+
+vibrate fail, error.code: 201error.message: NaN
+
+**解决措施**
+
+权限校验失败。需要申请ohos.permission.VIBRATE权限。
+
+参考文档:[权限申请](../security/accesstoken-guidelines.md)
+
diff --git a/zh-cn/application-dev/faqs/faqs-third-fourth-party-library.md b/zh-cn/application-dev/faqs/faqs-third-fourth-party-library.md
index 887f1862bb7f9a4fe5208786bfa00109bdfdbc1b..8306f581a948d33ac9d9f18992c23ea39e580c2c 100644
--- a/zh-cn/application-dev/faqs/faqs-third-fourth-party-library.md
+++ b/zh-cn/application-dev/faqs/faqs-third-fourth-party-library.md
@@ -4,7 +4,7 @@
适用于OpenHarmony 3.1 Beta5 API 9
-通过ohpm可以获取的三四方库在Gitee上做了汇总([OpenHarmony上可直接使用的三方组件汇总](https://gitee.com/openharmony-tpc/tpc_resource)),针对于不同功能三方库内容做了分类,开发者可以根据需要进行参考。
+通过ohpm可以获取的三四方库在Gitee上做了汇总([OpenHarmony上可直接使用的三方组件汇总](https://gitee.com/openharmony-tpc/tpc_resource?_from=gitee_search#%E4%B8%89%E6%96%B9%E7%BB%84%E4%BB%B6%E8%B5%84%E6%BA%90%E6%B1%87%E6%80%BB)),针对于不同功能三方库内容做了分类,开发者可以根据需要进行参考。
## 网络相关的三方库有哪些
diff --git a/zh-cn/application-dev/faqs/faqs-window-manager.md b/zh-cn/application-dev/faqs/faqs-window-manager.md
index e2cb6b2fbd358cac246d421f01d69564800c880c..be3ac7d14cfe79b8d64d58acda9eb840aeb8636a 100644
--- a/zh-cn/application-dev/faqs/faqs-window-manager.md
+++ b/zh-cn/application-dev/faqs/faqs-window-manager.md
@@ -63,3 +63,103 @@ onWindowStageCreate(windowStage){
[窗口基础能力文档](../reference/apis/js-apis-window.md)
+## 如何锁定设备竖屏,使得窗口不随屏幕旋转
+
+适用于:OpenHarmony SDK 3.2 Beta5 API 9 Stage模型
+
+**解决措施**
+
+采用窗口的setPreferredOrientation方法可以实现该效果,将orientation参数设置为window.Orientation.PORTRAIT时,可锁定屏幕为竖屏。
+
+**代码示例**
+
+```
+import window from "@ohos.window";
+//1.获取窗口实例对象,新建窗口使用createWindow方法,获取已有的窗口使用findWindow方法
+let windowClass = null;
+let config = {name: "alertWindow", windowType: window.WindowType.TYPE_SYSTEM_ALERT, ctx: this.context};
+try {
+ let promise = window.createWindow(config);
+ promise.then((data)=> {
+ windowClass = data;
+ console.info('Succeeded in creating the window. Data:' + JSON.stringify(data));
+ }).catch((err)=>{
+ console.error('Failed to create the Window. Cause:' + JSON.stringify(err));
+ });} catch (exception) {
+ console.error('Failed to create the window. Cause: ' + JSON.stringify(exception));
+}
+//2.窗口实例使用setPreferredOrientation方法,设置窗口的显示方向,PROTRAIT为固定竖屏,其他方向可参照参考链接
+let orientation = window.Orientation.PORTRAIT;
+if (windowClass) {
+ windowClass.setPreferredOrientation(orientation, (err) => {
+ if (err.code) {
+ console.error('Failed to set window orientation. Cause: ' + JSON.stringify(err));
+ return;
+ }
+ console.info('Succeeded in setting window orientation.');
+}
+```
+
+**参考链接**
+
+[window.Orientation](../reference/apis/js-apis-window.md#orientation9)
+
+## 调用Window实例的setWindowSystemBarProperties接口设置窗口状态栏和导航栏的高亮属性时不生效
+
+适用于:OpenHarmony SDK 3.2 Beta5 API9 Stage模型
+
+**解决措施**
+
+状态栏字体高亮属性的本质就只是让字体变成白色。调用window实例的setWindowSystemBarProperties接口时,如果设置了状态栏内容颜色statusBarContentColor,就以开发者设置的颜色为准,isStatusBarLightIcon状态栏字体高亮属性就不生效;同理,如果设置了导航栏内容颜色navigationBarContentColor,isNavigationBarLightIcon导航栏字体高亮属性就不生效。
+
+**参考链接**
+
+[window.SystemBarProperties](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-window.md#systembarproperties)
+
+## 如何保持屏幕常亮
+
+适用于:OpenHarmony 3.2 Beta5 API9
+
+**解决措施**
+
+设置屏幕常亮,不熄屏。
+
+获取窗口实例对象后,调用[setWindowKeepScreenOn方法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-window.md#setwindowkeepscreenon9)可设置屏幕是否常亮。
+
+```
+let isKeepScreenOn = true;
+try {
+ windowClass.setWindowKeepScreenOn(isKeepScreenOn, (err) => {
+ if (err.code) {
+ console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(err));
+ return;
+ }
+ console.info('Succeeded in setting the screen to be always on.');
+ });
+} catch (exception) {
+ console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception));
+}
+```
+
+## 如何监听窗口大小的变化
+
+适用于:OpenHarmony 3.2 Beta5 API9
+
+**解决措施**
+
+获取窗口实例对象后,可以通过窗口的on\('windowSizeChange'\)方法实现对窗口尺寸大小变化的监听
+
+```
+try {
+ windowClass.on('windowSizeChange', (data) => {
+ console.info('Succeeded in enabling the listener for window size changes. Data: ' + JSON.stringify(data));
+ });
+} catch (exception) {
+ console.error('Failed to enable the listener for window size changes. Cause: ' + JSON.stringify(exception));
+}
+```
+
+**参考链接**
+
+[window.on\("windowSizeChange"\)](../reference/apis/js-apis-window.md#onwindowsizechange7)
+
diff --git a/zh-cn/application-dev/quick-start/figures/alarm.png b/zh-cn/application-dev/faqs/figures/alarm.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/alarm.png
rename to zh-cn/application-dev/faqs/figures/alarm.png
diff --git a/zh-cn/application-dev/quick-start/figures/alarmHand.png b/zh-cn/application-dev/faqs/figures/alarmHand.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/alarmHand.png
rename to zh-cn/application-dev/faqs/figures/alarmHand.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655128939.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655128939.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655128939.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655128939.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655128998.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655128998.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655128998.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655128998.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129041.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129041.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129041.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129041.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129232.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129232.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129232.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129232.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129264.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129264.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129264.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129264.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129333.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129333.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129333.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129333.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129372.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129372.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129372.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129372.png
diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129398.png b/zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129398.png
similarity index 100%
rename from zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001655129398.png
rename to zh-cn/application-dev/faqs/figures/zh-cn_image_0000001655129398.png
diff --git a/zh-cn/application-dev/quick-start/full-sdk-compile-guide.md b/zh-cn/application-dev/faqs/full-sdk-compile-guide.md
similarity index 100%
rename from zh-cn/application-dev/quick-start/full-sdk-compile-guide.md
rename to zh-cn/application-dev/faqs/full-sdk-compile-guide.md
diff --git a/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md b/zh-cn/application-dev/faqs/full-sdk-switch-guide.md
similarity index 100%
rename from zh-cn/application-dev/quick-start/full-sdk-switch-guide.md
rename to zh-cn/application-dev/faqs/full-sdk-switch-guide.md
diff --git a/zh-cn/application-dev/media/using-avsession-developer.md b/zh-cn/application-dev/media/using-avsession-developer.md
index 865417c9a28f6526934a4c7d4702db452f78fd51..bc2f22de68aacb7a922461f41753d423eded6338 100644
--- a/zh-cn/application-dev/media/using-avsession-developer.md
+++ b/zh-cn/application-dev/media/using-avsession-developer.md
@@ -143,7 +143,7 @@
```ts
// 假设已经创建了一个session,如何创建session可以参考之前的案例
let session: AVSessionManager.AVSession = ALREADY_CREATE_A_SESSION;
- let wantAgentInfo: {
+ let wantAgentInfo = {
wants: [
{
bundleName: 'com.example.musicdemo',
diff --git a/zh-cn/application-dev/notification/Readme-CN.md b/zh-cn/application-dev/notification/Readme-CN.md
index 37198818a00d30ab34dbe5c475a2ab7f1bf9495b..fd7aa8a9aa58543d263d517283b892407a8a2068 100644
--- a/zh-cn/application-dev/notification/Readme-CN.md
+++ b/zh-cn/application-dev/notification/Readme-CN.md
@@ -3,7 +3,7 @@
- [通知概述](notification-overview.md)
- [订阅通知(仅对系统应用开放)](notification-subscription.md)
- [使能通知开关](notification-enable.md)
-- [通知角标](notification-badge.md)
+- [设置通知角标](notification-badge.md)
- 发布通知
- [发布基础类型通知](text-notification.md)
- [发布进度条类型通知](progress-bar-notification.md)
diff --git a/zh-cn/application-dev/notification/figures/zh-cn_image_0000001466462305.png b/zh-cn/application-dev/notification/figures/zh-cn_image_0000001466462305.png
index 2c580f75dc86159b4088e54d3f83e163fd352f6d..f879ad7ef01a39b5f18af8abea3f7f1842b2b446 100644
Binary files a/zh-cn/application-dev/notification/figures/zh-cn_image_0000001466462305.png and b/zh-cn/application-dev/notification/figures/zh-cn_image_0000001466462305.png differ
diff --git a/zh-cn/application-dev/notification/notification-badge.md b/zh-cn/application-dev/notification/notification-badge.md
index 719dd9b5c1481481b8f3a9819470eb25723b0e05..d113365cf398d36863ba722739147a7c53bfc61e 100644
--- a/zh-cn/application-dev/notification/notification-badge.md
+++ b/zh-cn/application-dev/notification/notification-badge.md
@@ -11,11 +11,11 @@
1. 通知服务提供了两种增加角标数的方法:
- - 发布通知时,在[NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest)的badgeNumber字段里携带,桌面收到通知后,在原角标数上累加、呈现。
+ - 发布通知时,在[NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest)的badgeNumber字段里携带,桌面收到通知后,在原角标数上累加、呈现。
- - 调用接口[setBadgeNumber](../reference/apis/js-apis-notificationManager.md#setbadgenumber)设置,桌面按设置的角标数呈现。
+ - 调用接口[`setBadgeNumber()`](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10)设置,桌面按设置的角标数呈现。
-2. 角标数减少,目前仅支持通过[setBadgeNumber](../reference/apis/js-apis-notificationManager.md#setbadgenumber)设置。
+2. 角标数减少,目前仅支持通过[`setBadgeNumber()`](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10)设置。
| **接口名** | **描述** |
| -------- | -------- |
@@ -32,39 +32,38 @@
2. 增加角标个数。
- 发布通知在[NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest)的badgeNumber字段里携带,可参考[通知发布](text-notification.md)章节。
+ 发布通知在[NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest)的badgeNumber字段里携带,可参考[通知发布](text-notification.md)章节。
示例为调用setBadgeNumber接口增加角标,在发布完新的通知后,调用该接口。
```ts
function setBadgeNumberCallback(err) {
- if (err) {
- console.info(`Set badge failed code is ${err.code}, message is ${err.message}`);
- } else {
- console.info(`Set badge success`);
- }
+ if (err) {
+ console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info(`Succeeded in seting badge number.`);
}
- let badgeNumber = 10
+ let badgeNumber = 10;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
```
-3. 减少角标个数
+3. 减少角标个数。
一条通知被查看后,应用需要调用接口设置剩下未读通知个数,桌面刷新角标。
```ts
function setBadgeNumberCallback(err) {
- if (err) {
- console.info(`Set badge failed code is ${err.code}, message is ${err.message}`);
- } else {
- console.info(`Set badge success`);
- }
+ if (err) {
+ console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info(`Succeeded in seting badge number.`);
}
- let badgeNumber = 9
+ let badgeNumber = 9;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
```
-
diff --git a/zh-cn/application-dev/notification/notification-enable.md b/zh-cn/application-dev/notification/notification-enable.md
index 8979f708736def28a8fbf84dbcffbe513af146f8..45d3345c19810f5e0c2dfce772cf1e9a378d8339 100644
--- a/zh-cn/application-dev/notification/notification-enable.md
+++ b/zh-cn/application-dev/notification/notification-enable.md
@@ -1,7 +1,7 @@
# 使能通知开关
-应用需要开启通知开关才能发送通知。开发者可以在通知发布前调用[requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationrequestenablenotification)方法,弹窗让用户选择是否开启使能开关,仅弹窗一次,后续调用该接口不再弹窗。
+应用需要开启通知开关才能发送通知。开发者可以在通知发布前调用[requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationmanagerrequestenablenotification)方法,弹窗让用户选择是否开启使能开关,仅弹窗一次,后续调用该接口不再弹窗。
**图1** 使能通知开关示意图

@@ -9,7 +9,7 @@
- 点击“允许”后,则表示允许应用发送通知。
-- 点击“取消”后,再次调用[requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationrequestenablenotification)方法,则不再弹窗。此时如需要手动使能通知开关,操作步骤如下所示。
+- 点击“取消”后,再次调用[requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationmanagerrequestenablenotification)方法,则不再弹窗。此时如需要手动使能通知开关,操作步骤如下所示。
| ①从设备左上方下拉,进入通知界面 | ②点击右上角“设置”图标,进入通知界面,找到需要打开通知开关的应用 | ③打开“允许通知”开关 |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
diff --git a/zh-cn/application-dev/notification/notification-overview.md b/zh-cn/application-dev/notification/notification-overview.md
index 18cfacc8a97bc17ab063a9046c5196a31faa2e19..8d94d296892616eae51485476ce4f2aead49df44 100644
--- a/zh-cn/application-dev/notification/notification-overview.md
+++ b/zh-cn/application-dev/notification/notification-overview.md
@@ -13,7 +13,7 @@
- 显示当前正在进行的事件,如下载等。
-OpenHarmony通过ANS(Advanced Notification Service,通知系统服务)对通知类型的消息进行管理,支持多种通知类型,如基础类型通知、进度条类型通知、后台代理提醒。
+OpenHarmony通过ANS(Advanced Notification Service,通知系统服务)对通知类型的消息进行管理,支持多种通知类型,例如基础类型通知、进度条类型通知、后台代理提醒。
## 通知业务流程
@@ -24,6 +24,7 @@ OpenHarmony通过ANS(Advanced Notification Service,通知系统服务)对
系统应用还支持通知相关配置,如使能开关、配置参数由系统配置发起请求,发送到通知子系统存储到内存和数据库。
+**图1** 通知业务流程

## 相关实例
diff --git a/zh-cn/application-dev/notification/notification-subscription.md b/zh-cn/application-dev/notification/notification-subscription.md
index 04b69d9fbaf76f42e1f0228909046ddd663cdfd7..33db2db09dc8ca0489f79ce12d6c2fff14789138 100644
--- a/zh-cn/application-dev/notification/notification-subscription.md
+++ b/zh-cn/application-dev/notification/notification-subscription.md
@@ -46,37 +46,38 @@
```ts
let subscriber = {
- onConsume: function (data) {
- let req = data.request;
- console.info('[ANS] onConsume callback req.id: ' + req.id);
- },
- onCancel: function (data) {
- let req = data.request;
- console.info('[ANS] onCancel callback req.id: : ' + req.id);
- },
- onUpdate: function (data) {
- console.info('[ANS] onUpdate in test');
- },
- onConnect: function () {
- console.info('[ANS] onConnect in test');
- },
- onDisconnect: function () {
- console.info('[ANS] onDisConnect in test');
- },
- onDestroy: function () {
- console.info('[ANS] onDestroy in test');
- },
+ onConsume: function (data) {
+ let req = data.request;
+ console.info(`onConsume callback. req.id: ${req.id}`);
+ },
+ onCancel: function (data) {
+ let req = data.request;
+ console.info(`onCancel callback. req.id: ${req.id}`);
+ },
+ onUpdate: function (data) {
+ let req = data.request;
+ console.info(`onUpdate callback. req.id: ${req.id}`);
+ },
+ onConnect: function () {
+ console.info(`onConnect callback.}`);
+ },
+ onDisconnect: function () {
+ console.info(`onDisconnect callback.}`);
+ },
+ onDestroy: function () {
+ console.info(`onDestroy callback.}`);
+ },
};
```
-
+
4. 发起通知订阅。
```ts
notificationSubscribe.subscribe(subscriber, (err, data) => { // callback形式调用异步接口
if (err) {
- console.error(`[ANS] subscribe failed, code is ${err.code}, message is ${err.message}`);
+ console.error(`Failed to subscribe notification. Code is ${err.code}, message is ${err.message}`);
return;
}
- console.info(`[ANS] subscribeTest success : + ${data}`);
+ console.info(`Succeeded in subscribing to notification. Data: ${data}`);
});
```
diff --git a/zh-cn/application-dev/notification/notification-with-wantagent.md b/zh-cn/application-dev/notification/notification-with-wantagent.md
index d3ea33340bf8af7a738c2655abd892d1a67b6357..4b3a00ff7ceefb580ba2b6e1aff051ea95f45c93 100644
--- a/zh-cn/application-dev/notification/notification-with-wantagent.md
+++ b/zh-cn/application-dev/notification/notification-with-wantagent.md
@@ -4,7 +4,7 @@
为通知添加行为意图的实现方式如下图所示:发布通知的应用向应用组件管理服务AMS(Ability Manager Service)申请[WantAgent](../reference/apis/js-apis-app-ability-wantAgent.md),然后随其他通知信息一起发送给桌面,当用户在桌面通知栏上点击通知时,触发[WantAgent](../reference/apis/js-apis-app-ability-wantAgent.md)动作。
- **图1** 携带行为意图的通知运行机制
+**图1** 携带行为意图的通知运行机制

@@ -41,20 +41,20 @@
// 通过WantAgentInfo的operationType设置动作类型
let wantAgentInfo = {
- wants: [
- {
- deviceId: '',
- bundleName: 'com.example.myapplication',
- abilityName: 'EntryAbility',
- action: '',
- entities: [],
- uri: '',
- parameters: {}
- }
- ],
- operationType: wantAgent.OperationType.START_ABILITY,
- requestCode: 0,
- wantAgentFlags:[wantAgent.WantAgentFlags.CONSTANT_FLAG]
+ wants: [
+ {
+ deviceId: '',
+ bundleName: 'com.example.myapplication',
+ abilityName: 'EntryAbility',
+ action: '',
+ entities: [],
+ uri: '',
+ parameters: {}
+ }
+ ],
+ operationType: wantAgent.OperationType.START_ABILITY,
+ requestCode: 0,
+ wantAgentFlags:[wantAgent.WantAgentFlags.CONSTANT_FLAG]
};
```
@@ -65,16 +65,16 @@
// 通过WantAgentInfo的operationType设置动作类型
let wantAgentInfo = {
- wants: [
- {
- action: 'event_name', // 设置事件名
- parameters: {},
- }
- ],
- operationType: wantAgent.OperationType.SEND_COMMON_EVENT,
- requestCode: 0,
- wantAgentFlags: [wantAgent.WantAgentFlags.CONSTANT_FLAG],
- }
+ wants: [
+ {
+ action: 'event_name', // 设置事件名
+ parameters: {},
+ }
+ ],
+ operationType: wantAgent.OperationType.SEND_COMMON_EVENT,
+ requestCode: 0,
+ wantAgentFlags: [wantAgent.WantAgentFlags.CONSTANT_FLAG],
+ };
```
4. 调用[getWantAgent()](../reference/apis/js-apis-app-ability-wantAgent.md#wantagentgetwantagent)方法进行创建WantAgent。
@@ -82,12 +82,12 @@
```typescript
// 创建WantAgent
wantAgent.getWantAgent(wantAgentInfo, (err, data) => {
- if (err) {
- console.error('[WantAgent]getWantAgent err=' + JSON.stringify(err));
- return;
- }
- console.info('[WantAgent]getWantAgent success');
- wantAgentObj = data;
+ if (err) {
+ console.error(`Failed to get want agent. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info('Succeeded in geting want agent.');
+ wantAgentObj = data;
});
```
@@ -96,25 +96,25 @@
```typescript
// 构造NotificationRequest对象
let notificationRequest: notificationManager.NotificationRequest = {
- content: {
- contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
- normal: {
- title: 'Test_Title',
- text: 'Test_Text',
- additionalText: 'Test_AdditionalText',
- },
+ content: {
+ contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
+ normal: {
+ title: 'Test_Title',
+ text: 'Test_Text',
+ additionalText: 'Test_AdditionalText',
},
- id: 1,
- label: 'TEST',
- wantAgent: wantAgentObj,
+ },
+ id: 1,
+ label: 'TEST',
+ wantAgent: wantAgentObj,
}
notificationManager.publish(notificationRequest, (err) => {
- if (err) {
- console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
- return;
- }
- console.info(`[ANS] publish success`);
+ if (err) {
+ console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info('Succeeded in publishing notification.');
});
```
diff --git a/zh-cn/application-dev/notification/progress-bar-notification.md b/zh-cn/application-dev/notification/progress-bar-notification.md
index 69da9774cda1cd37d28e08fd99e4870011a07147..d5720422d429fea4edf5f0da01309ac4127ecdf2 100644
--- a/zh-cn/application-dev/notification/progress-bar-notification.md
+++ b/zh-cn/application-dev/notification/progress-bar-notification.md
@@ -5,12 +5,13 @@
目前系统模板仅支持进度条模板,通知模板[NotificationTemplate](../reference/apis/js-apis-inner-notification-notificationTemplate.md)中的data参数为用户自定义数据,用于显示与模块相关的数据,效果示意如下图所示。
+**图1** 进度条通知效果示意图

## 接口说明
-[isSupportTemplate()](../reference/apis/js-apis-notificationManager.md#notificationmanagerissupporttemplate)是查询模板是否支持接口,目前仅支持进度条模板。
+[`isSupportTemplate()`](../reference/apis/js-apis-notificationManager.md#notificationmanagerissupporttemplate)是查询模板是否支持接口,目前仅支持进度条模板。
| **接口名** | **描述** |
| -------- | -------- |
@@ -32,16 +33,17 @@
```ts
notificationManager.isSupportTemplate('downloadTemplate').then((data) => {
console.info(`[ANS] isSupportTemplate success`);
+ console.info('Succeeded in supporting download template notification.');
let isSupportTpl: boolean = data; // isSupportTpl的值为true表示支持支持downloadTemplate模板类通知,false表示不支持
// ...
}).catch((err) => {
- console.error(`[ANS] isSupportTemplate failed, code is ${err.code}, message is ${err.message}`);
+ console.error(`Failed to support download template notification. Code is ${err.code}, message is ${err.message}`);
});
```
-
+
> **说明:**
> 查询系统支持进度条模板后,再进行后续的步骤操作。
-
+
4. 构造进度条模板对象,并发布通知。
```ts
@@ -65,9 +67,9 @@
// 发布通知
notificationManager.publish(notificationRequest, (err) => {
if (err) {
- console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
+ console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`);
return;
}
- console.info(`[ANS] publish success `);
+ console.info('Succeeded in publishing notification.');
});
```
diff --git a/zh-cn/application-dev/notification/text-notification.md b/zh-cn/application-dev/notification/text-notification.md
index cd36636bb4fc749bc7db374df6a0c319f3df88c2..7685eecf65bb5030d7c2615d57f8c91e0d9713b2 100644
--- a/zh-cn/application-dev/notification/text-notification.md
+++ b/zh-cn/application-dev/notification/text-notification.md
@@ -3,8 +3,7 @@
基础类型通知主要应用于发送短信息、提示信息、广告推送等,支持普通文本类型、长文本类型、多行文本类型和图片类型。
-
- **表1** 基础类型通知中的内容分类
+**表1** 基础类型通知中的内容分类
| 类型 | 描述 |
| -------- | -------- |
@@ -13,8 +12,7 @@
| NOTIFICATION_CONTENT_MULTILINE | 多行文本类型。 |
| NOTIFICATION_CONTENT_PICTURE | 图片类型。 |
-
-目前系统仅通知栏订阅了通知,将通知显示在通知栏里。基础类型通知呈现效果示意图如下所示。
+目前,系统仅支持通知栏订阅通知,将通知显示在通知栏中。基本类型通知的效果示意如下图所示。
**图1** 基础类型通知呈现效果示意图

@@ -22,7 +20,7 @@
## 接口说明
-通知发布接口如下表所示,不同发布类型通知由[NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest)的字段携带不同的信息。
+通知发布接口如下表所示,不同发布类型通知由[NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest)的字段携带不同的信息。
| **接口名** | **描述** |
| -------- | -------- |
@@ -48,21 +46,21 @@
let notificationRequest: notificationManager.NotificationRequest = {
id: 1,
content: {
- contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // 普通文本类型通知
- normal: {
- title: 'test_title',
- text: 'test_text',
- additionalText: 'test_additionalText',
- }
+ contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // 普通文本类型通知
+ normal: {
+ title: 'test_title',
+ text: 'test_text',
+ additionalText: 'test_additionalText',
+ }
}
- }
+ };
notificationManager.publish(notificationRequest, (err) => {
- if (err) {
- console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
- return;
- }
- console.info(`[ANS] publish success.`);
+ if (err) {
+ console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info('Succeeded in publishing notification.');
});
```
@@ -74,25 +72,25 @@
let notificationRequest: notificationManager.NotificationRequest = {
id: 1,
content: {
- contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, // 长文本类型通知
- longText: {
- title: 'test_title',
- text: 'test_text',
- additionalText: 'test_additionalText',
- longText: 'test_longText',
- briefText: 'test_briefText',
- expandedTitle: 'test_expandedTitle',
- }
+ contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, // 长文本类型通知
+ longText: {
+ title: 'test_title',
+ text: 'test_text',
+ additionalText: 'test_additionalText',
+ longText: 'test_longText',
+ briefText: 'test_briefText',
+ expandedTitle: 'test_expandedTitle',
+ }
}
- }
+ };
// 发布通知
notificationManager.publish(notificationRequest, (err) => {
- if (err) {
- console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
- return;
- }
- console.info(`[ANS] publish success.`);
+ if (err) {
+ console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info('Succeeded in publishing notification.');
});
```
@@ -104,24 +102,24 @@
let notificationRequest: notificationManager.NotificationRequest = {
id: 1,
content: {
- contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_MULTILINE, // 多行文本类型通知
- multiLine: {
- title: 'test_title',
- text: 'test_text',
- briefText: 'test_briefText',
- longTitle: 'test_longTitle',
- lines: ['line_01', 'line_02', 'line_03', 'line_04'],
- }
+ contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_MULTILINE, // 多行文本类型通知
+ multiLine: {
+ title: 'test_title',
+ text: 'test_text',
+ briefText: 'test_briefText',
+ longTitle: 'test_longTitle',
+ lines: ['line_01', 'line_02', 'line_03', 'line_04'],
+ }
}
- }
+ };
// 发布通知
notificationManager.publish(notificationRequest, (err) => {
if (err) {
- console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
- return;
+ console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`);
+ return;
}
- console.info(`[ANS] publish success`);
+ console.info('Succeeded in publishing notification.');
});
```
@@ -132,27 +130,27 @@
```ts
let imagePixelMap: PixelMap = undefined; // 需要获取图片PixelMap信息
let notificationRequest: notificationManager.NotificationRequest = {
- id: 1,
- content: {
- contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_PICTURE,
- picture: {
- title: 'test_title',
- text: 'test_text',
- additionalText: 'test_additionalText',
- briefText: 'test_briefText',
- expandedTitle: 'test_expandedTitle',
- picture: imagePixelMap
- }
+ id: 1,
+ content: {
+ contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_PICTURE,
+ picture: {
+ title: 'test_title',
+ text: 'test_text',
+ additionalText: 'test_additionalText',
+ briefText: 'test_briefText',
+ expandedTitle: 'test_expandedTitle',
+ picture: imagePixelMap
}
- }
+ }
+ };
// 发布通知
notificationManager.publish(notificationRequest, (err) => {
- if (err) {
- console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
- return;
- }
- console.info(`[ANS] publish success.`);
+ if (err) {
+ console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info('Succeeded in publishing notification.');
});
```
diff --git a/zh-cn/application-dev/quick-start/arkts-prop.md b/zh-cn/application-dev/quick-start/arkts-prop.md
index 4e1ae2dc60e9216b3d3adb4f7ef65f92d46bd1a3..f9239a4d54452cfc936d28d2e8eeb4d076b769b7 100644
--- a/zh-cn/application-dev/quick-start/arkts-prop.md
+++ b/zh-cn/application-dev/quick-start/arkts-prop.md
@@ -15,17 +15,17 @@
- \@Prop变量允许在本地修改,但修改后的变化不会同步回父组件。
-- 当父组件中的数据源更改时,与之相关的\@Prop装饰的变量都会自动更新。如果子组件已经在本地修改了\@Prop装饰的相关变量值,而在父组件中对应的\@State装饰的变量被修改后,子组件本地修改的\@Prop装饰的相关变量值将被覆盖。
+- 当数据源更改时,\@Prop装饰的变量都会更新,并且会覆盖本地所有更改。因此,数值的同步是父组件到子组件(所属组件),子组件数值的变化不会同步到父组件。
## 装饰器使用规则说明
-| \@Prop变量装饰器 | 说明 |
-| ----------- | ---------------------------------------- |
-| 装饰器参数 | 无 |
-| 同步类型 | 单向同步:对父组件状态变量值的修改,将同步给子组件\@Prop装饰的变量,子组件\@Prop变量的修改不会同步到父组件的状态变量上 |
-| 允许装饰的变量类型 | string、number、boolean、enum类型。 不支持any,不允许使用undefined和null。 必须指定类型。 在父组件中,传递给\@Prop装饰的值不能为undefined或者null,反例如下所示。 CompA ({ aProp: undefined }) CompA ({ aProp: null }) \@Prop和[数据源](arkts-state-management-overview.md#基本概念)类型需要相同,有以下三种情况(数据源以\@State为例): - \@Prop装饰的变量和父组件状态变量类型相同,即\@Prop : S和\@State : S,示例请参考[父组件@State到子组件@Prop简单数据类型同步](#父组件state到子组件prop简单数据类型同步)。 - 当父组件的状态变量为数组时,\@Prop装饰的变量和父组件状态变量的数组项类型相同,即\@Prop : S和\@State : Array<S>,示例请参考[父组件@State数组中的项到子组件@Prop简单数据类型同步](#父组件state数组项到子组件prop简单数据类型同步); - 当父组件状态变量为Object或者class时,\@Prop装饰的变量和父组件状态变量的属性类型相同,即\@Prop : S和\@State : { propA: S },示例请参考[从父组件中的@State类对象属性到@Prop简单类型的同步](#从父组件中的state类对象属性到prop简单类型的同步)。 |
-| 被装饰变量的初始值 | 允许本地初始化。 |
+| \@Prop变量装饰器 | 说明 |
+| ------------------ | ------------------------------------------------------------ |
+| 装饰器参数 | 无 |
+| 同步类型 | 单向同步:对父组件状态变量值的修改,将同步给子组件\@Prop装饰的变量,子组件\@Prop变量的修改不会同步到父组件的状态变量上。嵌套类型的场景请参考[观察变化](#观察变化)。 |
+| 允许装饰的变量类型 | Objec、class、string、number、boolean、enum类型,以及这些类型的数组。 不支持any,不支持简单类型和复杂类型的联合类型,不允许使用undefined和null。 必须指定类型。 **说明** : 不支持Length、ResourceStr、ResourceColor类型,Length,ResourceStr、ResourceColor为简单类型和复杂类型的联合类型。 在父组件中,传递给\@Prop装饰的值不能为undefined或者null,反例如下所示。 CompA ({ aProp: undefined }) CompA ({ aProp: null }) \@Prop和[数据源](arkts-state-management-overview.md#基本概念)类型需要相同,有以下三种情况: - \@Prop装饰的变量和\@State以及其他装饰器同步时双方的类型必须相同,示例请参考[父组件@State到子组件@Prop简单数据类型同步](#父组件state到子组件prop简单数据类型同步)。 - \@Prop装饰的变量和\@State以及其他装饰器装饰的数组的项同步时 ,\@Prop的类型需要和\@State装饰的数组的数组项相同,比如\@Prop : T和\@State : Array<T>,示例请参考[父组件@State数组中的项到子组件@Prop简单数据类型同步](#父组件state数组项到子组件prop简单数据类型同步); - 当父组件状态变量为Object或者class时,\@Prop装饰的变量和父组件状态变量的属性类型相同,示例请参考[从父组件中的@State类对象属性到@Prop简单类型的同步](#从父组件中的state类对象属性到prop简单类型的同步)。 |
+| 被装饰变量的初始值 | 允许本地初始化。 |
## 变量的传递/访问规则说明
@@ -50,24 +50,89 @@
\@Prop装饰的数据可以观察到以下变化。
-- 当装饰的类型是允许的类型,即string、number、boolean、enum类型都可以观察到的赋值变化;
+- 当装饰的类型是允许的类型,即Object、class、string、number、boolean、enum类型都可以观察到的赋值变化。
```ts
// 简单类型
@Prop count: number;
// 赋值的变化可以被观察到
this.count = 1;
+ // 复杂类型
+ @Prop count: Model;
+ // 可以观察到赋值的变化
+ this.title = new Model('Hi');
```
+当装饰的类型是Object或者class复杂类型时,可以观察到第一层的属性的变化,属性即Object.keys(observedObject)返回的所有属性;
+
+```
+class ClassA {
+ public value: string;
+ constructor(value: string) {
+ this.value = value;
+ }
+}
+class Model {
+ public value: string;
+ public a: ClassA;
+ constructor(value: string, a: ClassA) {
+ this.value = value;
+ this.a = a;
+ }
+}
+
+@Prop title: Model;
+// 可以观察到第一层的变化
+this.title.value = 'Hi'
+// 观察不到第二层的变化
+this.title.a.value = 'ArkUi'
+```
+
+对于嵌套场景,如果装饰的class是被\@Observed装饰的,可以观察到class属性的变化。
+
+```
+@Observed
+class ClassA {
+ public value: string;
+ constructor(value: string) {
+ this.value = value;
+ }
+}
+class Model {
+ public value: string;
+ public a: ClassA;
+ constructor(value: string, a: ClassA) {
+ this.value = value;
+ this.a = a;
+ }
+}
+@Prop title: Model;
+// 可以观察到第一层的变化
+this.title.value = 'Hi'
+// 可以观察到ClassA属性的变化,因为ClassA被@Observed装饰this.title.a.value = 'ArkUi'
+```
+
+当装饰的类型是数组的时候,可以观察到数组本身的赋值、添加、删除和更新。
+
+```
+// @State装饰的对象为数组时
+@Prop title: string[]
+// 数组自身的赋值可以观察到
+this.title = ['1']
+// 数组项的赋值可以观察到
+this.title[0] = '2'
+// 删除数组项可以观察到
+this.title.pop()
+// 新增数组项可以观察到
+this.title.push('3')
+```
+
对于\@State和\@Prop的同步场景:
- 使用父组件中\@State变量的值初始化子组件中的\@Prop变量。当\@State变量变化时,该变量值也会同步更新至\@Prop变量。
-
- \@Prop装饰的变量的修改不会影响其数据源\@State装饰变量的值。
-
- 除了\@State,数据源也可以用\@Link或\@Prop装饰,对\@Prop的同步机制是相同的。
-
-- 数据源和\@Prop变量的类型需要相同。
+- 数据源和\@Prop变量的类型需要相同,\@Prop允许简单类型和class类型。
### 框架行为
@@ -254,6 +319,8 @@ struct Index {
如果图书馆有一本图书和两位用户,每位用户都可以将图书标记为已读,此标记行为不会影响其它读者用户。从代码角度讲,对\@Prop图书对象的本地更改不会同步给图书馆组件中的\@State图书对象。
+在此示例中,图书类可以使用\@Observed装饰器,但不是必须的,只有在嵌套结构时需要此装饰器。这一点我们会在[从父组件中的\@State数组项到\@Prop class类型的同步](#从父组件中的\@State数组项到\@Prop class类型的同步)说明。
+
```ts
class Book {
@@ -269,14 +336,14 @@ class Book {
@Component
struct ReaderComp {
- @Prop title: string;
- @Prop readIt: boolean;
+ @Prop book: Book;
build() {
Row() {
- Text(this.title)
- Text(`... ${this.readIt ? 'I have read' : 'I have not read it'}`)
- .onClick(() => this.readIt = true)
+ Text(this.book.title)
+ Text(`...has${this.book.pages} pages!`)
+ Text(`...${this.book.readIt ? "I have read" : 'I have not read it'}`)
+ .onClick(() => this.book.readIt = true)
}
}
}
@@ -288,13 +355,99 @@ struct Library {
build() {
Column() {
- ReaderComp({ title: this.book.title, readIt: this.book.readIt })
- ReaderComp({ title: this.book.title, readIt: this.book.readIt })
+ ReaderComp({ book: this.book })
+ ReaderComp({ book: this.book })
}
}
}
```
+### 从父组件中的\@State数组项到\@Prop class类型的同步
+
+在下面的示例中,更改了\@State 修饰的allBooks数组中Book对象上的属性,但点击“Mark read for everyone”无反应。这是因为该属性是第二层的嵌套属性,\@State装饰器只能观察到第一层属性,不会观察到此属性更改,所以框架不会更新ReaderComp。
+
+```
+let nextId: number = 1;
+
+// @Observed
+class Book {
+ public id: number;
+ public title: string;
+ public pages: number;
+ public readIt: boolean = false;
+
+ constructor(title: string, pages: number) {
+ this.id = nextId++;
+ this.title = title;
+ this.pages = pages;
+ }
+}
+
+@Component
+struct ReaderComp {
+ @Prop book: Book;
+
+ build() {
+ Row() {
+ Text(this.book.title)
+ Text(`...has${this.book.pages} pages!`)
+ Text(`...${this.book.readIt ? "I have read" : 'I have not read it'}`)
+ .onClick(() => this.book.readIt = true)
+ }
+ }
+}
+
+@Entry
+@Component
+struct Library {
+ @State allBooks: Book[] = [new Book("100 secrets of C++", 765), new Book("Effective C++", 651), new Book("The C++ programming language", 1765)];
+
+ build() {
+ Column() {
+ Text('library`s all time favorite')
+ ReaderComp({ book: this.allBooks[2] })
+ Divider()
+ Text('Books on loaan to a reader')
+ ForEach(this.allBooks, book => {
+ ReaderComp({ book: book })
+ },
+ book => book.id)
+ Button('Add new')
+ .onClick(() => {
+ this.allBooks.push(new Book("The C++ Standard Library", 512));
+ })
+ Button('Remove first book')
+ .onClick(() => {
+ this.allBooks.shift();
+ })
+ Button("Mark read for everyone")
+ .onClick(() => {
+ this.allBooks.forEach((book) => book.readIt = true)
+ })
+ }
+ }
+}
+```
+
+ 需要使用\@Observed装饰class Book,Book的属性将被观察。 需要注意的是,\@Prop在子组件装饰的状态变量和父组件的数据源是单向同步关系,即ReaderComp中的\@Prop book的修改不会同步给父组件Library。而父组件只会在数值有更新的时候(和上一次状态的对比),才会触发UI的重新渲染。
+
+```
+@Observed
+class Book {
+ public id: number;
+ public title: string;
+ public pages: number;
+ public readIt: boolean = false;
+
+ constructor(title: string, pages: number) {
+ this.id = nextId++;
+ this.title = title;
+ this.pages = pages;
+ }
+}
+```
+
+\@Observed装饰的类的实例会被不透明的代理对象包装,此代理可以检测到包装对象内的所有属性更改。如果发生这种情况,此时,代理通知\@Prop,\@Prop对象值被更新。
### \@Prop本地初始化不和父组件同步
diff --git a/zh-cn/application-dev/quick-start/figures/application_details.jpg b/zh-cn/application-dev/quick-start/figures/application_details.jpg
index 17b7172bc5bea2f4e16af8d385834930ca4bf49f..6447a151123bcf4f1e45e72f0318430e4aac18cf 100644
Binary files a/zh-cn/application-dev/quick-start/figures/application_details.jpg and b/zh-cn/application-dev/quick-start/figures/application_details.jpg differ
diff --git a/zh-cn/application-dev/quick-start/module-configuration-file.md b/zh-cn/application-dev/quick-start/module-configuration-file.md
index 4e8a14b9d86ffefd78b2caec4eb2c8570aa9e2e0..6ff225887649f768bc1e922d0f0558527bfc40a7 100644
--- a/zh-cn/application-dev/quick-start/module-configuration-file.md
+++ b/zh-cn/application-dev/quick-start/module-configuration-file.md
@@ -228,66 +228,6 @@ deviceTypes示例:
abilities标签描述UIAbility组件的配置信息,标签值为数组类型,该标签下的配置只对当前UIAbility生效。
-**OpenHarmony中不允许应用隐藏入口图标**
-
-OpenHarmony系统对无图标应用严格管控。如果HAP中没有配置入口图标,那么系统将应用app.json中的icon作为入口图标,并显示在桌面上。
-用户点击该图标,将跳转到设置应用管理中对应的应用详情页面(图1)中。
-如果应用想要隐藏入口图标,需要配置AllowAppDesktopIconHide应用特权,具体配置方式参考[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md)。
-
-**场景说明:** 该功能能防止一些恶意应用,故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户的手机安全
-
-**入口图标的设置:** 需要在配置文件(module.json5)中abilities配置下设置icon,label以及skills,而且skills的配置下的必须同时包含“ohos.want.action.home” 和 “entity.system.home”:
-```
-{
- "module":{
-
- ...
-
- "abilities": [{
- "icon": "$media:icon",
- "label": "Login",
- "skills": [{
- "actions": ["ohos.want.action.home"],
- "entities": ["entity.system.home"],
- "uris": []
- }]
- }],
- ...
-
- }
-}
-```
-
-**入口图标及入口标签的显示规则**
-* HAP中包含UIAbility
- * 配置文件(module.json5)中abilities配置中设置了入口图标
- * 该应用没有隐藏图标的特权
- * 显示桌面图标为该UIAbility配置的图标
- * 显示桌面Label为该UIAbility配置的Label(如果没有配置Label,返回包名)
- * 显示组件名为该UIAbility的组件名
- * 用户点击该桌面图标,页面跳转到该UIAbility首页
- * 该应用具有隐藏图标的特权
- * 桌面查询时不返回应用信息,不会在桌面上显示对应的图标。
- * 配置文件(module.json5)中abilities配置中未设置入口图标
- * 该应用没有隐藏图标的特权
- * 显示桌面图标为app配置下的图标(app.json中icon为必填项)
- * 显示桌面Label为app配置下的label(app.json中label为必填项)
- * 用户点击该桌面图标,页面跳转到该应用的详情页面(图1)
- * 该应用具有隐藏图标的特权
- * 桌面查询时不返回应用信息,不会在桌面上显示对应的图标。
-* HAP中不包含UIAbility
- * 该应用没有隐藏图标的特权
- * 显示桌面图标为app配置下的图标(app.json中icon为必填项)
- * 显示桌面Label为app配置下的label(app.json中label为必填项)
- * 用户点击该桌面图标,页面跳转到该应用的详情页面(图1)
- * 该应用具有隐藏图标的特权
- * 桌面查询时不返回应用信息,不会在桌面上显示对应的图标。
-
-应用的详情页例图
-
-
-
-
**表6** **abilities标签说明**
| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
diff --git a/zh-cn/application-dev/quick-start/module-structure.md b/zh-cn/application-dev/quick-start/module-structure.md
index 191ff67620e00caa0c9bdd2037b4438e72ed2d65..43fcb6291a53377069b13798978ad01b4a6a7989 100644
--- a/zh-cn/application-dev/quick-start/module-structure.md
+++ b/zh-cn/application-dev/quick-start/module-structure.md
@@ -191,15 +191,46 @@ metadata对象示例:
## abilities对象的内部结构
-**OpenHarmony中不允许应用隐藏入口图标**
+**表8** **abilities对象的内部结构说明**
+
+| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
+| -------- | -------- | -------- | -------- |
+| process | 运行应用程序或Ability的进程名称。如果在deviceConfig标记中配置了进程,则应用程序的所有能力都在此进程中运行。您还可以为特定能力设置流程属性,以便该能力可以在此流程中运行。如果此属性设置为与其他应用程序相同的进程名称,则所有这些应用程序可以在同一进程中运行,前提是他们具有相同的联合用户ID和相同的签名。该标签最大字节数为31个字节。 | 字符串 | 可缺省,缺省值为空。 |
+| name | 标识Ability名称。取值可采用反向域名方式表示,由包名和类名组成,如"com.example.myapplication.EntryAbility";也可采用"."开头的类名方式表示,如".EntryAbility"。 Ability的名称,需在一个应用的范围内保证唯一。说明:在使用DevEco Studio新建项目时,默认生成首个Ability的配置,即"config.json"中"EntryAbility"的配置。如使用其他IDE工具,可自定义名称。该标签最大长度为127个字节。 | 字符串 | 不可缺省 |
+| description | 标识对Ability的描述。取值可以是描述性内容,也可以是对描述性内容的资源索引,以支持多语言。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
+| icon | 标识Ability图标资源文件的索引。取值示例:$media:ability_icon。如果在该Ability的skills属性中,actions的取值包含 "action.system.home",entities取值中包含"entity.system.home",则该Ability的icon将同时作为应用的icon。如果存在多个符合条件的Ability,则取位置靠前的Ability的icon作为应用的icon。 说明:应用的"icon"和"label"是用户可感知配置项,需要区别于当前所有已有的应用"icon"或"label"(至少有一个不同)。 | 字符串 | 可缺省,缺省值为空。 |
+| label | 标识Ability对用户显示的名称。取值是对该名称的资源索引,支持多语言,例:$string:ability_label。如果在该Ability的skills属性中,actions的取值包含 "action.system.home",entities取值中包含"entity.system.home",则该Ability的label将同时作为应用的label。如果存在多个符合条件的Ability,则取位置靠前的Ability的label作为应用的label。 说明: 应用的"icon"和"label"是用户可感知配置项,需要区别于当前所有已有的应用"icon"或"label"(至少有一个不同)。该标签为资源文件中定义的字符串的引用,或以"{}"包括的字符串。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
+| uri | 标识Ability的统一资源标识符。该标签最大长度为255个字节。 | 字符串 | 可缺省,对于data类型的Ability不可缺省。 |
+| launchType | 标识Ability的启动模式,支持"standard"和"singleton"两种模式: standard:表示该Ability可以有多实例。该模式适用于大多数应用场景。 singleton:表示该Ability在所有任务栈中仅可以有一个实例。例如,具有全局唯一性的呼叫来电界面即采用"singleton"模式。该标签仅适用于默认设备、平板、智慧屏、车机、智能穿戴。 | 字符串 | 可缺省,缺省值为"singleton"。 |
+| visible | 标识Ability是否可以被其他应用调用。 true:可以被其他应用调用。 false:不能被其他应用调用。 | 布尔类型 | 可缺省,缺省值为"false"。 |
+| permissions | 标识其他应用的Ability调用此Ability时需要申请的权限集合,一个数组元素为一个权限名称。通常采用反向域名格式(最大255字节),取值为系统预定义的权限。 | 字符串数组 | 可缺省,缺省值为空。 |
+|skills | 标识Ability能够接收的want的特征。 | 对象数组 | 可缺省,缺省值为空。 |
+| deviceCapability | 标识Ability运行时要求设备具有的能力,采用字符串数组的格式表示。该标签为数组,支持最多配置512个元素,单个元素最大字节长度为64。 | 字符串数组 | 可缺省,缺省值为空。 |
+| metaData | 元数据。 | 对象 | 可缺省,缺省值为空。 |
+| type | 标识Ability的类型。取值范围如下: page:表示基于Page模板开发的FA,用于提供与用户交互的能力。 service:表示基于Service模板开发的PA,用于提供后台运行任务的能力。 data:表示基于Data模板开发的PA,用于对外部提供统一的数据访问对象。 CA:表示支持其他应用以窗口方式调起该Ability。 | 字符串 | 不可缺省。 |
+| orientation | 标识该Ability的显示模式。该标签仅适用于page类型的Ability。取值范围如下: unspecified:由系统自动判断显示方向。 landscape:横屏模式。 portrait:竖屏模式。 followRecent:跟随栈中最近的应用。 | 字符串 | 可缺省,缺省值为"unspecified"。 |
+| backgroundModes | 标识后台服务的类型,可以为一个服务配置多个后台服务类型。该标签仅适用于service类型的Ability。取值范围如下: dataTransfer:通过网络/对端设备进行数据下载、备份、分享、传输等业务。 audioPlayback:音频输出业务。 audioRecording:音频输入业务。 pictureInPicture:画中画、小窗口播放视频业务。 voip:音视频电话、VOIP业务。 location:定位、导航业务。 bluetoothInteraction:蓝牙扫描、连接、传输业务。 wifiInteraction:WLAN扫描、连接、传输业务。 screenFetch:录屏、截屏业务。 multiDeviceConnection:多设备互联业务 | 字符串数组 | 可缺省,缺省值为空。 |
+| grantPermission | 指定是否可以向Ability内任何数据授予权限。 | 布尔值 | 可缺省,缺省值为空。 |
+| readPermission | 标识读取Ability的数据所需的权限。该标签仅适用于data类型的Ability。取值为长度不超过255字节的字符串。该标签仅适用于默认设备、平板、智慧屏、车机、智能穿戴。 | 字符串 | 可缺省,缺省为空。 |
+| writePermission | 标识向Ability写数据所需的权限。该标签仅适用于data类型的Ability。取值为长度不超过255字节的字符串。 | 字符串 | 可缺省,缺省为空。 |
+| configChanges | 标识Ability关注的系统配置集合。当已关注的配置发生变更后,Ability会收到onConfigurationUpdated回调。取值范围: mcc:表示IMSI移动设备国家/地区代码(MCC)发生变更。典型场景:检测到SIM并更新MCC。 mnc:IMSI移动设备网络代码(MNC)发生变更。典型场景:检测到SIM并更新MNC。 locale:表示语言区域发生变更。典型场景:用户已为设备文本的文本显示选择新的语言类型。 layout:表示屏幕布局发生变更。典型场景:当前有不同的显示形态都处于活跃状态。 fontSize:表示字号发生变更。典型场景:用户已设置新的全局字号。 orientation:表示屏幕方向发生变更。典型场景:用户旋转设备。 density:表示显示密度发生变更。典型场景:用户可能指定不同的显示比例,或当前有不同的显示形态同时处于活跃状态。 size:显示窗口大小发生变更。 smallestSize:显示窗口较短边的边长发生变更。 colorMode:颜色模式发生变更。 | 字符串数组 | 可缺省,缺省为空。 |
+| mission | 标识Ability指定的任务栈。该标签仅适用于page类型的Ability。默认情况下应用中所有Ability同属一个任务栈。 | 字符串 | 可缺省,缺省为应用的包名。 |
+| targetAbility | 标识当前Ability重用的目标Ability。该标签仅适用于page类型的Ability。如果配置了targetAbility属性,则当前Ability(即别名Ability)的属性中仅name、icon、label、visible、permissions、skills生效,其他属性均沿用targetAbility中的属性值。目标Ability必须与别名Ability在同一应用中,且在配置文件中目标Ability必须在别名之前进行声明。 | 字符串 | 可缺省,缺省值为空。表示当前Ability不是一个别名Ability。 |
+| formsEnabled | 标识Ability是否支持卡片(forms)功能。该标签仅适用于page类型的Ability。 true:支持卡片能力。 false:不支持卡片能力。 | 布尔值 | 可缺省,缺省值为false。 |
+| forms | 标识服务卡片的属性。该标签仅当formsEnabled为"true"时,才能生效。 | 对象数组 | 可缺省,缺省值为空。 |
+| srcLanguage | Ability开发语言的类型,开发者创建工程时由开发者手动选择开发语言。 | 字符串 | 可缺省,缺省值为“js”。 |
+| srcPath | 该标签标识Ability对应的JS组件代码路径,该标签最大长度为127字节。 | 字符串 | 不可缺省。 |
+| uriPermission | 标识该Ability有权访问的应用程序数据。此属性由模式和路径子属性组成。此属性仅对类型提供者的能力有效。 | 对象 | 可缺省,缺省值为空。 |
+| startWindowIcon | 标识该Ability启动页面图标资源文件的索引。该标签仅适用于page类型的Ability。取值示例:$media:icon。 | 字符串 | 可缺省,缺省值为空。 |
+| startWindowBackground | 标识该Ability启动页面背景颜色资源文件的索引。该标签仅适用于page类型的Ability。取值示例:$color:red。 | 字符串 | 可缺省,缺省值为空。 |
+| removeMissionAfterTerminate | 该标签标识Ability销毁后是否从任务列表中移除任务。该标签仅适用于page类型的Ability。true表示销毁后移除任务, false表示销毁后不移除任务。 | 布尔值 | 可缺省,缺省值为false。 |
-OpenHarmony系统对无图标应用严格管控。如果HAP中没有配置入口图标,那么系统会给该应用创建一个默认的图标显示在桌面上;
-用户点击该图标,将跳转到Settings的应用管理中对应的应用详情页面(图1)中。
-如果应用想要隐藏入口图标,需要配置AllowAppDesktopIconHide应用特权,具体配置方式参考[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md)。
-**场景说明:** 该功能能防止一些恶意应用,故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户的手机安全
+**OpenHarmony中不允许应用隐藏入口图标**
+
+OpenHarmony系统对无图标应用严格管控,防止一些恶意应用故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户的手机安全。
-**入口图标的设置:** 需要在配置文件(config.json)中abilities配置下设置icon,label以及skills,而且skills的配置下必须同时包含“ohos.want.action.home” 和 “entity.system.home”:
+**入口图标的设置:** 需要在配置文件(config.json)中abilities配置下设置icon,label以及skills,而且skills的配置下必须同时包含“ohos.want.action.home” 和 “entity.system.home”。
```
{
"module":{
@@ -222,72 +253,32 @@ OpenHarmony系统对无图标应用严格管控。如果HAP中没有配置入口
}
```
-**入口图标及入口标签的显示规则**
+如果应用确需隐藏入口图标,需要配置AllowAppDesktopIconHide应用特权,具体配置方式参考[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md)。详细的入口图标及入口标签的显示规则如下。
* HAP中包含Page类型的PageAbility
* 配置文件(config.json)中abilities配置中设置了入口图标
* 该应用没有隐藏图标的特权
- * 显示桌面图标为该PageAbility配置的图标
- * 显示桌面Label为该PageAbility配置的Label(如果没有配置Label,返回包名)
- * 显示组件名为该PageAbility的组件名
- * 用户点击该桌面图标,页面跳转到该PageAbility首页
+ * 系统将使用该PageAbility配置的icon作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到该PageAbility首页。
+ * 系统将使用该PageAbility配置的label作为入口标签,并显示在桌面上(如果没有配置label,返回包名)。
* 该应用具有隐藏图标的特权
- * 桌面查询时不返回应用信息,不会在桌面上显示对应的图标。
+ * 桌面查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
* 配置文件(config.json)中abilities配置中未设置入口图标
* 该应用没有隐藏图标的特权
- * 显示桌面图标为系统默认图标
- * 显示桌面Label为该应用的包名
- * 用户点击该桌面图标,页面跳转到该应用的详情页面(图1)
+ * 系统将使用系统默认图标作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到应用管理中对应的应用详情页面(参考下图)。
+ * 系统将使用应用的包名作为入口标签,并显示在桌面上。
* 该应用具有隐藏图标的特权
- * 桌面查询时不返回应用信息,不会在桌面上显示对应的图标。
+ * 桌面查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
* HAP中不包含Page类型的PageAbility
* 该应用没有隐藏图标的特权
- * 显示桌面图标为系统默认图标
- * 显示桌面Label为该应用的包名
- * 用户点击该桌面图标,页面跳转到该应用的详情页面(图1)
+ * 系统将使用系统默认图标作为入口图标,并显示在桌面上。用户点击该图标,页面跳转到应用管理中对应的应用详情页面(参考下图)。
+ * 系统将使用应用的包名作为入口标签,并显示在桌面上。
* 该应用具有隐藏图标的特权
- * 桌面查询时不返回应用信息,不会在桌面上显示对应的图标。
+ * 桌面查询时不返回应用信息,不会在桌面上显示对应的入口图标和标签。
-注:应用详情页面(图1)中显示的label可能与桌面上显示的不同。如果非Page类型的PageAbility配置了入口图标和label,那么详情页中显示的即为配置的。
-
-图1
+**图1** 应用的详情页示意图

-
-**表8** **abilities对象的内部结构说明**
-
-| 属性名称 | 含义 | 数据类型 | 是否可缺省 |
-| -------- | -------- | -------- | -------- |
-| process | 运行应用程序或Ability的进程名称。如果在deviceConfig标记中配置了进程,则应用程序的所有能力都在此进程中运行。您还可以为特定能力设置流程属性,以便该能力可以在此流程中运行。如果此属性设置为与其他应用程序相同的进程名称,则所有这些应用程序可以在同一进程中运行,前提是他们具有相同的联合用户ID和相同的签名。该标签最大字节数为31个字节。 | 字符串 | 可缺省,缺省值为空。 |
-| name | 标识Ability名称。取值可采用反向域名方式表示,由包名和类名组成,如"com.example.myapplication.EntryAbility";也可采用"."开头的类名方式表示,如".EntryAbility"。 Ability的名称,需在一个应用的范围内保证唯一。说明:在使用DevEco Studio新建项目时,默认生成首个Ability的配置,即"config.json"中"EntryAbility"的配置。如使用其他IDE工具,可自定义名称。该标签最大长度为127个字节。 | 字符串 | 不可缺省 |
-| description | 标识对Ability的描述。取值可以是描述性内容,也可以是对描述性内容的资源索引,以支持多语言。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
-| icon | 标识Ability图标资源文件的索引。取值示例:$media:ability_icon。如果在该Ability的skills属性中,actions的取值包含 "action.system.home",entities取值中包含"entity.system.home",则该Ability的icon将同时作为应用的icon。如果存在多个符合条件的Ability,则取位置靠前的Ability的icon作为应用的icon。 说明:应用的"icon"和"label"是用户可感知配置项,需要区别于当前所有已有的应用"icon"或"label"(至少有一个不同)。 | 字符串 | 可缺省,缺省值为空。 |
-| label | 标识Ability对用户显示的名称。取值是对该名称的资源索引,支持多语言,例:$string:ability_label。如果在该Ability的skills属性中,actions的取值包含 "action.system.home",entities取值中包含"entity.system.home",则该Ability的label将同时作为应用的label。如果存在多个符合条件的Ability,则取位置靠前的Ability的label作为应用的label。 说明: 应用的"icon"和"label"是用户可感知配置项,需要区别于当前所有已有的应用"icon"或"label"(至少有一个不同)。该标签为资源文件中定义的字符串的引用,或以"{}"包括的字符串。该标签最大长度为255个字节。 | 字符串 | 可缺省,缺省值为空。 |
-| uri | 标识Ability的统一资源标识符。该标签最大长度为255个字节。 | 字符串 | 可缺省,对于data类型的Ability不可缺省。 |
-| launchType | 标识Ability的启动模式,支持"standard"和"singleton"两种模式: standard:表示该Ability可以有多实例。该模式适用于大多数应用场景。 singleton:表示该Ability在所有任务栈中仅可以有一个实例。例如,具有全局唯一性的呼叫来电界面即采用"singleton"模式。该标签仅适用于默认设备、平板、智慧屏、车机、智能穿戴。 | 字符串 | 可缺省,缺省值为"singleton"。 |
-| visible | 标识Ability是否可以被其他应用调用。 true:可以被其他应用调用。 false:不能被其他应用调用。 | 布尔类型 | 可缺省,缺省值为"false"。 |
-| permissions | 标识其他应用的Ability调用此Ability时需要申请的权限集合,一个数组元素为一个权限名称。通常采用反向域名格式(最大255字节),取值为系统预定义的权限。 | 字符串数组 | 可缺省,缺省值为空。 |
-|skills | 标识Ability能够接收的want的特征。 | 对象数组 | 可缺省,缺省值为空。 |
-| deviceCapability | 标识Ability运行时要求设备具有的能力,采用字符串数组的格式表示。该标签为数组,支持最多配置512个元素,单个元素最大字节长度为64。 | 字符串数组 | 可缺省,缺省值为空。 |
-| metaData | 元数据。 | 对象 | 可缺省,缺省值为空。 |
-| type | 标识Ability的类型。取值范围如下: page:表示基于Page模板开发的FA,用于提供与用户交互的能力。 service:表示基于Service模板开发的PA,用于提供后台运行任务的能力。 data:表示基于Data模板开发的PA,用于对外部提供统一的数据访问对象。 CA:表示支持其他应用以窗口方式调起该Ability。 | 字符串 | 不可缺省。 |
-| orientation | 标识该Ability的显示模式。该标签仅适用于page类型的Ability。取值范围如下: unspecified:由系统自动判断显示方向。 landscape:横屏模式。 portrait:竖屏模式。 followRecent:跟随栈中最近的应用。 | 字符串 | 可缺省,缺省值为"unspecified"。 |
-| backgroundModes | 标识后台服务的类型,可以为一个服务配置多个后台服务类型。该标签仅适用于service类型的Ability。取值范围如下: dataTransfer:通过网络/对端设备进行数据下载、备份、分享、传输等业务。 audioPlayback:音频输出业务。 audioRecording:音频输入业务。 pictureInPicture:画中画、小窗口播放视频业务。 voip:音视频电话、VOIP业务。 location:定位、导航业务。 bluetoothInteraction:蓝牙扫描、连接、传输业务。 wifiInteraction:WLAN扫描、连接、传输业务。 screenFetch:录屏、截屏业务。 multiDeviceConnection:多设备互联业务 | 字符串数组 | 可缺省,缺省值为空。 |
-| grantPermission | 指定是否可以向Ability内任何数据授予权限。 | 布尔值 | 可缺省,缺省值为空。 |
-| readPermission | 标识读取Ability的数据所需的权限。该标签仅适用于data类型的Ability。取值为长度不超过255字节的字符串。该标签仅适用于默认设备、平板、智慧屏、车机、智能穿戴。 | 字符串 | 可缺省,缺省为空。 |
-| writePermission | 标识向Ability写数据所需的权限。该标签仅适用于data类型的Ability。取值为长度不超过255字节的字符串。 | 字符串 | 可缺省,缺省为空。 |
-| configChanges | 标识Ability关注的系统配置集合。当已关注的配置发生变更后,Ability会收到onConfigurationUpdated回调。取值范围: mcc:表示IMSI移动设备国家/地区代码(MCC)发生变更。典型场景:检测到SIM并更新MCC。 mnc:IMSI移动设备网络代码(MNC)发生变更。典型场景:检测到SIM并更新MNC。 locale:表示语言区域发生变更。典型场景:用户已为设备文本的文本显示选择新的语言类型。 layout:表示屏幕布局发生变更。典型场景:当前有不同的显示形态都处于活跃状态。 fontSize:表示字号发生变更。典型场景:用户已设置新的全局字号。 orientation:表示屏幕方向发生变更。典型场景:用户旋转设备。 density:表示显示密度发生变更。典型场景:用户可能指定不同的显示比例,或当前有不同的显示形态同时处于活跃状态。 size:显示窗口大小发生变更。 smallestSize:显示窗口较短边的边长发生变更。 colorMode:颜色模式发生变更。 | 字符串数组 | 可缺省,缺省为空。 |
-| mission | 标识Ability指定的任务栈。该标签仅适用于page类型的Ability。默认情况下应用中所有Ability同属一个任务栈。 | 字符串 | 可缺省,缺省为应用的包名。 |
-| targetAbility | 标识当前Ability重用的目标Ability。该标签仅适用于page类型的Ability。如果配置了targetAbility属性,则当前Ability(即别名Ability)的属性中仅name、icon、label、visible、permissions、skills生效,其他属性均沿用targetAbility中的属性值。目标Ability必须与别名Ability在同一应用中,且在配置文件中目标Ability必须在别名之前进行声明。 | 字符串 | 可缺省,缺省值为空。表示当前Ability不是一个别名Ability。 |
-| formsEnabled | 标识Ability是否支持卡片(forms)功能。该标签仅适用于page类型的Ability。 true:支持卡片能力。 false:不支持卡片能力。 | 布尔值 | 可缺省,缺省值为false。 |
-| forms | 标识服务卡片的属性。该标签仅当formsEnabled为"true"时,才能生效。 | 对象数组 | 可缺省,缺省值为空。 |
-| srcLanguage | Ability开发语言的类型,开发者创建工程时由开发者手动选择开发语言。 | 字符串 | 可缺省,缺省值为“js”。 |
-| srcPath | 该标签标识Ability对应的JS组件代码路径,该标签最大长度为127字节。 | 字符串 | 不可缺省。 |
-| uriPermission | 标识该Ability有权访问的应用程序数据。此属性由模式和路径子属性组成。此属性仅对类型提供者的能力有效。 | 对象 | 可缺省,缺省值为空。 |
-| startWindowIcon | 标识该Ability启动页面图标资源文件的索引。该标签仅适用于page类型的Ability。取值示例:$media:icon。 | 字符串 | 可缺省,缺省值为空。 |
-| startWindowBackground | 标识该Ability启动页面背景颜色资源文件的索引。该标签仅适用于page类型的Ability。取值示例:$color:red。 | 字符串 | 可缺省,缺省值为空。 |
-| removeMissionAfterTerminate | 该标签标识Ability销毁后是否从任务列表中移除任务。该标签仅适用于page类型的Ability。true表示销毁后移除任务, false表示销毁后不移除任务。 | 布尔值 | 可缺省,缺省值为false。 |
-
+注:应用详情页面中显示的label可能与桌面上显示的不同。如果非Page类型的PageAbility配置了入口图标和label,那么详情页中显示的即为配置的。
## uriPermission对象的内部结构
**表9** **uriPermission对象的内部结构说明**
diff --git a/zh-cn/application-dev/quick-start/resource-categories-and-access.md b/zh-cn/application-dev/quick-start/resource-categories-and-access.md
index 4f9418e7fa640aad9d93ae569835ba458e191133..d3801b2bfadf2cd9ac553286f4093777a8757077 100644
--- a/zh-cn/application-dev/quick-start/resource-categories-and-access.md
+++ b/zh-cn/application-dev/quick-start/resource-categories-and-access.md
@@ -246,7 +246,7 @@ plural.json文件的内容如下:
>
> `$r`返回值为Resource对象,可通过[getStringValue](../reference/apis/js-apis-resource-manager.md#getstringvalue9) 方法获取对应的字符串。
-在xxx.ets文件中,可以使用在resources目录中定义的资源。结合[资源组目录](#资源组目录)中的“资源文件示例”,资源使用示例如下:
+在xxx.ets文件中,可以使用在resources目录中定义的资源。资源分类中[资源组目录](#资源组目录)下的“资源文件示例”显示了.json文件内容,包含color.json文件、string.json文件和plural.json文件。资源的具体使用方法如下:
```ts
Text($r('app.string.string_hello'))
@@ -257,13 +257,14 @@ Text($r('app.string.string_world'))
.fontColor($r('app.color.color_world'))
.fontSize($r('app.float.font_world'))
-// 引用string.json资源,$r的第二个参数用于替换%s,value为"We will arrive at five of the clock"。
+// 引用string.json资源。Text中$r的第一个参数指定string资源,第二个参数用于替换string.json文件中的%s。
+//如下示例代码value为"We will arrive at five of the clock"。
Text($r('app.string.message_arrive', "five of the clock"))
.fontColor($r('app.color.color_hello'))
.fontSize($r('app.float.font_hello'))
-// 引用plural$资源,第一个指定plural资源,第二个参数指定单复数的数量quantity,此处第三个数字为对%d的替换
-// 单数下value为"5 apple",复数下value为"5 apples"。
+// 引用plural$资源。Text中$r的第一个指定plural资源,第二个参数用于指定单复数(在中文,单复数均使用other。在英文,one:代表单数,取值为1;other:代表复数,取值为大于等于1的整数),第三个参数用于替换%d
+// 如下示例代码为复数,value为"5 apples"。
Text($r('app.plural.eat_apple', 5, 5))
.fontColor($r('app.color.color_world'))
.fontSize($r('app.float.font_world'))
diff --git a/zh-cn/application-dev/reference/apis/Readme-CN.md b/zh-cn/application-dev/reference/apis/Readme-CN.md
index e5031852740b86c747c6cfbb9aa487710fbf85b4..bb5a682af660c69d0e302c29d3728e8e8dc70beb 100755
--- a/zh-cn/application-dev/reference/apis/Readme-CN.md
+++ b/zh-cn/application-dev/reference/apis/Readme-CN.md
@@ -1,4 +1,4 @@
-# 接口
+# 接口
- [开发说明](development-intro.md)
@@ -18,8 +18,6 @@
- [@ohos.app.form.FormExtensionAbility (FormExtensionAbility)](js-apis-app-form-formExtensionAbility.md)
- [@ohos.application.DataShareExtensionAbility (数据共享扩展能力)](js-apis-application-dataShareExtensionAbility.md)
- [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](js-apis-application-staticSubscriberExtensionAbility.md)
- - Stage模型能力的接口(待停用)
- - [@ohos.application.EnvironmentCallback (EnvironmentCallback)](js-apis-application-environmentCallback.md)
- FA模型能力的接口
- [@ohos.ability.ability (Ability)](js-apis-ability-ability.md)
- [@ohos.ability.featureAbility (FeatureAbility模块)](js-apis-ability-featureAbility.md)
@@ -39,10 +37,12 @@
- [@ohos.app.ability.Want (Want)](js-apis-app-ability-want.md)
- [@ohos.app.ability.wantAgent (WantAgent模块)](js-apis-app-ability-wantAgent.md)
- [@ohos.app.ability.wantConstant (wantConstant)](js-apis-app-ability-wantConstant.md)
+ - [@ohos.app.businessAbilityRouter (业务路由模块)](js-apis-businessAbilityRouter.md)
- [@ohos.app.form.formBindingData (卡片数据绑定类)](js-apis-app-form-formBindingData.md)
- [@ohos.app.form.formHost (FormHost)](js-apis-app-form-formHost.md)
- [@ohos.app.form.formInfo (FormInfo)](js-apis-app-form-formInfo.md)
- [@ohos.app.form.formProvider (FormProvider)](js-apis-app-form-formProvider.md)
+ - [@ohos.application.uriPermissionManager(URI权限管理)](js-apis-uripermissionmanager.md)
- 通用能力的接口(待停用)
- [@ohos.ability.dataUriUtils (DataUriUtils模块)](js-apis-ability-dataUriUtils.md)
- [@ohos.ability.errorCode (ErrorCode)](js-apis-ability-errorCode.md)
@@ -140,6 +140,12 @@
- [NotificationSlot](js-apis-inner-notification-notificationSlot.md)
- [NotificationTemplate](js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md)
+ - 公共事件定义
+ - [元能力子系统公共事件定义](common_event/commonEvent-ability.md)
+ - [包管理子系统公共事件定义](common_event/commonEvent-bundleManager.md)
+ - [通知服务公共事件定义](common_event/commonEvent-ans.md)
+ - [资源调度子系统公共事件定义](common_event/commonEvent-resourceschedule.md)
+ - [电话服务子系统公共事件定义](common_event/commonEvent-telephony.md)
- 包管理
- [@ohos.bundle.appControl (appControl模块)](js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager模块)](js-apis-bundleManager.md)
@@ -149,6 +155,7 @@
- [@ohos.bundle.freeInstall (freeInstall模块)](js-apis-freeInstall.md)
- [@ohos.bundle.installer (installer模块)](js-apis-installer.md)
- [@ohos.bundle.launcherBundleManager (launcherBundleManager模块)](js-apis-launcherBundleManager.md)
+ - [@ohos.bundle.overlay (overlay模块)](js-apis-overlay.md)
- [@ohos.zlib (Zip模块)](js-apis-zlib.md)
- bundleManager
- [abilityInfo](js-apis-bundleManager-abilityInfo.md)
@@ -156,18 +163,22 @@
- [AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)
- [bundleInfo](js-apis-bundleManager-bundleInfo.md)
- [BundlePackInfo](js-apis-bundleManager-BundlePackInfo.md)
+ - [BusinessAbilityInfo](js-apis-bundleManager-businessAbilityInfo.md)
- [dispatchInfo](js-apis-bundleManager-dispatchInfo.md)
- [elementName](js-apis-bundleManager-elementName.md)
- [extensionAbilityInfo](js-apis-bundleManager-extensionAbilityInfo.md)
- [hapModuleInfo](js-apis-bundleManager-hapModuleInfo.md)
- [launcherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo.md)
- [metadata](js-apis-bundleManager-metadata.md)
+ - [OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md)
- [permissionDef](js-apis-bundleManager-permissionDef.md)
- [remoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)
+ - [SharedBundleInfo](js-apis-bundleManager-sharedBundleInfo.md)
- [shortcutInfo](js-apis-bundleManager-shortcutInfo.md)
- UI界面
- [@ohos.animator (动画)](js-apis-animator.md)
+ - [@ohos.arkui.componentSnapshot(组件截图)](js-apis-arkui-componentSnapshot.md)
- [@ohos.arkui.drawableDescriptor(DrawableDescriptor)](js-apis-arkui-drawableDescriptor.md)
- [@ohos.curves (插值计算)](js-apis-curve.md)
- [@ohos.matrix4 (矩阵变换)](js-apis-matrix4.md)
@@ -265,7 +276,7 @@
- [@ohos.net.connection (网络连接管理)](js-apis-net-connection.md)
- [@ohos.net.ethernet (以太网连接管理)](js-apis-net-ethernet.md)
- [@ohos.net.http (数据请求)](js-apis-http.md)
- - [@ohos.net.policy (网络策略管理)](js-apis-net-policy.md)
+ - [@ohos.net.mdns (MDNS管理)](js-apis-net-mdns.md)
- [@ohos.net.sharing (网络共享管理)](js-apis-net-sharing.md)
- [@ohos.net.socket (Socket连接)](js-apis-socket.md)
- [@ohos.net.webSocket (WebSocket连接)](js-apis-webSocket.md)
@@ -322,12 +333,13 @@
- [@ohos.batteryStatistics (耗电统计)](js-apis-batteryStatistics.md)
- [@ohos.brightness (屏幕亮度)](js-apis-brightness.md)
- [@ohos.charger (充电类型)](js-apis-charger.md)
+ - [@ohos.cooperate (键鼠穿越)](js-apis-devicestatus-cooperate.md)
- [@ohos.deviceInfo (设备信息)](js-apis-device-info.md)
- [@ohos.distributedHardware.deviceManager (设备管理)](js-apis-device-manager.md)
- [@ohos.geoLocationManager (位置服务)](js-apis-geoLocationManager.md)
- [@ohos.multimodalInput.inputConsumer (组合按键)](js-apis-inputconsumer.md)
- [@ohos.multimodalInput.inputDevice (输入设备)](js-apis-inputdevice.md)
- - [@ohos.multimodalInput.inputDeviceCooperate (键鼠穿越)](js-apis-cooperate.md)
+ - [@ohos.multimodalInput.inputDeviceCooperate (键鼠穿越)(待停用)](js-apis-cooperate.md)
- [@ohos.multimodalInput.inputEvent (输入事件)](js-apis-inputevent.md)
- [@ohos.multimodalInput.inputEventClient (按键注入)](js-apis-inputeventclient.md)
- [@ohos.multimodalInput.inputMonitor (输入监听)](js-apis-inputmonitor.md)
@@ -336,6 +348,7 @@
- [@ohos.multimodalInput.mouseEvent (鼠标输入事件)](js-apis-mouseevent.md)
- [@ohos.multimodalInput.pointer (鼠标指针)](js-apis-pointer.md)
- [@ohos.multimodalInput.touchEvent (触摸输入事件)](js-apis-touchevent.md)
+ - [@ohos.multimodalInput.shortKey (快捷键)](js-apis-shortKey.md)
- [@ohos.power (系统电源管理)](js-apis-power.md)
- [@ohos.runningLock (Runninglock锁)](js-apis-runninglock.md)
- [@ohos.sensor (传感器)](js-apis-sensor.md)
diff --git a/zh-cn/application-dev/reference/apis/commonEvent-definitions.md b/zh-cn/application-dev/reference/apis/commonEvent-definitions.md
index 576f230600fe6d6d3e0c9809195009b436a31171..c0c956ce547c3a86ded822d8835670b6b86bdd85 100644
--- a/zh-cn/application-dev/reference/apis/commonEvent-definitions.md
+++ b/zh-cn/application-dev/reference/apis/commonEvent-definitions.md
@@ -1,4 +1,4 @@
-# 系统公共事件定义
+# 系统公共事件定义(待停用)
本文档提供OpenHarmony系统所定义的公共事件类型的索引。
公共事件类型定义在[ohos.commonEvent模块的Support枚举](./js-apis-commonEvent.md#support)中。
diff --git a/zh-cn/application-dev/reference/apis/common_event/Readme.md b/zh-cn/application-dev/reference/apis/common_event/Readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..fb6fa8936e4738811bc3542acc239265dda9800b
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis/common_event/Readme.md
@@ -0,0 +1,7 @@
+# 公共事件定义
+
+- [元能力子系统公共事件定义](commonEvent-ability.md)
+- [包管理子系统公共事件定义](commonEvent-bundleManager.md)
+- [通知服务公共事件定义](commonEvent-ans.md)
+- [资源调度子系统公共事件定义](commonEvent-resourceschedule.md)
+- [电话服务子系统公共事件定义](commonEvent-telephony.md)
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/development-intro.md b/zh-cn/application-dev/reference/apis/development-intro.md
index 3ae0b33f7b4767ff3342ab5b95cd6417c199183a..38741fe6261737b7ca960f4e9a6491178c43239c 100644
--- a/zh-cn/application-dev/reference/apis/development-intro.md
+++ b/zh-cn/application-dev/reference/apis/development-intro.md
@@ -29,7 +29,7 @@ OpenHarmony中提供的接口,部分是仅供OEM厂商使用的system api,
普通应用即在HarmonyAppProvision配置文件中应用程序类型为hos_normal_app的应用。工程新建时,该字段默认为hos_normal_app。
随DevEco下载的SDK为public-SDK,不包括系统接口。如需使用系统接口,需要:
-- 参考[full-SDK替换指南](../../quick-start/full-sdk-switch-guide.md)将SDK替换为full-SDK。
+- 参考[full-SDK替换指南](../../faqs/full-sdk-switch-guide.md)将SDK替换为full-SDK。
- 参考[HarmonyAppProvision配置文件的说明](../../security/app-provision-structure.md)修改HarmonyAppProvision配置文件中的app-feature字段为hos_system_app(系统应用)。
## 权限说明
diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-serviceExtensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-serviceExtensionAbility.md
index d373237d580efd7dfba53f3d326035b68679b1ad..af595fc9d82b6cf24ab18323933912ea676ece5b 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-serviceExtensionAbility.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-serviceExtensionAbility.md
@@ -3,8 +3,9 @@
ServiceExtensionAbility模块提供后台服务相关扩展能力,提供后台服务创建、销毁、连接、断开等生命周期回调。
> **说明:**
->
-> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+>
+> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+>
> 本模块接口仅可在Stage模型下使用。
## 导入模块
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
index 010cc3968da021f4f08b5e3f32a881ed13500be8..5260388f9f9bf6b9c315e8880f3a13dca3291c2a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
@@ -3,8 +3,9 @@
StaticSubscriberExtensionAbility模块提供静态订阅者ExtensionAbility的类别的能力。
> **说明:**
->
-> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+>
+> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+>
> 本模块接口仅可在Stage模型下使用。
## 导入模块
@@ -37,7 +38,6 @@ onReceiveEvent(event: CommonEventData): void;
| event | [CommonEventData](js-apis-commonEventManager.md#commoneventdata) | 是 | 静态订阅者通用事件回调。 |
**示例:**
-
```ts
class MyStaticSubscriberExtensionAbility extends StaticSubscriberExtensionAbility {
onReceiveEvent(event) {
diff --git a/zh-cn/application-dev/reference/apis/js-apis-batteryStatistics.md b/zh-cn/application-dev/reference/apis/js-apis-batteryStatistics.md
index 5de930534fc4eb5263a316ea122fa23c60820b8e..a91de5d9d68aa7659d7d85f24062f78300449ffc 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-batteryStatistics.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-batteryStatistics.md
@@ -36,7 +36,7 @@ getBatteryStats(): Promise
| 错误码ID | 错误信息 |
|---------|---------|
-| 4600101 | 连接服务失败。 |
+| 4600101 | If connecting to the service failed. |
**示例:**
@@ -72,7 +72,7 @@ getBatteryStats(callback: AsyncCallback): void
| 错误码ID | 错误信息 |
|---------|---------|
-| 4600101 | 连接服务失败。 |
+| 4600101 | If connecting to the service failed. |
**示例:**
@@ -114,7 +114,7 @@ getAppPowerValue(uid: number): number
| 错误码ID | 错误信息 |
|---------|---------|
-| 4600101 | 连接服务失败。 |
+| 4600101 | If connecting to the service failed. |
**示例:**
@@ -155,7 +155,7 @@ getAppPowerPercent(uid: number): number
| 错误码ID | 错误信息 |
|---------|---------|
-| 4600101 | 连接服务失败。 |
+| 4600101 | If connecting to the service failed. |
**示例:**
@@ -196,13 +196,13 @@ getHardwareUnitPowerValue(type: ConsumptionType): number
| 错误码ID | 错误信息 |
|---------|---------|
-| 4600101 | 连接服务失败。 |
+| 4600101 | If connecting to the service failed. |
**示例:**
```js
try {
- var value = batteryStats.getHardwareUnitPowerValue(ConsumptionType.CONSUMPTION_TYPE_SCREEN);
+ var value = batteryStats.getHardwareUnitPowerValue(batteryStats.ConsumptionType.CONSUMPTION_TYPE_SCREEN);
console.info('battery statistics value of hardware is: ' + value);
} catch(err) {
console.error('get battery statistics percent of hardware failed, err: ' + err);
@@ -237,13 +237,13 @@ getHardwareUnitPowerPercent(type: ConsumptionType): number
| 错误码ID | 错误信息 |
|---------|---------|
-| 4600101 | 连接服务失败。 |
+| 4600101 | If connecting to the service failed. |
**示例:**
```js
try {
- var percent = batteryStats.getHardwareUnitPowerPercent(ConsumptionType.CONSUMPTION_TYPE_SCREEN);
+ var percent = batteryStats.getHardwareUnitPowerPercent(batteryStats.ConsumptionType.CONSUMPTION_TYPE_SCREEN);
console.info('battery statistics percent of hardware is: ' + percent);
} catch(err) {
console.error('get battery statistics percent of hardware failed, err: ' + err);
diff --git a/zh-cn/application-dev/reference/apis/js-apis-brightness.md b/zh-cn/application-dev/reference/apis/js-apis-brightness.md
index 0bb0f2e7a8a0efe584d5df24483bed020c707cfc..12556adab48b360369a68406eb3c95335847598a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-brightness.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-brightness.md
@@ -36,7 +36,7 @@ setValue(value: number): void
| 错误码ID | 错误信息 |
|---------|---------|
-| 4700101 | 连接服务失败。 |
+| 4700101 | If connecting to the service failed. |
**示例:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-buffer.md b/zh-cn/application-dev/reference/apis/js-apis-buffer.md
index 8e0717eb3d49c15bc9c2a5e08c69439c3da097dc..0517a442e87df8af09330091496a9d3e7c109f5c 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-buffer.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-buffer.md
@@ -872,7 +872,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigInt64BE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8);
-let result = buf1.writeBigInt64BE(0x0102030405060708n, 0);
+let result = buf1.writeBigInt64BE(BigInt(0x0102030405060708), 0);
```
### readBigInt64LE
@@ -913,7 +913,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigInt64LE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8);
-let result = buf1.writeBigInt64BE(0x0102030405060708n, 0);
+let result = buf1.writeBigInt64BE(BigInt(0x0102030405060708), 0);
```
### readBigUInt64BE
@@ -954,7 +954,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigUInt64BE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8);
-let result = buf1.writeBigUInt64BE(0xdecafafecacefaden, 0);
+let result = buf1.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0);
```
### readBigUInt64LE
@@ -995,7 +995,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigUInt64LE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8);
-let result = buf1.writeBigUInt64BE(0xdecafafecacefaden, 0);
+let result = buf1.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0);
```
### readDoubleBE
@@ -2045,7 +2045,7 @@ writeBigInt64BE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8);
-let result = buf.writeBigInt64BE(0x0102030405060708n, 0);
+let result = buf.writeBigInt64BE(BigInt(0x0102030405060708), 0);
```
### writeBigInt64LE
@@ -2084,7 +2084,7 @@ writeBigInt64LE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8);
-let result = buf.writeBigInt64LE(0x0102030405060708n, 0);
+let result = buf.writeBigInt64LE(BigInt(0x0102030405060708), 0);
```
### writeBigUInt64BE
@@ -2123,7 +2123,7 @@ writeBigUInt64BE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8);
-let result = buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
+let result = buf.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0);
```
### writeBigUInt64LE
@@ -2162,7 +2162,7 @@ writeBigUInt64LE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8);
-let result = buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
+let result = buf.writeBigUInt64LE(BigInt(0xdecafafecacefade), 0);
```
### writeDoubleBE
diff --git a/zh-cn/application-dev/reference/apis/js-apis-charger.md b/zh-cn/application-dev/reference/apis/js-apis-charger.md
index bd5f1041c61692700d9b88ec1c83f693437fde3d..50215721ced8a614c7b8e48d94798ee57da7279d 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-charger.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-charger.md
@@ -17,6 +17,8 @@ import charger from '@ohos.charger';
表示充电类型的枚举。
+**系统接口:** 此接口为系统接口。
+
**系统能力**:SystemCapability.PowerManager.BatteryManager.Core
| 名称 | 值 | 说明 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md b/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
index cac5176ad0112516fbcc559094b04bc629dacdef..7add180ca0b27b9d6169963b7ba2761acedfd5b4 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
@@ -19,19 +19,20 @@ import CommonEvent from '@ohos.commonEvent';
全部系统公共事件枚举定义请参见[系统公共事件定义](./commonEvent-definitions.md)。
-## CommonEvent.publish
+## CommonEvent.publish(deprecated)
-```ts
-publish(event: string, callback: AsyncCallback): void
-```
+publish(event: string, callback: AsyncCallback\): void
发布公共事件(回调形式)。
+> **说明:**
+> 从 API version 7开始支持,从API version 9开始废弃。建议使用[commonEventManager.publish](js-apis-commonEventManager.md#commoneventmanagerpublish)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ---------------------- |
| event | string | 是 | 表示要发送的公共事件。 |
| callback | AsyncCallback\ | 是 | 表示被指定的回调方法。 |
@@ -52,23 +53,24 @@ function publishCB(err) {
CommonEvent.publish("event", publishCB);
```
-## CommonEvent.publish
+## CommonEvent.publish(deprecated)
-```ts
-publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void
-```
+publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\): void
以回调的形式发布公共事件。
+> **说明:**
+> 从 API version 7开始支持,从API version 9开始废弃。建议使用[commonEventManager.publish](js-apis-commonEventManager.md#commoneventmanagerpublish-1)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---------------------- |
| event | string | 是 | 表示要发布的公共事件。 |
| options | [CommonEventPublishData](./js-apis-inner-commonEvent-commonEventPublishData.md) | 是 | 表示发布公共事件的属性。 |
-| callback | syncCallback\ | 是 | 表示被指定的回调方法。 |
+| callback | AsyncCallback\ | 是 | 表示被指定的回调方法。 |
**示例:**
@@ -94,21 +96,22 @@ function publishCB(err) {
CommonEvent.publish("event", options, publishCB);
```
-## CommonEvent.publishAsUser8+
+## CommonEvent.publishAsUser(deprecated)
-```ts
-publishAsUser(event: string, userId: number, callback: AsyncCallback): void
-```
+publishAsUser(event: string, userId: number, callback: AsyncCallback\): void
以回调的形式向指定用户发布公共事件。
+> **说明:**
+> 从 API version 8开始支持,从API version 9开始废弃。建议使用[commonEventManager.publishAsUser](js-apis-commonEventManager.md#commoneventmanagerpublishasuser)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**系统API**:此接口为系统接口,三方应用不支持调用。
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ---------------------------------- |
| event | string | 是 | 表示要发送的公共事件。 |
| userId | number | 是 | 表示指定向该用户ID发送此公共事件。 |
@@ -133,21 +136,22 @@ let userId = 100;
CommonEvent.publishAsUser("event", userId, publishCB);
```
-## CommonEvent.publishAsUser8+
+## CommonEvent.publishAsUser(deprecated)
-```ts
-publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback): void
-```
+publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback\): void
以回调形式向指定用户发布公共事件并指定发布信息。
+> **说明:**
+> 从 API version 8开始支持,从API version 9开始废弃。建议使用[commonEventManager.publishAsUser](js-apis-commonEventManager.md#commoneventmanagerpublishasuser-1)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**系统API**:此接口为系统接口,三方应用不支持调用。
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---------------------- |
| event | string | 是 | 表示要发布的公共事件。 |
| userId | number | 是 | 表示指定向该用户ID发送此公共事件。 |
@@ -180,19 +184,20 @@ let userId = 100;
CommonEvent.publishAsUser("event", userId, options, publishCB);
```
-## CommonEvent.createSubscriber
+## CommonEvent.createSubscriber(deprecated)
-```ts
createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void
-```
以回调形式创建订阅者。
+> **说明:**
+>从 API version 7开始支持,从API version 9开始废弃。建议使用[commonEventManager.createSubscriber](js-apis-commonEventManager.md#commoneventmanagercreatesubscriber)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| ------------- | ------------------------------------------------------------ | ---- | -------------------------- |
| subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | 是 | 表示订阅信息。 |
| callback | AsyncCallback\<[CommonEventSubscriber](./js-apis-inner-commonEvent-commonEventSubscriber.md)> | 是 | 表示创建订阅者的回调方法。 |
@@ -222,19 +227,20 @@ function createCB(err, commonEventSubscriber) {
CommonEvent.createSubscriber(subscribeInfo, createCB);
```
-## CommonEvent.createSubscriber
+## CommonEvent.createSubscriber(deprecated)
-```ts
createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise
-```
以Promise形式创建订阅者。
+> **说明:**
+>从 API version 7开始支持,从API version 9开始废弃。建议使用[commonEventManager.createSubscriber](js-apis-commonEventManager.md#commoneventmanagercreatesubscriber-1)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| ------------- | ----------------------------------------------------- | ---- | -------------- |
| subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | 是 | 表示订阅信息。 |
@@ -262,19 +268,20 @@ CommonEvent.createSubscriber(subscribeInfo).then((commonEventSubscriber) => {
});
```
-## CommonEvent.subscribe
+## CommonEvent.subscribe(deprecated)
-```ts
subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void
-```
以回调形式订阅公共事件。
+> **说明:**
+>从 API version 7开始支持,从API version 9开始废弃。建议使用[commonEventManager.subscribe](js-apis-commonEventManager.md#commoneventmanagersubscribe)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------------------- | ---- | -------------------------------- |
| subscriber | [CommonEventSubscriber](./js-apis-inner-commonEvent-commonEventSubscriber.md) | 是 | 表示订阅者对象。 |
| callback | AsyncCallback\<[CommonEventData](./js-apis-inner-commonEvent-commonEventData.md)> | 是 | 表示接收公共事件数据的回调函数。 |
@@ -314,19 +321,20 @@ function createCB(err, commonEventSubscriber) {
CommonEvent.createSubscriber(subscribeInfo, createCB);
```
-## CommonEvent.unsubscribe
+## CommonEvent.unsubscribe(deprecated)
-```ts
-unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback): void
-```
+unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback\): void
以回调形式取消订阅公共事件。
+> **说明:**
+>从 API version 7开始支持,从API version 9开始废弃。建议使用[commonEventManager.subscribe](js-apis-commonEventManager.md#commoneventmanagerunsubscribe)替代。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
+| 名称 | 类型 | 必填 | 说明 |
| ---------- | ----------------------------------------------- | ---- | ------------------------ |
| subscriber | [CommonEventSubscriber](./js-apis-inner-commonEvent-commonEventSubscriber.md) | 是 | 表示订阅者对象。 |
| callback | AsyncCallback\ | 否 | 表示取消订阅的回调方法。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md
index facf185a91ce51e35a275e8c3f6036d83a0a3726..a25ed61b3350be49a2664a697edb0852fdfc2b84 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md
@@ -20,7 +20,7 @@ import CommonEventManager from '@ohos.commonEventManager';
## CommonEventManager.publish
-publish(event: string, callback: AsyncCallback): void
+publish(event: string, callback: AsyncCallback\): void
发布公共事件,并在发布后执行相应的回调函数。
@@ -39,7 +39,6 @@ publish(event: string, callback: AsyncCallback): void
| 错误码ID | 错误信息 |
| -------- | ----------------------------------- |
-| 401 | The parameter check failed. |
| 1500004 | not System services. |
| 1500007 | error sending message to Common Event Service. |
| 1500008 | Common Event Service does not complete initialization. |
@@ -67,7 +66,7 @@ try {
## CommonEventManager.publish
-publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void
+publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\): void
以回调的形式发布公共事件。
@@ -87,7 +86,6 @@ publish(event: string, options: CommonEventPublishData, callback: AsyncCallback<
| 错误码ID | 错误信息 |
| -------- | ----------------------------------- |
-| 401 | The parameter check failed. |
| 1500004 | not System services. |
| 1500007 | error sending message to Common Event Service. |
| 1500008 | Common Event Service does not complete initialization. |
@@ -122,7 +120,7 @@ try {
## CommonEventManager.publishAsUser
-publishAsUser(event: string, userId: number, callback: AsyncCallback): void
+publishAsUser(event: string, userId: number, callback: AsyncCallback\): void
以回调的形式向指定用户发布公共事件。
@@ -144,8 +142,6 @@ publishAsUser(event: string, userId: number, callback: AsyncCallback): voi
| 错误码ID | 错误信息 |
| -------- | ----------------------------------- |
-| 202 | not system app. |
-| 401 | The parameter check failed. |
| 1500004 | not System services. |
| 1500007 | error sending message to Common Event Service. |
| 1500008 | Common Event Service does not complete initialization. |
@@ -176,7 +172,7 @@ try {
## CommonEventManager.publishAsUser
-publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback): void
+publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback\): void
以回调形式向指定用户发布公共事件并指定发布信息。
@@ -199,9 +195,7 @@ publishAsUser(event: string, userId: number, options: CommonEventPublishData, ca
| 错误码ID | 错误信息 |
| -------- | ----------------------------------- |
-| 202 | not system app. |
-| 401 | The parameter check failed. |
-| 1500004 | not System services. |
+| 1500004 | not System services or System app. |
| 1500007 | error sending message to Common Event Service. |
| 1500008 | Common Event Service does not complete initialization. |
| 1500009 | error obtaining system parameters. |
@@ -238,7 +232,7 @@ try {
## CommonEventManager.createSubscriber
-createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void
+createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback\): void
以回调形式创建订阅者。
@@ -251,17 +245,8 @@ createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallbac
| subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | 是 | 表示订阅信息。 |
| callback | AsyncCallback\<[CommonEventSubscriber](./js-apis-inner-commonEvent-commonEventSubscriber.md)> | 是 | 表示创建订阅者的回调方法。 |
-**错误码:**
-
-错误码介绍请参考[@ohos.commonEventManager(事件)](../errorcodes/errorcode-CommonEventService.md)
-
-| 错误码ID | 错误信息 |
-| -------- | ----------------------------------- |
-| 401 | The parameter check failed. |
-
**示例:**
-
```ts
let subscriber; //用于保存创建成功的订阅者对象,后续使用其完成订阅及退订的动作
@@ -290,7 +275,7 @@ try {
## CommonEventManager.createSubscriber
-createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise
+createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise\
以Promise形式创建订阅者。
@@ -307,14 +292,6 @@ createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise | 返回订阅者对象。 |
-**错误码:**
-
-错误码介绍请参考[@ohos.commonEventManager(事件)](../errorcodes/errorcode-CommonEventService.md)
-
-| 错误码ID | 错误信息 |
-| -------- | ----------------------------------- |
-| 401 | The parameter check failed. |
-
**示例:**
```ts
@@ -337,7 +314,7 @@ CommonEventManager.createSubscriber(subscribeInfo).then((commonEventSubscriber)
## CommonEventManager.subscribe
-subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void
+subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback\): void
以回调形式订阅公共事件。
@@ -356,7 +333,6 @@ subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void
+unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback\): void
以回调形式取消订阅公共事件。
@@ -426,7 +402,6 @@ unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback):
| 错误码ID | 错误信息 |
| -------- | ----------------------------------- |
-| 401 | The parameter check failed. |
| 801 | capability not supported. |
| 1500007 | error sending message to Common Event Service. |
| 1500008 | Common Event Service does not complete initialization. |
@@ -487,7 +462,7 @@ try {
## CommonEventManager.removeStickyCommonEvent10+
-removeStickyCommonEvent(event: string, callback: AsyncCallback): void
+removeStickyCommonEvent(event: string, callback: AsyncCallback\): void
以回调形式移除粘性公共事件。
@@ -495,6 +470,8 @@ removeStickyCommonEvent(event: string, callback: AsyncCallback): void
**需要权限**: ohos.permission.COMMONEVENT_STICKY
+**系统API**:此接口为系统接口,三方应用不支持调用。
+
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
@@ -508,12 +485,9 @@ removeStickyCommonEvent(event: string, callback: AsyncCallback): void
| 错误码ID | 错误信息 |
| -------- | ----------------------------------- |
-| 201 | The application dose not have permission to call the interface. |
-| 202 | not system app. |
-| 401 | The parameter check failed. |
| 1500004 | not system service. |
-| 1500007 | The message send error. |
-| 1500008 | The CEMS error. |
+| 1500007 | error sending message to Common Event Service. |
+| 1500008 | Common Event Service does not complete initialization. |
**示例:**
@@ -525,13 +499,12 @@ CommonEventManager.removeStickyCommonEvent("sticky_event", (err) => {
return;
}
console.info(`Remove sticky event AsyncCallback success`);
- }
});
```
## CommonEventManager.removeStickyCommonEvent10+
-removeStickyCommonEvent(event: string): Promise
+removeStickyCommonEvent(event: string): Promise\
以Promise形式移除粘性公共事件。
@@ -539,6 +512,8 @@ removeStickyCommonEvent(event: string): Promise
**需要权限**: ohos.permission.COMMONEVENT_STICKY
+**系统API**:此接口为系统接口,三方应用不支持调用。
+
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
@@ -557,18 +532,15 @@ removeStickyCommonEvent(event: string): Promise
| 错误码ID | 错误信息 |
| -------- | ----------------------------------- |
-| 201 | The application dose not have permission to call the interface. |
-| 202 | not system app. |
-| 401 | The parameter check failed. |
| 1500004 | not system service. |
-| 1500007 | The message send error. |
-| 1500008 | The CEMS error. |
+| 1500007 | error sending message to Common Event Service. |
+| 1500008 | Common Event Service does not complete initialization. |
**示例:**
```ts
-commonEventManager.removeStickyCommonEvent("sticky_event").then(() => {
+CommonEventManager.removeStickyCommonEvent("sticky_event").then(() => {
console.info(`Remove sticky event AsyncCallback success`);
}).catch ((err) => {
console.info(`Remove sticky event AsyncCallback failed, errCode: ${err.code}, errMes: ${err.message}`);
diff --git a/zh-cn/application-dev/reference/apis/js-apis-logs.md b/zh-cn/application-dev/reference/apis/js-apis-console.md
similarity index 54%
rename from zh-cn/application-dev/reference/apis/js-apis-logs.md
rename to zh-cn/application-dev/reference/apis/js-apis-console.md
index 31dd38d1423d394442eafa6978746e051941944a..913a633c9bbd8f1ed1d636d92ade41bdd272b9d1 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-logs.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-console.md
@@ -1,8 +1,6 @@
-# console (日志打印)
+# console 控制台
-本模块提供基础的日志打印能力,支持按照日志级别打印日志信息。
-
-如果需要使用更高级的日志打印服务,比如按照指定标识筛选日志内容,推荐使用[`@ohos.hilog`](js-apis-hilog.md)。
+本模块提供了一个简单的调试控制台,类似于浏览器提供的JavaScript控制台机制。
> **说明:**
>
@@ -10,9 +8,9 @@
## console.debug
-debug(message: string): void
+debug(message: string, ...arguments: any[]): void
-打印debug级别的日志信息。
+以格式化输出方式打印调试信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
@@ -21,13 +19,24 @@ debug(message: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
| message | string | 是 | 表示要打印的文本信息。 |
+| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 |
+**示例:**
+```js
+const number = 5;
+console.debug('count: %d', number); // 格式化输出替换message中的文本。
+// count: 5
+console.debug('count:', number); // 打印message以及其余信息
+// count: 5
+console.debug('count:'); // 仅打印message
+// count:
+```
## console.log
-log(message: string): void
+log(message: string, ...arguments: any[]): void
-打印debug级别的日志信息。
+以格式化输出方式打印日志信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
@@ -36,13 +45,24 @@ log(message: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
| message | string | 是 | 表示要打印的文本信息。 |
+| arguments | any | 否 |表示其余要打印的信息或message的替换值。 |
+**示例:**
+```js
+const number = 5;
+console.log('count: %d', number); // 格式化输出替换message中的文本。
+// count: 5
+console.log('count:', number); // 打印message以及其余信息
+// count: 5
+console.log('count:'); // 仅打印message
+// count:
+```
## console.info
-info(message: string): void
+info(message: string, ...arguments: any[]): void
-打印info级别的日志信息。
+以格式化输出方式打印日志信息。(console.log()的别名)。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
@@ -51,13 +71,24 @@ info(message: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
| message | string | 是 | 表示要打印的文本信息。 |
+| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 |
+**示例:**
+```js
+const number = 5;
+console.info('count: %d', number); // 格式化输出替换message中的文本。
+// count: 5
+console.info('count:', number); // 打印message以及其余信息
+// count: 5
+console.info('count:'); // 仅打印message
+// count:
+```
## console.warn
-warn(message: string): void
+warn(message: string, ...arguments: any[]): void
-打印warn级别的日志信息。
+以格式化输出方式打印警告信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
@@ -65,14 +96,25 @@ warn(message: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| message | string | 是 | 表示要打印的文本信息。 |
+| message | string | 是 | 表示要打印的警告信息。 |
+| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 |
+**示例:**
+```js
+const str = "name should be string";
+console.warn('warn: %d', str); // 格式化输出替换message中的文本。
+// warn: name should be string
+console.warn('warn:', str); // 打印message以及其余信息
+// warn: name should be string
+console.warn('warn:'); // 仅打印message
+// warn:
+```
## console.error
-error(message: string): void
+error(message: string, ...arguments: any[]): void
-打印error级别的日志信息。
+以格式化输出方式打印错误信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
@@ -80,31 +122,26 @@ error(message: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| message | string | 是 | 表示要打印的文本信息。 |
+| message | string | 是 | 表示要打印的错误信息。 |
+| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 |
**示例:**
-
-```
-export default {
- clickConsole(){
- var versionCode = 1;
- console.info('Hello World. The current version code is ' + versionCode);
- console.log(`versionCode: ${versionCode}`);
- // 以下写法从API Version 6开始支持console.log('versionCode:%d.', versionCode);
- }
-}
+```js
+const str = "value is not defined";
+console.error('error: %d', str); // 格式化输出替换message中的文本。
+// error: value is not defined
+console.error('error:', str); // 打印message以及其余信息
+// error: value is not defined
+console.error('error:'); // 仅打印message
+// error:
```
-在DevEco Studio的底部,切换到“HiLog”窗口。选择当前的设备及进程,日志级别选择Info,搜索内容设置为“Hello World”。此时窗口仅显示符合条件的日志,效果如图所示:
-
-
-
## console.assert10+
assert(value?: Object, ...arguments: Object[]): void
-若value为假,打印后续内容。
+断言打印。
**系统能力:** SystemCapability.Utils.Lang
@@ -112,24 +149,26 @@ assert(value?: Object, ...arguments: Object[]): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| value | Object | 否 | 值 |
-| arguments | Object | 否 | 错误消息打印。 |
+| value | Object | 否 | 语句结果值。若value为假(false)或者省略,则输出以"Assertion failed"开头。如果 value 为真值(true),则无打印。|
+| arguments | Object | 否 | value为假(false)的后续错误消息打印。省略则不打印。|
**示例:**
-```
-console.assert(true, 'does nothing');
+```js
+console.assert(true, 'does nothing'); // 表达式结果值为true, 无打印。
+console.assert(2 % 1 == 0, 'does nothing'); // 表达式结果值为true, 无打印。
console.assert(false, 'console %s work', 'didn\'t');
-// Assertion console:ohos didn't work
+// Assertion failed: console didn't work
console.assert();
// Assertion failed
```
+
## console.count10+
count(label?: string): void
-维护一个内部计数器, 并输出调用label的console.count()次数。默认值为'default'。
+维护一个内部计数器,调用时,打印此标签名以及对应的计数次数。
**系统能力:** SystemCapability.Utils.Lang
@@ -137,10 +176,11 @@ count(label?: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| label | string | 否 | 计数器标签名。 |
+| label | string | 否 | 计数器标签名。默认值为'default'。|
+
**示例:**
-```
+```js
console.count()
// default: 1
console.count('default')
@@ -150,7 +190,7 @@ console.count('abc')
console.count('xyz')
// xyz: 1
console.count('abc')
-abc: 2
+// abc: 2
console.count()
// default: 3
```
@@ -159,7 +199,7 @@ console.count()
countReset(label?: string): void
-清除label名的计数。默认值为'default'。
+清除指定标签名的计数。
**系统能力:** SystemCapability.Utils.Lang
@@ -167,10 +207,10 @@ countReset(label?: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| label | string | 否 | 计数器标签名。 |
+| label | string | 否 | 计数器标签名。默认值为'default'。|
**示例:**
-```
+```js
console.count('abc');
// abc: 1
console.countReset('abc');
@@ -190,13 +230,24 @@ dir(dir?: Object): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| dir | Object | 否 | 需要打印内容的对象。 |
+| dir | Object | 否 | 需要打印内容的对象。省略则无任何打印。|
+
+
+**示例:**
+```js
+let a = { foo: { bar: { baz: true } }};
+console.dir(a);
+// Object: {"foo":{"bar":{"baz":true}}}
+
+console.dir(); // 无打印
+```
+
## console.dirxml10+
dirxml(...arguments: Object[]): void
-此方法调用 console.log() 将接收到的参数传给它。此方法不会产生任何 XML 格式。
+此方法通过内部调用console.log()实现。此方法不会产生任何 XML 格式。使用方法与console.log()一致。
**系统能力:** SystemCapability.Utils.Lang
@@ -204,14 +255,25 @@ dirxml(...arguments: Object[]): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| arguments | Object | 否 | 要打印的信息。 |
+| arguments | Object | 是 | 要打印的信息。 |
+
+**示例:**
+```js
+const number = 5;
+console.dirxml('count: %d', number);
+// count: 5
+console.dirxml('count:', number);
+// count: 5
+console.dirxml('count:');
+// count:
+```
## console.group10+
group(...arguments: Object[]): void
-将后续行的缩进增加 groupIndentation 长度的空格。
-如果提供需要打印的信息,首先先打印信息,没有额外的缩进。
+默认将后续行的缩进增加两个空格。
+如果提供需要打印的信息,则首先打印信息,没有额外的缩进。
**系统能力:** SystemCapability.Utils.Lang
@@ -220,11 +282,26 @@ group(...arguments: Object[]): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
| arguments | Object | 否 | 要打印的信息。 |
+
+**示例:**
+```js
+console.log("outter");
+// outter
+console.group();
+console.log("level 1");
+// level 1
+console.group("in level1");
+// in level1
+console.log("level 2");
+// level 2
+```
+
+
## console.groupCollapsed10+
groupCollapsed(...arguments: Object[]): void
-group的别名。
+使用与功能同console.group()一致。
**系统能力:** SystemCapability.Utils.Lang
@@ -234,14 +311,42 @@ group的别名。
| ------- | ------ | ---- | ----------- |
| arguments | Object | 否 | 要打印的信息。|
+
+**示例:**
+```js
+console.groupCollapsed("outter");
+// outter
+console.groupCollapsed();
+console.log("level 1");
+// level 1
+console.groupCollapsed("in level1");
+// in level1
+console.log("level 2");
+// level 2
+```
+
## console.groupEnd10+
groupEnd(): void
-将后续行的缩进减少 groupIndentation 长度的空格。
+将后续行的缩进减少两个空格。
**系统能力:** SystemCapability.Utils.Lang
+
+**示例:**
+```js
+console.log("outter");
+// outter
+console.group();
+console.log("level 1");
+// level 1
+console.groupEnd();
+console.log("outter");
+// outter
+```
+
+
## console.table10+
table(tableData?: Object): void
@@ -254,10 +359,10 @@ table(tableData?: Object): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| tableData | Object | 否 | 要打印为表格形式的对象。 |
+| tableData | Object | 否 | 要打印为表格形式的对象。省略则无任何打印。 |
**示例:**
-```
+```js
console.table([1, 2, 3]);
// ┌─────────┬────────┐
// │ (index) │ Values │
@@ -281,7 +386,7 @@ console.table({ a: [1, 2, 3, 4, 5], b: 5, c: { e: 5 } });
time(label?: string): void
-启动可用于计算操作持续时间的计时器。默认值为'default'。可使用console.timeEnd()关闭计时器并打印结果。
+启动可用于计算操作持续时间的计时器。可使用console.timeEnd()关闭计时器并打印经过的时间(单位:ms)。
**系统能力:** SystemCapability.Utils.Lang
@@ -289,13 +394,18 @@ time(label?: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| label | string | 否 | 计时器标识。 |
+| label | string | 否 | 计时器标识。默认值为'default'。 |
+
+**示例:**
+```js
+console.time('abc');
+```
## console.timeEnd10+
timeEnd(label?: string): void
-停止之前通过调用 console.time() 启动的计时器并将结果打印。默认值为'default'。
+停止之前通过调用 console.time() 启动的计时器并将打印经过的时间(单位:ms)。
**系统能力:** SystemCapability.Utils.Lang
@@ -303,10 +413,10 @@ timeEnd(label?: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| label | string | 否 | 计时器标识。 |
+| label | string | 否 | 计时器标识。默认值为'default' |
**示例:**
-```
+```js
console.time('abc');
console.timeEnd('abc');
// abc: 225.438ms
@@ -316,7 +426,7 @@ console.timeEnd('abc');
timeLog(label?: string, ...arguments: Object[]): void
-对于先前通过调用 console.time() 启动的计时器,打印经过时间和其他 data 参数。
+对于先前通过调用 console.time() 启动的计时器,打印经过时间和其他data参数。
**系统能力:** SystemCapability.Utils.Lang
@@ -324,14 +434,13 @@ timeLog(label?: string, ...arguments: Object[]): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| label | string | 否 | 计时器标识。 |
+| label | string | 否 | 计时器标识。默认值为'default' |
| arguments | Object | 否 | 需要打印的其他日志。 |
**示例:**
-```
+```js
console.time('timer1');
-const value = aaa(); // 返回 17
-console.timeLog('timer1', value);
+console.timeLog('timer1', 17);
// timer1: 365.227ms 17
console.timeEnd('timer1');
// timer1: 513.22ms
@@ -349,10 +458,14 @@ trace(...arguments: Object[]): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ----------- |
-| arguments | Object | 否 | 需要打印的其他日志。 |
+| arguments | Object | 否 | 需要打印的其他日志。省略则仅打印堆栈信息。|
**示例:**
-```
+```js
console.trace();
+// Trace:
+// xxxxxxxxxx(当前堆栈信息)
console.trace("Show the trace");
+// Trace: Show the trace
+// xxxxxxxxxx(当前堆栈信息)
```
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md b/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
index a44d2d568b7c9e8f202b5318cb9d869a3da953f0..26a3254206949582ceb3d71d253d2f14bc9e1b8c 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
@@ -135,7 +135,7 @@ setSessionId(sessionId: string, callback: AsyncCallback<void>): void
| 错误码ID | 错误信息 |
| -------- | -------- |
- | 15400001 | 创建内存数据库失败。|
+ | 15400001 | Create table failed.|
**示例:**
@@ -168,7 +168,7 @@ setSessionId(callback: AsyncCallback<void>): void
| 错误码ID | 错误信息 |
| -------- | -------- |
- | 15400001 | 创建内存数据库失败。|
+ | 15400001 | Create table failed.|
**示例:**
@@ -211,7 +211,7 @@ setSessionId(sessionId?: string): Promise<void>
| 错误码ID | 错误信息 |
| -------- | -------- |
- | 15400001 | 创建内存数据库失败。|
+ | 15400001 | Create table failed.|
**示例:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md b/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md
index d0ed13cb8ff93b3ea4b94279847218ce028dd0d5..388fb5b02b96f2328bc7b9b02de0ff9c94351e1d 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md
@@ -470,7 +470,7 @@ let wantTemp = {
};
let appIds = ["com.example.myapplication"];
-bundleManager.AddDisallowedInstallBundles(wantTemp, appIds, (error) => {
+bundleManager.addDisallowedInstallBundles(wantTemp, appIds, (error) => {
if (error != null) {
console.log("error code:" + error.code + " error message:" + error.message);
}
@@ -516,7 +516,7 @@ let wantTemp = {
};
let appIds = ["com.example.myapplication"];
-bundleManager.AddDisallowedInstallBundles(wantTemp, appIds, 100, (error) => {
+bundleManager.addDisallowedInstallBundles(wantTemp, appIds, 100, (error) => {
if (error != null) {
console.log("error code:" + error.code + " error message:" + error.message);
}
diff --git a/zh-cn/application-dev/reference/apis/js-apis-enterprise-networkManager.md b/zh-cn/application-dev/reference/apis/js-apis-enterprise-networkManager.md
index 86340457b2f57fde93991515c1babf4c9dd365c6..94ab8bcc2bd18da2acd48623d1f55dc2c3e0c733 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-enterprise-networkManager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-enterprise-networkManager.md
@@ -331,7 +331,7 @@ networkManager.isNetworkInterfaceDisabled(wantTemp, "eth0", (error, result) => {
console.log("error code:" + error.code + " error message:" + error.message);
return;
}
- console.log(result);
+ console.log("result:" + result);
});
```
@@ -377,7 +377,7 @@ let wantTemp = {
abilityName: "EntryAbility",
};
networkManager.isNetworkInterfaceDisabled(wantTemp, "eth0").then((result) => {
- console.log(result);
+ console.log("result:" + result);
}).catch(error => {
console.log("error code:" + error.code + " error message:" + error.message);
});
diff --git a/zh-cn/application-dev/reference/apis/js-apis-enterprise-wifiManager.md b/zh-cn/application-dev/reference/apis/js-apis-enterprise-wifiManager.md
index ff52f1b9dfae140372211ae0dcd2232de609aeda..5f3a85bdcf2efccb8dd772ae17ffd5ef8d953c01 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-enterprise-wifiManager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-enterprise-wifiManager.md
@@ -53,7 +53,7 @@ wifiManager.isWifiActive(wantTemp, (error, result) => {
console.log("error code:" + error.code + " error message:" + error.message);
return;
}
- console.log(result);
+ console.log("result:" + result);
});
```
@@ -98,7 +98,7 @@ let wantTemp = {
abilityName: "EntryAbility",
};
wifiManager.isWifiActive(wantTemp).then((result) => {
- console.log(result);
+ console.log("result:" + result);
}).catch(error => {
console.log("error code:" + error.code + " error message:" + error.message);
});
diff --git a/zh-cn/application-dev/reference/apis/js-apis-file-backup.md b/zh-cn/application-dev/reference/apis/js-apis-file-backup.md
index 90e9dc3a8422b361d0adc48e356c614b0589e93c..3dffdc6feaf78fcc06f55eddc77e0baecc888c1b 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-file-backup.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-file-backup.md
@@ -19,9 +19,9 @@ import backup from '@ohos.file.backup';
**系统能力**:SystemCapability.FileManagement.StorageService.Backup
-| 名称 | 类型 | 必填 | 说明 |
-| ---------- | ------ | ---- | ------------------------- |
-| bundleName | string | 是 | 应用名称,可通过[bundle.BundleInfo](js-apis-bundle-BundleInfo.md)提供的获取方式获取。 |
+| 名称 | 类型 | 必填 | 说明 |
+| ---------- | ------ | ---- | ---------------------------------------------------------------------------------------------- |
+| bundleName | string | 是 | 应用名称,可通过[bundle.BundleInfo](js-apis-bundle-BundleInfo.md)提供的获取方式获取。 |
| uri | string | 是 | 应用沙箱内待传输文件的名称,当前uri尚未升级为标准格式,仅接受0-9a-zA-Z下划线(_)点(.)组成的名称 |
## FileData
@@ -70,14 +70,15 @@ onFileReady : AsyncCallback<File>
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
@@ -103,14 +104,15 @@ onBundleBegin : AsyncCallback<string>
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
@@ -134,14 +136,15 @@ onBundleEnd : AsyncCallback<string>
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
@@ -165,14 +168,15 @@ onAllBundlesEnd : AsyncCallback<undefined>
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
@@ -213,20 +217,21 @@ getLocalCapabilities(callback: AsyncCallback<FileData>): void
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| -------- | ------------------------- | ---- | --------------------- |
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | ------------------------------------------ | ---- | ------------------------------------------------------ |
| callback | AsyncCallback<[FileData](#filedata)> | 是 | 回调函数。当获取成功,err为undefined,否则为错误对象。 |
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
@@ -275,31 +280,34 @@ getLocalCapabilities(): Promise<FileData>
**返回值:**
-| 类型 | 说明 |
-| -------------------- | ------------------ |
+| 类型 | 说明 |
+| ------------------------------------ | --------------------------------------------------- |
| Promise<[FileData](#filedata)> | Promise对象,返回描述本地能力的Json文件的FileData。 |
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
```js
import fs from '@ohos.file.fs';
- try {
- let fileData = await backup.getLocalCapabilities();
- console.info('getLocalCapabilities success');
- fs.closeSync(fileData.fd);
- } catch (err) {
- console.error('getLocalCapabilities failed with err: ' + err);
+ async function getLocalCapabilities() {
+ try {
+ let fileData = await backup.getLocalCapabilities();
+ console.info('getLocalCapabilities success');
+ fs.closeSync(fileData.fd);
+ } catch (err) {
+ console.error('getLocalCapabilities failed with err: ' + err);
+ }
}
```
@@ -345,7 +353,7 @@ constructor(callbacks: GeneralCallbacks);
```js
import fs from '@ohos.file.fs';
- let sessionBackup = new backup.SessionBackup({
+ let generalCallbacks = backup.GeneralCallbacks({
onFileReady: (err, file) => {
if (err) {
console.error('onFileReady failed with err: ' + err);
@@ -375,6 +383,7 @@ constructor(callbacks: GeneralCallbacks);
console.info('service died');
}
});
+ let sessionBackup = new backup.SessionBackup(generalCallbacks);
```
### appendBundles
@@ -397,19 +406,52 @@ appendBundles(bundlesToBackup: string[], callback: AsyncCallback<void>): v
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
+
```js
+ import fs from '@ohos.file.fs';
+ let sessionBackup = new backup.SessionBackup({
+ onFileReady: (err, file) => {
+ if (err) {
+ console.error('onFileReady failed with err: ' + err);
+ }
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
try {
sessionBackup.appendBundles(['com.example.hiworld'], (err) => {
if (err) {
@@ -447,24 +489,58 @@ appendBundles(bundlesToBackup: string[]): Promise<void>
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
```js
- try {
- await sessionBackup.appendBundles(['com.example.hiworld']);
- console.info('appendBundles success');
- } catch (err) {
+ import fs from '@ohos.file.fs';
+ let sessionBackup = new backup.SessionBackup({
+ onFileReady: (err, file) => {
+ if (err) {
+ console.error('onFileReady failed with err: ' + err);
+ }
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
+ async function appendBundles() {
+ try {
+ await sessionBackup.appendBundles(['com.example.hiworld']);
+ console.info('appendBundles success');
+ } catch (err) {
console.error('appendBundles failed with err: ' + err);
+ }
}
```
@@ -492,7 +568,7 @@ constructor(callbacks: GeneralCallbacks);
```js
import fs from '@ohos.file.fs';
- let sessionRestore = new backup.SessionRestore({
+ let generalCallbacks = backup.GeneralCallbacks({
onFileReady: (err, file) => {
if (err) {
console.error('onFileReady failed with err: ' + err);
@@ -518,10 +594,11 @@ constructor(callbacks: GeneralCallbacks);
}
console.info('onAllBundlesEnd success');
},
- onRestoreServiceDied: () => {
+ onBackupServiceDied: () => {
console.info('service died');
}
});
+ let sessionRestore = new backup.SessionRestore(generalCallbacks);
```
### appendBundles
@@ -550,30 +627,64 @@ appendBundles(remoteCapabilitiesFd: number, bundlesToBackup: string[], callback:
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
```js
- try {
- let fileData = await backup.getLocalCapabilities();
- console.info('getLocalCapabilities success');
- sessionRestore.appendBundles(fileData.fd, ['com.example.hiworld'], (err) => {
+ import fs from '@ohos.file.fs';
+ let sessionRestore = new backup.SessionRestore({
+ onFileReady: (err, file) => {
+ if (err) {
+ console.error('onFileReady failed with err: ' + err);
+ }
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
+ async function appendBundles() {
+ try {
+ let fileData = await backup.getLocalCapabilities();
+ console.info('getLocalCapabilities success');
+ sessionRestore.appendBundles(fileData.fd, ['com.example.hiworld'], (err) => {
if (err) {
console.error('appendBundles failed with err: ' + err);
}
console.info('appendBundles success');
});
- } catch (err) {
- console.error('appendBundles failed with err: ' + err);
+ } catch (err) {
+ console.error('getLocalCapabilities failed with err: ' + err);
+ }
}
```
@@ -608,26 +719,60 @@ appendBundles(remoteCapabilitiesFd: number, bundlesToBackup: string[]): Promise&
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900005 | I/O error |
-| 13900011 | Out of memory |
-| 13900020 | Invalid argument |
+| 13900005 | I/O error |
+| 13900011 | Out of memory |
+| 13900020 | Invalid argument |
| 13900025 | No space left on device |
-| 13900042 | Unknown error |
+| 13900042 | Unknown error |
**示例:**
```js
- try {
- let fileData = await backup.getLocalCapabilities();
- console.info('getLocalCapabilities success');
- await sessionRestore.appendBundles(fileData.fd, ['com.example.hiworld']);
- console.info('appendBundles success');
- } catch (err) {
- console.error('appendBundles failed with err: ' + err);
+ import fs from '@ohos.file.fs';
+ let sessionRestore = new backup.SessionRestore({
+ onFileReady: (err, file) => {
+ if (err) {
+ console.error('onFileReady failed with err: ' + err);
+ }
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
+ async function appendBundles() {
+ try {
+ let fileData = await backup.getLocalCapabilities();
+ console.info('getLocalCapabilities success');
+ await sessionRestore.appendBundles(fileData.fd, ['com.example.hiworld']);
+ console.info('appendBundles success');
+ } catch (err) {
+ console.error('getLocalCapabilities failed with err: ' + err);
+ }
}
```
@@ -658,18 +803,49 @@ getFileHandle(fileMeta: FileMeta, callback: AsyncCallback<void>): void
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900020 | Invalid argument |
-| 13900042 | Unknown error |
+| 13900020 | Invalid argument |
+| 13900042 | Unknown error |
**示例:**
```js
- try {
- sessionRestore.getFileHandle({
+ import fs from '@ohos.file.fs';
+ let sessionRestore = new backup.SessionRestore({
+ onFileReady: (err, file) => {
+ if (err) {
+ console.error('onFileReady failed with err: ' + err);
+ }
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
+ sessionRestore.getFileHandle({
bundleName: "com.example.hiworld",
uri: "test.txt"
}, (err, file) => {
@@ -678,9 +854,6 @@ getFileHandle(fileMeta: FileMeta, callback: AsyncCallback<void>): void
}
console.info('getFileHandle success');
});
- } catch (err) {
- console.error('getFileHandle failed with err: ' + err);
- }
```
### getFileHandle
@@ -715,24 +888,58 @@ getFileHandle(fileMeta: FileMeta): Promise<void>
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900020 | Invalid argument |
-| 13900042 | Unknown error |
+| 13900020 | Invalid argument |
+| 13900042 | Unknown error |
**示例:**
```js
- try {
- await sessionRestore.getFileHandle({
- bundleName: "com.example.hiworld",
- uri: "test.txt"
+ import fs from '@ohos.file.fs';
+ let sessionRestore = new backup.SessionRestore({
+ onFileReady: (err, file) => {
+ if (err) {
+ console.error('onFileReady failed with err: ' + err);
+ }
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
+ async function getFileHandle() {
+ try {
+ await sessionRestore.getFileHandle({
+ bundleName: "com.example.hiworld",
+ uri: "test.txt"
});
- console.info('getFileHandle success');
- } catch (err) {
- console.error('getFileHandle failed with err: ' + err);
+ console.info('getFileHandle success');
+ } catch (err) {
+ console.error('getFileHandle failed with err: ' + err);
+ }
}
```
@@ -762,36 +969,62 @@ publishFile(fileMeta: FileMeta, callback: AsyncCallback<void>): void
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900020 | Invalid argument |
-| 13900042 | Unknown error |
+| 13900020 | Invalid argument |
+| 13900042 | Unknown error |
**示例:**
```js
- try {
- onFileReady: (err, file) => {
- if (err) {
- console.error('onFileReady failed with err: ' + err);
- }
- console.info('onFileReady success');
- fs.closeSync(file.fd);
- sessionRestore.publishFile({
- bundleName: file.bundleName,
- uri: file.uri
- }, (err) => {
+ import fs from '@ohos.file.fs';
+ let g_session;
+ function createSessionRestore() {
+ let sessionRestore = new backup.SessionRestore({
+ onFileReady: (err, file) => {
if (err) {
- console.error('publishFile failed with err: ' + err);
+ console.error('onFileReady failed with err: ' + err);
}
- console.info('publishFile success');
- });
- }
- } catch (err) {
- console.error('publishFile failed with err: ' + err);
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ g_session.publishFile({
+ bundleName: file.bundleName,
+ uri: file.uri
+ }, (err) => {
+ if (err) {
+ console.error('publishFile failed with err: ' + err);
+ }
+ console.info('publishFile success');
+ });
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
+ return sessionRestore;
}
+ g_session = createSessionRestore();
```
### publishFile
@@ -825,30 +1058,60 @@ publishFile(fileMeta: FileMeta): Promise<void>
**错误码:**
以下错误码的详细介绍请参见[文件管理子系统错误码](../errorcodes/errorcode-filemanagement.md)。
-| 错误码ID | 错误信息 |
-| ---------------------------- | ---------- |
-| 13600001 | IPC error |
+
+| 错误码ID | 错误信息 |
+| -------- | ----------------------- |
+| 13600001 | IPC error |
| 13900001 | Operation not permitted |
-| 13900020 | Invalid argument |
-| 13900042 | Unknown error |
+| 13900020 | Invalid argument |
+| 13900042 | Unknown error |
**示例:**
```js
- try {
- onFileReady: (err, file) => {
- if (err) {
- console.error('onFileReady failed with err: ' + err);
- }
- console.info('onFileReady success');
- fs.closeSync(file.fd);
- await sessionRestore.publishFile({
+ import fs from '@ohos.file.fs';
+ let g_session;
+ async function publishFile(file)
+ {
+ await g_session.publishFile({
bundleName: file.bundleName,
uri: file.uri
- });
- console.info('publishFile success');
- },
- } catch (err) {
- console.error('publishFile failed with err: ' + err);
+ });
+ }
+ function createSessionRestore() {
+ let sessionRestore = new backup.SessionRestore({
+ onFileReady: (err, file) => {
+ if (err) {
+ console.error('onFileReady failed with err: ' + err);
+ }
+ console.info('onFileReady success');
+ fs.closeSync(file.fd);
+ publishFile(file);
+ console.info('publishFile success');
+ },
+ onBundleBegin: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleBegin failed with err: ' + err);
+ }
+ console.info('onBundleBegin success');
+ },
+ onBundleEnd: (err, bundleName) => {
+ if (err) {
+ console.error('onBundleEnd failed with err: ' + err);
+ }
+ console.info('onBundleEnd success');
+ },
+ onAllBundlesEnd: (err) => {
+ if (err) {
+ console.error('onAllBundlesEnd failed with err: ' + err);
+ }
+ console.info('onAllBundlesEnd success');
+ },
+ onBackupServiceDied: () => {
+ console.info('service died');
+ }
+ });
+ return sessionRestore;
}
+ g_session = createSessionRestore();
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-http.md b/zh-cn/application-dev/reference/apis/js-apis-http.md
index c593449449deaf19aae6c75fb437a4b1d5a7bd95..bf34a19c164df7be8f46b16ccb2d098e7d6be575 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-http.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-http.md
@@ -46,6 +46,7 @@ httpRequest.request(
readTimeout: 60000, // 可选,默认为60000ms
usingProtocol: http.HttpProtocol.HTTP1_1, // 可选,协议类型默认值由系统自动指定
usingProxy: false, //可选,默认不使用网络代理,自API 10开始支持该属性
+ caPath: "", // 可选,默认使用系统预设CA证书,自API 10开始支持该属性
}, (err, data) => {
if (!err) {
// data.result为HTTP响应内容,可根据业务需要进行解析
@@ -68,7 +69,7 @@ httpRequest.request(
> **说明:**
> console.info()输出的数据中包含换行符会导致数据出现截断现象。
-## http.createHttp
+## http.createHttp6+
createHttp(): HttpRequest
@@ -94,7 +95,7 @@ let httpRequest = http.createHttp();
HTTP请求任务。在调用HttpRequest的方法前,需要先通过[createHttp()](#httpcreatehttp)创建一个任务。
-### request
+### request6+
request(url: string, callback: AsyncCallback\):void
@@ -120,10 +121,34 @@ request(url: string, callback: AsyncCallback\):void
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
+| 2300001 | Unsupported protocol. |
| 2300003 | URL using bad/illegal format or missing URL. |
+| 2300005 | Couldn't resolve proxy name. |
+| 2300006 | Couldn't resolve host name. |
| 2300007 | Couldn't connect to server. |
+| 2300008 | Weird server reply. |
+| 2300009 | Access denied to remote resource. |
+| 2300016 | Error in the HTTP2 framing layer. |
+| 2300018 | Transferred a partial file. |
+| 2300023 | Failed writing received data to disk/application. |
+| 2300025 | Upload failed. |
+| 2300026 | Failed to open/read local data from file/application. |
+| 2300027 | Out of memory. |
| 2300028 | Timeout was reached. |
+| 2300047 | Number of redirects hit maximum amount. |
| 2300052 | Server returned nothing (no headers, no data). |
+| 2300055 | Failed sending data to the peer. |
+| 2300056 | Failure when receiving data from the peer. |
+| 2300058 | Problem with the local SSL certificate. |
+| 2300059 | Couldn't use specified SSL cipher. |
+| 2300060 | SSL peer certificate or SSH remote key was not OK. |
+| 2300061 | Unrecognized or bad HTTP Content or Transfer-Encoding.|
+| 2300063 | Maximum file size exceeded. |
+| 2300070 | Disk full or allocation exceeded. |
+| 2300073 | Remote file already exists. |
+| 2300077 | Problem with the SSL CA cert (path? access rights?). |
+| 2300078 | Remote file not found. |
+| 2300094 | An authentication function returned an error. |
| 2300999 | Unknown Other Error. |
> **错误码说明:**
@@ -145,7 +170,7 @@ httpRequest.request("EXAMPLE_URL", (err, data) => {
});
```
-### request
+### request6+
request(url: string, options: HttpRequestOptions, callback: AsyncCallback\):void
@@ -231,7 +256,7 @@ httpRequest.request("EXAMPLE_URL",
});
```
-### request
+### request6+
request(url: string, options? : HttpRequestOptions): Promise\
@@ -357,10 +382,34 @@ request2(url: string, callback: AsyncCallback\): void
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
+| 2300001 | Unsupported protocol. |
| 2300003 | URL using bad/illegal format or missing URL. |
+| 2300005 | Couldn't resolve proxy name. |
+| 2300006 | Couldn't resolve host name. |
| 2300007 | Couldn't connect to server. |
+| 2300008 | Weird server reply. |
+| 2300009 | Access denied to remote resource. |
+| 2300016 | Error in the HTTP2 framing layer. |
+| 2300018 | Transferred a partial file. |
+| 2300023 | Failed writing received data to disk/application. |
+| 2300025 | Upload failed. |
+| 2300026 | Failed to open/read local data from file/application. |
+| 2300027 | Out of memory. |
| 2300028 | Timeout was reached. |
+| 2300047 | Number of redirects hit maximum amount. |
| 2300052 | Server returned nothing (no headers, no data). |
+| 2300055 | Failed sending data to the peer. |
+| 2300056 | Failure when receiving data from the peer. |
+| 2300058 | Problem with the local SSL certificate. |
+| 2300059 | Couldn't use specified SSL cipher. |
+| 2300060 | SSL peer certificate or SSH remote key was not OK. |
+| 2300061 | Unrecognized or bad HTTP Content or Transfer-Encoding.|
+| 2300063 | Maximum file size exceeded. |
+| 2300070 | Disk full or allocation exceeded. |
+| 2300073 | Remote file already exists. |
+| 2300077 | Problem with the SSL CA cert (path? access rights?). |
+| 2300078 | Remote file not found. |
+| 2300094 | An authentication function returned an error. |
| 2300999 | Unknown Other Error. |
> **错误码说明:**
@@ -757,7 +806,7 @@ httpRequest.off('dataEnd');
### on('dataProgress')10+
-on(type: 'dataProgress', callback: AsyncCallback\<{ receiveSize: number, totalSize: number }\>): void
+on(type: 'dataProgress', callback: Callback\<{ receiveSize: number, totalSize: number }\>): void
订阅HTTP流式响应数据接收进度事件。
@@ -802,7 +851,7 @@ off(type: 'dataProgress', callback?: Callback\<{ receiveSize: number, totalSize:
httpRequest.off('dataProgress');
```
-## HttpRequestOptions
+## HttpRequestOptions6+
发起请求可选参数的类型和取值范围。
@@ -819,9 +868,10 @@ httpRequest.off('dataProgress');
| readTimeout | number | 否 | 读取超时时间。单位为毫秒(ms),默认为60000ms。 设置为0表示不会出现超时情况。 |
| connectTimeout | number | 否 | 连接超时时间。单位为毫秒(ms),默认为60000ms。 |
| usingProtocol9+ | [HttpProtocol](#httpprotocol9) | 否 | 使用协议。默认值由系统自动指定。 |
-| usingProxy10+ | boolean \| Object | 否 | 是否使用HTTP代理,默认为false,不使用代理。 - 当usingProxy为布尔类型true时,使用默认网络代理。 - 当usingProxy为object类型时,使用指定网络代理。 |
+| usingProxy10+ | boolean \| Object | 否 | 是否使用HTTP代理,默认为false,不使用代理。 - 当usingProxy为布尔类型true时,使用默认网络代理。 - 当usingProxy为object类型时,使用指定网络代理。
+| caPath10+ | string | 否 | 如果设置了此参数,系统将使用用户指定路径的CA证书,否则将使用系统预设CA证书。 |
-## RequestMethod
+## RequestMethod6+
HTTP 请求方法。
@@ -838,7 +888,7 @@ HTTP 请求方法。
| TRACE | "TRACE" | HTTP 请求 TRACE。 |
| CONNECT | "CONNECT" | HTTP 请求 CONNECT。 |
-## ResponseCode
+## ResponseCode6+
发起请求返回的响应码。
@@ -882,7 +932,7 @@ HTTP 请求方法。
| GATEWAY_TIMEOUT | 504 | 充当网关或代理的服务器,未及时从远端服务器获取请求。 |
| VERSION | 505 | 服务器请求的HTTP协议的版本。 |
-## HttpResponse
+## HttpResponse6+
request方法回调函数的返回值类型。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-i18n.md b/zh-cn/application-dev/reference/apis/js-apis-i18n.md
index 1ab0f3ee0be051fe56bb233261285db7f0c3b5ea..0be27fe71423a65251caed28e033ee29e7130c9e 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-i18n.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-i18n.md
@@ -46,7 +46,7 @@ static getDisplayCountry(country: string, locale: string, sentenceCase?: boolean
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -85,7 +85,7 @@ static getDisplayLanguage(language: string, locale: string, sentenceCase?: boole
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -116,7 +116,7 @@ static getSystemLanguages(): Array<string>
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -153,7 +153,7 @@ static getSystemCountries(language: string): Array<string>
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -191,7 +191,7 @@ static isSuggested(language: string, region?: string): boolean
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -222,7 +222,7 @@ static getSystemLanguage(): string
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -257,7 +257,7 @@ static setSystemLanguage(language: string): void
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -288,7 +288,7 @@ static getSystemRegion(): string
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -323,7 +323,7 @@ static setSystemRegion(region: string): void
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -354,7 +354,7 @@ static getSystemLocale(): string
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -389,7 +389,7 @@ static setSystemLocale(locale: string): void
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -420,7 +420,7 @@ static is24HourClock(): boolean
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -455,7 +455,7 @@ static set24HourClock(option: boolean): void
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -492,7 +492,7 @@ static addPreferredLanguage(language: string, index?: number): void
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -530,7 +530,7 @@ static removePreferredLanguage(index: number): void
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -563,7 +563,7 @@ static getPreferredLanguageList(): Array<string>
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -594,7 +594,7 @@ static getFirstPreferredLanguage(): string
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -625,7 +625,7 @@ static getAppPreferredLanguage(): string
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```js
@@ -660,7 +660,7 @@ static setUsingLocalDigit(flag: boolean): void
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```ts
@@ -691,7 +691,7 @@ static getUsingLocalDigit(): boolean
| 错误码ID | 错误信息 |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**示例:**
```ts
@@ -1737,6 +1737,35 @@ static getTimezoneFromCity(cityID: string): TimeZone
let timezone = I18n.TimeZone.getTimezoneFromCity("Shanghai");
```
+### getTimezonesByLocation10+
+
+static getTimezonesByLocation(longitude: number, latitude: number): Array<TimeZone>
+
+创建某经纬度对应的时区对象数组。
+
+**系统能力**:SystemCapability.Global.I18n
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --------- | ------ | ---- | ------ |
+| longitude | number | 是 | 经度, 范围[-180, 179.9), 东经取正值, 西经取负值 |
+| latitude | number | 是 | 纬度, 范围[-90, 89.9), 北纬取正值, 南纬取负值 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| -------- | ----------- |
+| Array<[TimeZone](#timezone)> | 时区对象的数组 |
+
+**示例:**
+ ```js
+ let timezoneArray = I18n.TimeZone.getTimezonesByLocation(-118.1, 34.0);
+ for (var i = 0; i < timezoneArray.length; i++) {
+ let tzId = timezoneArray[i].getID();
+ }
+ ```
+
## Transliterator9+
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-pacMap.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-pacMap.md
deleted file mode 100644
index aa62c06d90ec15bf2b2850c1c565736d31b6a069..0000000000000000000000000000000000000000
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-pacMap.md
+++ /dev/null
@@ -1,9 +0,0 @@
-## PacMap
-
-[key: string]: number | string | boolean | Array\ | null;
-
-**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| ------ | ------ | ------ | ------ |
-| [key: string] | number \| string \| boolean \| Array\ \| null | Yes| 数据存储在键值对中。|
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md
index b48ef3356be4ce1b9c009ade9c455f42f7b98057..dcb828119f243014f4f631962dc28484c759730a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md
@@ -1354,6 +1354,211 @@ startAbilityByCall(want: Want): Promise<Caller>;
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
+## UIAbilityContext.startRecentAbility
+
+startRecentAbility(want: Want, callback: AsyncCallback<void<): void;
+
+启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
+
+使用规则:
+ - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
+ - 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
+ - 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-want.md) | 是 | 需要启动Ability的want信息。 |
+| callback | AsyncCallback\ | 是 | 指定的回调函数的结果。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[errcode-ability](../errorcodes/errorcode-ability.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
+
+**示例:**
+
+ ```ts
+let want = {
+ bundleName: 'com.example.myapplication',
+ abilityName: 'EntryAbility'
+};
+
+try {
+ this.context.startRecentAbility(want, (err) => {
+ if (err.code) {
+ // 处理业务逻辑错误
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ // 执行正常业务
+ console.info('startRecentAbility succeed');
+ });
+} catch (err) {
+ // 处理入参错误异常
+ console.error(`startRecentAbility failed failed, code is ${err.code}, message is ${err.message}`);
+}
+ ```
+## UIAbilityContext.startRecentAbility
+
+startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback<void<): void;
+
+启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
+当开发者需要携带启动参数时可以选择此API。
+
+使用规则:
+ - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
+ - 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
+ - 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-want.md) | 是 | 需要启动Ability的want信息。 |
+| options | [StartOptions](js-apis-app-ability-startOptions.md) | 是 | 启动Ability所携带的参数。 |
+| callback | AsyncCallback\ | 是 | 指定的回调函数的结果。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[errcode-ability](../errorcodes/errorcode-ability.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
+
+**示例:**
+
+ ```ts
+let want = {
+ deviceId: '',
+ bundleName: 'com.example.myapplication',
+ abilityName: 'EntryAbility'
+};
+let options = {
+ windowMode: 0
+};
+
+try {
+ this.context.startRecentAbility(want, options, (err) => {
+ if (err.code) {
+ // 处理业务逻辑错误
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ // 执行正常业务
+ console.info('startRecentAbility succeed');
+ });
+} catch (err) {
+ // 处理入参错误异常
+ console.error(`startRecentAbility failed failed, code is ${err.code}, message is ${err.message}`);
+}
+ ```
+## UIAbilityContext.startRecentAbility
+
+startRecentAbility(want: Want, options?: StartOptions): Promise<void<;
+
+启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。
+当开发者期望启动结果以Promise形式返回时可以选择此API。
+
+使用规则:
+ - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
+ - 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
+ - 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-want.md) | 是 | 需要启动Ability的want信息。 |
+| options | [StartOptions](js-apis-app-ability-startOptions.md) | 否 | 启动Ability所携带的参数。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[errcode-ability](../errorcodes/errorcode-ability.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
+
+**示例:**
+
+ ```ts
+let want = {
+ bundleName: 'com.example.myapplication',
+ abilityName: 'EntryAbility'
+};
+let options = {
+ windowMode: 0,
+};
+
+try {
+ this.context.startRecentAbility(want, options)
+ .then(() => {
+ // 执行正常业务
+ console.info('startRecentAbility succeed');
+ })
+ .catch((err) => {
+ // 处理业务逻辑错误
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
+ });
+} catch (err) {
+ // 处理入参错误异常
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
+}
+ ```
## ServiceExtensionContext.startAbilityByCallWithAccount10+
@@ -1434,4 +1639,4 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise<Caller&
// 处理入参错误异常
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
- ```
+ ```
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
index 81dfbe08169b8e816f3627b2686db7ba16bc84d9..8b1f035bdc3a7d951b14db6080d348cf2de62e12 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
@@ -2312,6 +2312,211 @@ try {
} catch (err) {
// 处理入参错误异常
console.error(`requestDialogService failed, code is ${err.code}, message is ${err.message}`);
+}
+ ```
+ ## UIAbilityContext.startRecentAbility
+
+startRecentAbility(want: Want, callback: AsyncCallback<void<): void;
+
+启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
+
+使用规则:
+ - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
+ - 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
+ - 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-want.md) | 是 | 需要启动Ability的want信息。 |
+| callback | AsyncCallback\ | 是 | 指定的回调函数的结果。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[errcode-ability](../errorcodes/errorcode-ability.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
+
+**示例:**
+
+ ```ts
+let want = {
+ bundleName: 'com.example.myapplication',
+ abilityName: 'EntryAbility'
+};
+
+try {
+ this.context.startRecentAbility(want, (err) => {
+ if (err.code) {
+ // 处理业务逻辑错误
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ // 执行正常业务
+ console.info('startRecentAbility succeed');
+ });
+} catch (err) {
+ // 处理入参错误异常
+ console.error(`startRecentAbility failed failed, code is ${err.code}, message is ${err.message}`);
+}
+ ```
+## UIAbilityContext.startRecentAbility
+
+startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback<void<): void;
+
+启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
+当开发者需要携带启动参数时可以选择此API。
+
+使用规则:
+ - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
+ - 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
+ - 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-want.md) | 是 | 需要启动Ability的want信息。 |
+| options | [StartOptions](js-apis-app-ability-startOptions.md) | 是 | 启动Ability所携带的参数。 |
+| callback | AsyncCallback\ | 是 | 指定的回调函数的结果。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[errcode-ability](../errorcodes/errorcode-ability.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
+
+**示例:**
+
+ ```ts
+let want = {
+ deviceId: '',
+ bundleName: 'com.example.myapplication',
+ abilityName: 'EntryAbility'
+};
+let options = {
+ windowMode: 0
+};
+
+try {
+ this.context.startRecentAbility(want, options, (err) => {
+ if (err.code) {
+ // 处理业务逻辑错误
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ // 执行正常业务
+ console.info('startRecentAbility succeed');
+ });
+} catch (err) {
+ // 处理入参错误异常
+ console.error(`startRecentAbility failed failed, code is ${err.code}, message is ${err.message}`);
+}
+ ```
+## UIAbilityContext.startRecentAbility
+
+startRecentAbility(want: Want, options?: StartOptions): Promise<void<;
+
+启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。
+当开发者期望启动结果以Promise形式返回时可以选择此API。
+
+使用规则:
+ - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
+ - 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
+ - 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| want | [Want](js-apis-application-want.md) | 是 | 需要启动Ability的want信息。 |
+| options | [StartOptions](js-apis-app-ability-startOptions.md) | 否 | 启动Ability所携带的参数。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[errcode-ability](../errorcodes/errorcode-ability.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
+
+**示例:**
+
+ ```ts
+let want = {
+ bundleName: 'com.example.myapplication',
+ abilityName: 'EntryAbility'
+};
+let options = {
+ windowMode: 0,
+};
+
+try {
+ this.context.startRecentAbility(want, options)
+ .then(() => {
+ // 执行正常业务
+ console.info('startRecentAbility succeed');
+ })
+ .catch((err) => {
+ // 处理业务逻辑错误
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
+ });
+} catch (err) {
+ // 处理入参错误异常
+ console.error(`startRecentAbility failed, code is ${err.code}, message is ${err.message}`);
}
```
@@ -2394,4 +2599,4 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise<Caller&
// 处理入参错误异常
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
- ```
+ ```
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md
index e84f3b4abffbb032a8a79c489a780ad252158737..3fc9c0588ec58f4c0d5db27eb4cfade3d0607c32 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md
@@ -1,5 +1,10 @@
# CommonEventData
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
| 名称 | 类型 | 可读 | 可写 | 说明 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md
index 9d5fe786465e99ce4e85c49310943df600ccb8e6..70df6286eb1bf1877f40b9c37239522f9bc8d6b1 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md
@@ -1,5 +1,9 @@
# CommonEventPublishData
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
| 名称 | 类型 | 可读 | 可写 | 说明 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md
index 6938b5351b61ab96cf8d87cc78fc3333af21cfa6..1637fecf93afcdebf68884bbcd05539914258af0 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md
@@ -1,5 +1,9 @@
# CommonEventSubscribeInfo
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
**系统能力:** `SystemCapability.Notification.CommonEvent`
| 名称 | 类型 | 可读 | 可写 | 说明 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md
index 411b63e250403b1f5ee916d273f5306c88cda65c..caa6b850cd30c9ac9b7c331bef6c983ba33f5a23 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md
@@ -1,11 +1,40 @@
# CommonEventSubscriber
-## getCode
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
+## 使用说明
+
+在使用CommonEventSubscriber的功能前,需要通过CommonEvent.createSubscriber获取subscriber对象。
```ts
-getCode(callback: AsyncCallback): void
+import CommonEvent from '@ohos.commonEvent';
+let subscriber; // 用于保存创建成功的订阅者对象,后续使用其完成订阅及退订的动作
+
+// 订阅者信息
+let subscribeInfo = {
+ events: ["event"]
+};
+
+// 创建订阅者回调
+function createCB(err, commonEventSubscriber) {
+ if (err.code) {
+ console.error(`createSubscriber failed, code is ${err.code}`);
+ } else {
+ console.info("createSubscriber");
+ subscriber = commonEventSubscriber;
+ }
+}
+
+// 创建订阅者
+CommonEvent.createSubscriber(subscribeInfo, createCB);
```
+## getCode
+
+getCode(callback: AsyncCallback\): void
+
以回调形式获取公共事件代码。
**系统能力**:`SystemCapability.Notification.CommonEvent`
@@ -19,8 +48,6 @@ getCode(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//获取有序公共事件代码回调
function getCodeCB(err, code) {
if (err.code) {
@@ -34,9 +61,7 @@ subscriber.getCode(getCodeCB);
## getCode
-```ts
-getCode(): Promise
-```
+getCode(): Promise\
以Promise形式获取公共事件代码。
@@ -51,8 +76,6 @@ getCode(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.getCode().then((code) => {
console.info("getCode " + JSON.stringify(code));
}).catch((err) => {
@@ -62,9 +85,7 @@ subscriber.getCode().then((code) => {
## setCode
-```ts
-setCode(code: number, callback: AsyncCallback): void
-```
+setCode(code: number, callback: AsyncCallback\): void
以回调形式设置公共事件的代码。
@@ -80,8 +101,6 @@ setCode(code: number, callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//设置有序公共事件的代码回调
function setCodeCB(err) {
if (err.code) {
@@ -95,9 +114,7 @@ subscriber.setCode(1, setCodeCB);
## setCode
-```ts
-setCode(code: number): Promise
-```
+setCode(code: number): Promise\
以Promise形式设置公共事件的代码。
@@ -118,8 +135,6 @@ setCode(code: number): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.setCode(1).then(() => {
console.info("setCode");
}).catch((err) => {
@@ -129,9 +144,7 @@ subscriber.setCode(1).then(() => {
## getData
-```ts
-getData(callback: AsyncCallback): void
-```
+getData(callback: AsyncCallback\): void
以回调形式获取公共事件的数据。
@@ -146,8 +159,6 @@ getData(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//获取有序公共事件代码数据回调
function getDataCB(err, data) {
if (err.code) {
@@ -161,9 +172,7 @@ subscriber.getData(getDataCB);
## getData
-```ts
-getData(): Promise
-```
+getData(): Promise\
以Promise形式获取公共事件的数据。
@@ -178,8 +187,6 @@ getData(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.getData().then((data) => {
console.info("getData " + JSON.stringify(data));
}).catch((err) => {
@@ -205,8 +212,6 @@ setData(data: string, callback: AsyncCallback\): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//设置有序公共事件的结果数据回调
function setDataCB(err) {
if (err.code) {
@@ -220,9 +225,7 @@ subscriber.setData("publish_data_changed", setDataCB);
## setData
-```ts
-setData(data: string): Promise
-```
+setData(data: string): Promise\
以Promise形式设置公共事件的果数据。
@@ -243,8 +246,6 @@ setData(data: string): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.setData("publish_data_changed").then(() => {
console.info("setData");
}).catch((err) => {
@@ -254,9 +255,7 @@ subscriber.setData("publish_data_changed").then(() => {
## setCodeAndData
-```ts
-setCodeAndData(code: number, data: string, callback:AsyncCallback): void
-```
+setCodeAndData(code: number, data: string, callback:AsyncCallback\): void
以回调形式设置公共事件代码和数据。
@@ -273,8 +272,6 @@ setCodeAndData(code: number, data: string, callback:AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//设置有序公共事件的代码和数据回调
function setCodeDataCB(err) {
if (err.code) {
@@ -288,9 +285,7 @@ subscriber.setCodeAndData(1, "publish_data_changed", setCodeDataCB);
## setCodeAndData
-```ts
-setCodeAndData(code: number, data: string): Promise
-```
+setCodeAndData(code: number, data: string): Promise\
以Promise形式设置公共事件的代码和数据。
@@ -312,8 +307,6 @@ setCodeAndData(code: number, data: string): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.setCodeAndData(1, "publish_data_changed").then(() => {
console.info("setCodeAndData");
}).catch((err) => {
@@ -323,9 +316,7 @@ subscriber.setCodeAndData(1, "publish_data_changed").then(() => {
## isOrderedCommonEvent
-```ts
-isOrderedCommonEvent(callback: AsyncCallback): void
-```
+isOrderedCommonEvent(callback: AsyncCallback\): void
以回调形式查询当前公共事件的是否为有序公共事件。
@@ -342,8 +333,6 @@ isOrderedCommonEvent(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//获取当前公共事件是否为有序事件的回调
function isOrderedCB(err, isOrdered) {
if (err.code) {
@@ -357,9 +346,7 @@ subscriber.isOrderedCommonEvent(isOrderedCB);
## isOrderedCommonEvent
-```ts
-isOrderedCommonEvent(): Promise
-```
+isOrderedCommonEvent(): Promise\
以Promise形式查询当前公共事件的是否为有序公共事件。
@@ -376,8 +363,6 @@ isOrderedCommonEvent(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.isOrderedCommonEvent().then((isOrdered) => {
console.info("isOrdered " + JSON.stringify(isOrdered));
}).catch((err) => {
@@ -387,9 +372,7 @@ subscriber.isOrderedCommonEvent().then((isOrdered) => {
## isStickyCommonEvent
-```ts
-isStickyCommonEvent(callback: AsyncCallback): void
-```
+isStickyCommonEvent(callback: AsyncCallback\): void
以回调形式检查当前公共事件是否为一个粘性事件。
@@ -406,8 +389,6 @@ isStickyCommonEvent(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//获取当前公共事件是否为粘性事件的回调
function isStickyCB(err, isSticky) {
if (err.code) {
@@ -421,9 +402,7 @@ subscriber.isStickyCommonEvent(isStickyCB);
## isStickyCommonEvent
-```ts
-isStickyCommonEvent(): Promise
-```
+isStickyCommonEvent(): Promise\
以Promise形式检查当前公共事件是否为一个粘性事件。
@@ -440,8 +419,6 @@ isStickyCommonEvent(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.isStickyCommonEvent().then((isSticky) => {
console.info("isSticky " + JSON.stringify(isSticky));
}).catch((err) => {
@@ -451,9 +428,7 @@ subscriber.isStickyCommonEvent().then((isSticky) => {
## abortCommonEvent
-```ts
-abortCommonEvent(callback: AsyncCallback): void
-```
+abortCommonEvent(callback: AsyncCallback\): void
以回调形式取消当前的有序公共事件,取消后,有序公共事件不再向下一个订阅者传递。
@@ -468,8 +443,6 @@ abortCommonEvent(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//取消当前有序公共事件的回调
function abortCB(err) {
if (err.code) {
@@ -483,9 +456,7 @@ subscriber.abortCommonEvent(abortCB);
## abortCommonEvent
-```ts
-abortCommonEvent(): Promise
-```
+abortCommonEvent(): Promise\
以Promise形式取消当前的有序公共事件,取消后,公共事件不再向下一个订阅者传递。
@@ -500,8 +471,6 @@ abortCommonEvent(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.abortCommonEvent().then(() => {
console.info("abortCommonEvent");
}).catch((err) => {
@@ -511,9 +480,7 @@ subscriber.abortCommonEvent().then(() => {
## clearAbortCommonEvent
-```ts
-clearAbortCommonEvent(callback: AsyncCallback): void
-```
+clearAbortCommonEvent(callback: AsyncCallback\): void
以回调形式清除当前有序公共事件。
@@ -528,8 +495,6 @@ clearAbortCommonEvent(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//清除当前公共事件取消状态的回调
function clearAbortCB(err) {
if (err.code) {
@@ -543,9 +508,7 @@ subscriber.clearAbortCommonEvent(clearAbortCB);
## clearAbortCommonEvent
-```ts
-clearAbortCommonEvent(): Promise
-```
+clearAbortCommonEvent(): Promise\
以Promise形式清除当前有序公共事件。
@@ -560,8 +523,6 @@ clearAbortCommonEvent(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.clearAbortCommonEvent().then(() => {
console.info("clearAbortCommonEvent");
}).catch((err) => {
@@ -571,9 +532,7 @@ subscriber.clearAbortCommonEvent().then(() => {
## getAbortCommonEvent
-```ts
-getAbortCommonEvent(callback: AsyncCallback): void
-```
+getAbortCommonEvent(callback: AsyncCallback\): void
以回调形式获取当前有序公共事件是否取消的状态。
@@ -588,8 +547,6 @@ getAbortCommonEvent(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//获取当前有序公共事件是否取消的回调
function getAbortCB(err, abortEvent) {
if (err.code) {
@@ -603,9 +560,7 @@ subscriber.getAbortCommonEvent(getAbortCB);
## getAbortCommonEvent
-```ts
-getAbortCommonEvent(): Promise
-```
+getAbortCommonEvent(): Promise\
以Promise形式获取当前有序公共事件是否取消的状态。
@@ -620,8 +575,6 @@ getAbortCommonEvent(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.getAbortCommonEvent().then((abortEvent) => {
console.info("abortCommonEvent " + JSON.stringify(abortEvent));
}).catch((err) => {
@@ -631,9 +584,7 @@ subscriber.getAbortCommonEvent().then((abortEvent) => {
## getSubscribeInfo
-```ts
-getSubscribeInfo(callback: AsyncCallback): void
-```
+getSubscribeInfo(callback: AsyncCallback\): void
以回调形式获取订阅者的订阅信息。
@@ -648,8 +599,6 @@ getSubscribeInfo(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//获取订阅者信息回调
function getCB(err, subscribeInfo) {
if (err.code) {
@@ -663,9 +612,7 @@ subscriber.getSubscribeInfo(getCB);
## getSubscribeInfo
-```ts
-getSubscribeInfo(): Promise
-```
+getSubscribeInfo(): Promise\
以Promise形式获取订阅者的订阅信息。
@@ -680,8 +627,6 @@ getSubscribeInfo(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.getSubscribeInfo().then((subscribeInfo) => {
console.info("subscribeInfo " + JSON.stringify(subscribeInfo));
}).catch((err) => {
@@ -691,9 +636,7 @@ subscriber.getSubscribeInfo().then((subscribeInfo) => {
## finishCommonEvent9+
-```ts
-finishCommonEvent(callback: AsyncCallback): void
-```
+finishCommonEvent(callback: AsyncCallback\): void
以回调形式结束当前有序公共事件。
@@ -708,14 +651,13 @@ finishCommonEvent(callback: AsyncCallback): void
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
//结束当前有序公共事件的回调
function finishCB(err) {
if (err.code) {
console.error(`finishCommonEvent failed, code is ${err.code}, message is ${err.message}`);
-} else {
+ } else {
console.info("FinishCommonEvent");
+ }
}
subscriber.finishCommonEvent(finishCB);
@@ -723,9 +665,7 @@ subscriber.finishCommonEvent(finishCB);
## finishCommonEvent9+
-```ts
-finishCommonEvent(): Promise
-```
+finishCommonEvent(): Promise\
以Promise形式结束当前有序公共事件。
@@ -740,8 +680,6 @@ finishCommonEvent(): Promise
**示例:**
```ts
-let subscriber; //创建成功的订阅者对象
-
subscriber.finishCommonEvent().then(() => {
console.info("FinishCommonEvent");
}).catch((err) => {
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md
index d822600d6939bf2c981a1ddbd611d2d6672816ca..be9c2739273588cdf154fe67e15c2934bde3253b 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md
@@ -8,9 +8,9 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| --------- | ----------------------------------------------- | --- | ---- | ------------------------- |
-| title | string | 是 | 是 | 按钮标题。 |
-| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | 是 | 是 | 点击按钮时触发的WantAgent。 |
-| extras | { [key: string]: any } | 是 | 是 | 按钮扩展信息。 |
-| userInput8+ | [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md) | 是 | 是 | 用户输入对象实例。 |
+| title | string | 否 | 是 | 按钮标题。 |
+| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | 否 | 是 | 点击按钮时触发的WantAgent。 |
+| extras | { [key: string]: any } | 否 | 否 | 按钮扩展信息。 |
+| userInput8+ | [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md) | 否 | 否 | 用户输入对象实例。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md
index 5d3e7eee4755935751d1aaa1859fa16d3663197b..3752302faafe6429b6a8704783285ac3a897e896 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md
@@ -10,7 +10,7 @@ BundleOption模块为指定应用的包信息。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 必填 | 说明 |
-| ------ | ------ |---- | ------ |
-| bundle | string | 是 | 应用的包信息。 |
-| uid | number | 否 | 用户ID。 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
+| ------ | ------ | ---- | ---- | ------ |
+| bundle | string | 否 | 是 | 应用的包信息。 |
+| uid | number | 否 | 否 | 用户ID。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md
index be8496b25a4909e2c7f2796e7e98c1381b50dfe1..a8d6d31263f2ca8ea3ebc530856d3a5336b4ab80 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md
@@ -8,13 +8,13 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| ----------- | ------------------------------------------------------------ | ---- | --- | ------------------ |
-| contentType | [ContentType](./js-apis-notificationManager.md#contenttype) | 是 | 是 | 通知内容类型。 |
-| normal | [NotificationBasicContent](#notificationbasiccontent) | 是 | 是 | 基本类型通知内容。 |
-| longText | [NotificationLongTextContent](#notificationlongtextcontent) | 是 | 是 | 长文本类型通知内容。 |
-| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | 是 | 是 | 多行类型通知内容。 |
-| picture | [NotificationPictureContent](#notificationpicturecontent) | 是 | 是 | 图片类型通知内容。 |
+| contentType | [ContentType](./js-apis-notificationManager.md#contenttype) | 否 | 是 | 通知内容类型。 |
+| normal | [NotificationBasicContent](#notificationbasiccontent) | 否 | 否 | 基本类型通知内容。 |
+| longText | [NotificationLongTextContent](#notificationlongtextcontent) | 否 | 否 | 长文本类型通知内容。 |
+| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | 否 | 否 | 多行类型通知内容。 |
+| picture | [NotificationPictureContent](#notificationpicturecontent) | 否 | 否 | 图片类型通知内容。 |
## NotificationBasicContent
@@ -22,11 +22,11 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| -------------- | ------ | ---- | ---- | ---------------------------------- |
-| title | string | 是 | 是 | 通知标题。 |
-| text | string | 是 | 是 | 通知内容。 |
-| additionalText | string | 是 | 是 | 通知附加内容,是对通知内容的补充。 |
+| title | string | 否 | 是 | 通知标题。 |
+| text | string | 否 | 是 | 通知内容。 |
+| additionalText | string | 否 | 否 | 通知附加内容,是对通知内容的补充。 |
## NotificationLongTextContent
@@ -35,14 +35,14 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| -------------- | ------ | ---- | --- | -------------------------------- |
-| title | string | 是 | 是 | 通知标题。 |
-| text | string | 是 | 是 | 通知内容。 |
-| additionalText | string | 是 | 是 | 通知附加内容,是对通知内容的补充。 |
-| longText | string | 是 | 是 | 通知的长文本。 |
-| briefText | string | 是 | 是 | 通知概要内容,是对通知内容的总结。 |
-| expandedTitle | string | 是 | 是 | 通知展开时的标题。 |
+| title | string | 否 | 是 | 通知标题。 |
+| text | string | 否 | 是 | 通知内容。 |
+| additionalText | string | 否 | 否 | 通知附加内容,是对通知内容的补充。 |
+| longText | string | 否 | 是 | 通知的长文本。 |
+| briefText | string | 否 | 是 | 通知概要内容,是对通知内容的总结。 |
+| expandedTitle | string | 否 | 是 | 通知展开时的标题。 |
## NotificationMultiLineContent
@@ -53,12 +53,12 @@
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------------- | --------------- | --- | --- | -------------------------------- |
-| title | string | 是 | 是 | 通知标题。 |
-| text | string | 是 | 是 | 通知内容。 |
-| additionalText | string | 是 | 是 | 通知附加内容,是对通知内容的补充。 |
-| briefText | string | 是 | 是 | 通知概要内容,是对通知内容的总结。 |
-| longTitle | string | 是 | 是 | 通知展开时的标题。 |
-| lines | Array\ | 是 | 是 | 通知的多行文本。 |
+| title | string | 否 | 是 | 通知标题。 |
+| text | string | 否 | 是 | 通知内容。 |
+| additionalText | string | 否 | 否 | 通知附加内容,是对通知内容的补充。 |
+| briefText | string | 否 | 是 | 通知概要内容,是对通知内容的总结。 |
+| longTitle | string | 否 | 是 | 通知展开时的标题。 |
+| lines | Array\ | 否 | 是 | 通知的多行文本。 |
## NotificationPictureContent
@@ -69,9 +69,9 @@
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------------- | -------------- | ---- | --- | -------------------------------- |
-| title | string | 是 | 是 | 通知标题。 |
-| text | string | 是 | 是 | 通知内容。 |
-| additionalText | string | 是 | 是 | 通知附加内容,是对通知内容的补充。 |
-| briefText | string | 是 | 是 | 通知概要内容,是对通知内容的总结。 |
-| expandedTitle | string | 是 | 是 | 通知展开时的标题。 |
-| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 是 | 通知的图片内容。 |
+| title | string | 否 | 是 | 通知标题。 |
+| text | string | 否 | 是 | 通知内容。 |
+| additionalText | string | 否 | 否 | 通知附加内容,是对通知内容的补充。 |
+| briefText | string | 否 | 是 | 通知概要内容,是对通知内容的总结。 |
+| expandedTitle | string | 否 | 是 | 通知展开时的标题。 |
+| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | 否 | 是 | 通知的图片内容。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md
index 1dfc0990395386c786064be441c7c413d2fc744c..ba8870be4249237fda3ceb64b1ccb3f0b934c97d 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md
@@ -8,7 +8,7 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| ---------------- | ---------------------- | ---- | ---- | --------------------------------- |
| soundEnabled | [NotificationFlagStatus](#notificationflagstatus) | 是 | 否 | 是否启用声音提示。 |
| vibrationEnabled | [NotificationFlagStatus](#notificationflagstatus) | 是 | 否 | 是否启用振动提醒功能。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md
index 1646bccbb08f5b6bbdfd336021bc288fd3b322c6..a4faf72799f3871cbbf2451742c8338773d2adf7 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md
@@ -8,45 +8,45 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| --------------------- | --------------------------------------------- | ---- | --- | -------------------------- |
-| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | 是 | 是 | 通知内容。 |
-| id | number | 是 | 是 | 通知ID。 |
-| slotType | [SlotType](js-apis-notificationManager.md#slottype) | 是 | 是 | 通道类型。 |
-| isOngoing | boolean | 是 | 是 | 是否进行时通知。 |
-| isUnremovable | boolean | 是 | 是 | 是否可移除。 |
-| deliveryTime | number | 是 | 是 | 通知发送时间。 |
-| tapDismissed | boolean | 是 | 是 | 通知是否自动清除。 |
-| autoDeletedTime | number | 是 | 是 | 自动清除的时间。 |
-| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | 是 | 是 | WantAgent封装了应用的行为意图,点击通知时触发该行为。 |
-| extraInfo | {[key: string]: any} | 是 | 是 | 扩展参数。 |
-| color | number | 是 | 是 | 通知背景颜色。预留能力,暂未支持。 |
-| colorEnabled | boolean | 是 | 是 | 通知背景颜色是否使能。预留能力,暂未支持。 |
-| isAlertOnce | boolean | 是 | 是 | 设置是否仅有一次此通知提醒。 |
-| isStopwatch | boolean | 是 | 是 | 是否显示已用时间。 |
-| isCountDown | boolean | 是 | 是 | 是否显示倒计时时间。 |
-| isFloatingIcon | boolean | 是 | 是 | 是否显示状态栏图标。 |
-| label | string | 是 | 是 | 通知标签。 |
-| badgeIconStyle | number | 是 | 是 | 通知角标类型。预留能力,暂未支持。 |
-| showDeliveryTime | boolean | 是 | 是 | 是否显示分发时间。 |
-| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | 是 | 是 | 通知按钮,最多三个按钮。 |
-| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 是 | 通知小图标。可选字段,大小不超过30KB。 |
-| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 是 | 通知大图标。可选字段,大小不超过30KB。 |
+| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | 否 | 是 | 通知内容。 |
+| id | number | 否 | 否 | 通知ID。 |
+| slotType | [SlotType](js-apis-notificationManager.md#slottype) | 是 | 否 | 通道类型。 |
+| isOngoing | boolean | 否 | 否 | 是否进行时通知。 |
+| isUnremovable | boolean | 否 | 否 | 是否可移除。 |
+| deliveryTime | number | 否 | 否 | 通知发送时间。 |
+| tapDismissed | boolean | 否 | 否 | 通知是否自动清除。 |
+| autoDeletedTime | number | 否 | 否 | 自动清除的时间。 |
+| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | 否 | 否 | WantAgent封装了应用的行为意图,点击通知时触发该行为。 |
+| extraInfo | {[key: string]: any} | 否 | 否 | 扩展参数。 |
+| color | number | 否 | 否 | 通知背景颜色。预留能力,暂未支持。 |
+| colorEnabled | boolean | 否 | 否 | 通知背景颜色是否使能。预留能力,暂未支持。 |
+| isAlertOnce | boolean | 否 | 否 | 设置是否仅有一次此通知提醒。 |
+| isStopwatch | boolean | 否 | 否 | 是否显示已用时间。 |
+| isCountDown | boolean | 否 | 否 | 是否显示倒计时时间。 |
+| isFloatingIcon | boolean | 否 | 否 | 是否显示状态栏图标。 |
+| label | string | 否 | 否 | 通知标签。 |
+| badgeIconStyle | number | 否 | 否 | 通知角标类型。预留能力,暂未支持。 |
+| showDeliveryTime | boolean | 否 | 否 | 是否显示分发时间。 |
+| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | 否 | 否 | 通知按钮,最多三个按钮。 |
+| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | 否 | 否 | 通知小图标。可选字段,大小不超过30KB。 |
+| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | 否 | 否 | 通知大图标。可选字段,大小不超过30KB。 |
| creatorBundleName | string | 是 | 否 | 创建通知的包名。 |
| creatorUid8+ | number | 是 | 否 | 创建通知的UID。 |
| creatorPid | number | 是 | 否 | 创建通知的PID。 |
-| creatorUserId| number | 是 | 否 | 创建通知的UserId。 |
+| creatorUserId | number | 是 | 否 | 创建通知的UserId。 |
| hashCode | string | 是 | 否 | 通知唯一标识。 |
-| classification | string | 是 | 是 | 通知分类。 **系统API**: 此接口为系统接口,三方应用不支持调用。 |
-| groupName8+ | string | 是 | 是 | 组通知名称。 |
-| template8+ | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | 是 | 是 | 通知模板。 |
+| classification | string | 否 | 否 | 通知分类。 **系统API**: 此接口为系统接口,三方应用不支持调用。 |
+| groupName8+ | string | 否 | 否 | 组通知名称。 |
+| template8+ | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | 否 | 否 | 通知模板。 |
| isRemoveAllowed8+ | boolean | 是 | 否 | 通知是否能被移除。 **系统API**: 此接口为系统接口,三方应用不支持调用。 |
| source8+ | number | 是 | 否 | 通知源。 **系统API**: 此接口为系统接口,三方应用不支持调用。 |
-| distributedOption8+ | [DistributedOptions](#distributedoptions) | 是 | 是 | 分布式通知的选项。 |
+| distributedOption8+ | [DistributedOptions](#distributedoptions) | 否 | 否 | 分布式通知的选项。 |
| deviceId8+ | string | 是 | 否 | 通知源的deviceId。 **系统API**: 此接口为系统接口,三方应用不支持调用。 |
-| notificationFlags8+ | [NotificationFlags](js-apis-inner-notification-notificationflags#notificationFlags) | 是 | 否 | 获取NotificationFlags。 |
-| removalWantAgent9+ | [WantAgent](js-apis-app-ability-wantAgent.md) | 是 | 是 | 当移除通知时,通知将被重定向到的WantAgent实例。 |
-| badgeNumber9+ | number | 是 | 是 | 应用程序图标上显示的通知数。 |
+| notificationFlags8+ | [NotificationFlags](js-apis-inner-notification-notificationFlags.md#notificationflags) | 是 | 否 | 获取NotificationFlags。 |
+| removalWantAgent9+ | [WantAgent](js-apis-app-ability-wantAgent.md) | 否 | 否 | 当移除通知时,通知将被重定向到的WantAgent实例。 |
+| badgeNumber9+ | number | 否 | 否 | 应用程序图标上显示的通知数。 |
## DistributedOptions
@@ -55,9 +55,9 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| ---------------------- | -------------- | ---- | ---- | ---------------------------------- |
-| isDistributed8+ | boolean | 是 | 是 | 是否为分布式通知。 |
-| supportDisplayDevices8+ | Array\ | 是 | 是 | 可以同步通知到的设备列表。 |
-| supportOperateDevices8+ | Array\ | 是 | 是 | 可以打开通知的设备列表。 |
+| isDistributed8+ | boolean | 否 | 否 | 是否为分布式通知。 |
+| supportDisplayDevices8+ | Array\ | 否 | 否 | 可以同步通知到的设备列表。 |
+| supportOperateDevices8+ | Array\ | 否 | 否 | 可以打开通知的设备列表。 |
| remindType8+ | number | 是 | 否 | 通知的提醒方式。 **系统API**: 此接口为系统接口,三方应用不支持调用。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md
index 27d5aec3672ee7caa0eefd640153f3ee70514a3a..b0ff35c59d2014fbd8b1565ea4436d58c7c6c58f 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md
@@ -8,17 +8,17 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| -------------------- | --------------------- | ---- | --- | ------------------------------------------ |
-| type | [SlotType](js-apis-notificationManager.md#slottype) | 是 | 是 | 通道类型。 |
-| level | number | 是 | 是 | 通知级别,不设置则根据通知渠道类型有默认值。 |
-| desc | string | 是 | 是 | 通知渠道描述信息。 |
-| badgeFlag | boolean | 是 | 是 | 是否显示角标。 |
-| bypassDnd | boolean | 是 | 是 | 置是否在系统中绕过免打扰模式。 |
-| lockscreenVisibility | number | 是 | 是 | 在锁定屏幕上显示通知的模式。 |
-| vibrationEnabled | boolean | 是 | 是 | 是否可振动。 |
-| sound | string | 是 | 是 | 通知提示音。 |
-| lightEnabled | boolean | 是 | 是 | 是否闪灯。 |
-| lightColor | number | 是 | 是 | 通知灯颜色。 |
-| vibrationValues | Array\ | 是 | 是 | 通知振动样式。 |
+| type | [SlotType](js-apis-notificationManager.md#slottype) | 否 | 是 | 通道类型。 |
+| level | number | 否 | 否 | 通知级别,不设置则根据通知渠道类型有默认值。 |
+| desc | string | 否 | 否 | 通知渠道描述信息。 |
+| badgeFlag | boolean | 否 | 否 | 是否显示角标。 |
+| bypassDnd | boolean | 否 | 否 | 置是否在系统中绕过免打扰模式。 |
+| lockscreenVisibility | number | 否 | 否 | 在锁定屏幕上显示通知的模式。 |
+| vibrationEnabled | boolean | 否 | 否 | 是否可振动。 |
+| sound | string | 否 | 否 | 通知提示音。 |
+| lightEnabled | boolean | 否 | 否 | 是否闪灯。 |
+| lightColor | number | 否 | 否 | 通知灯颜色。 |
+| vibrationValues | Array\ | 否 | 否 | 通知振动样式。 |
| enabled9+ | boolean | 是 | 否 | 此通知插槽中的启停状态。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md
new file mode 100644
index 0000000000000000000000000000000000000000..70f9c43710d183ff680304f7622b0b17cd771c67
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md
@@ -0,0 +1,17 @@
+# NotificationSorting
+
+提供有关活动通知的排序信息。
+
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
+**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
+
+**系统接口**: 以下为系统接口,三方应用不支持调用。
+
+| 名称 | 类型 | 只读 | 必填 | 说明 |
+| -------------------- | --------------------- | ---- | --- | ------------------------------------------ |
+| slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | 是 | 是 | 通道类型。 |
+| level | number | 是 | 是 | 通知级别,不设置则根据通知渠道类型有默认值。 |
+| desc | string | 是 | 是 | 通知渠道描述信息。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md
new file mode 100644
index 0000000000000000000000000000000000000000..83a7e9c793a22fad440c7fac7568cb20c50aa5cb
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md
@@ -0,0 +1,16 @@
+# NotificationSortingMap
+
+提供有关已订阅的所有通知中的活动通知的排序信息。
+
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
+**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
+
+**系统接口**: 以下为系统接口,三方应用不支持调用。
+
+| 名称 | 类型 | 只读 | 必填 | 说明 |
+| -------------------- | --------------------- | ---- | --- | ------------------------------------------ |
+| sortings | { [key: string]: [NotificationSorting](js-apis-inner-notification-notificationSorting.md) } | 是 | 是 | 通知排序信息。 |
+| sortedHashCode | Array | 是 | 是 | 通知排序的HashCode。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md
new file mode 100644
index 0000000000000000000000000000000000000000..58977595bb7fa9e3713dd56d4783fa951716cc2d
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md
@@ -0,0 +1,16 @@
+# NotificationSubscribeInfo
+
+通知发布者的信息。
+
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
+**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
+
+**系统接口**: 以下为系统接口,三方应用不支持调用。
+
+| 名称 | 类型 | 只读 | 必填 | 说明 |
+| -------------------- | --------------------- | ---- | --- | ------------------------------------------ |
+| bundleNames | Array | 否 | 否 | 应用Bundle名称。 |
+| userId | number | 否 | 否 | 用户ID。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md
new file mode 100644
index 0000000000000000000000000000000000000000..0f5b5f687a4aec8c51b56e283bef2ed271915c13
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md
@@ -0,0 +1,397 @@
+## NotificationSubscriber
+
+作为订阅通知接口[subscribe](js-apis-notificationSubscribe.md)的入参,提供订阅者接收到新通知、取消通知等的回调方法。
+
+> **说明:**
+>
+> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
+**系统API**:此接口为系统接口,三方应用不支持调用。
+
+### onConsume
+
+onConsume?: (data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void
+
+接收到新通知的回调函数。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统接口**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| ------------ | ------------------------ | ---- | -------------------------- |
+| data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | 是 | 新接收到的通知信息。 |
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onConsumeCallback(data) {
+ console.info('===> onConsume in test');
+ let req = data.request;
+ console.info('===> onConsume callback req.id:' + req.id);
+};
+
+let subscriber = {
+ onConsume: onConsumeCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+### onCancel
+
+onCancel?:(data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void
+
+取消通知的回调函数。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| ------------ | ------------------------ | ---- | -------------------------- |
+| data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | 是 | 需要取消的通知信息。 |
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onCancelCallback(data) {
+ console.info('===> onCancel in test');
+ let req = data.request;
+ console.info('===> onCancel callback req.id:' + req.id);
+}
+
+let subscriber = {
+ onCancel: onCancelCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+### onUpdate
+
+onUpdate?:(data: [NotificationSortingMap](js-apis-notification.md#notificationsortingmap)) => void
+
+更新通知排序的回调函数。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| ------------ | ------------------------ | ---- | -------------------------- |
+| data | [NotificationSortingMap](js-apis-notification.md#notificationsortingmap) | 是 | 最新的通知排序列表。 |
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onUpdateCallback(map) {
+ console.info('===> onUpdateCallback map:' + JSON.stringify(map));
+}
+
+let subscriber = {
+ onUpdate: onUpdateCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+### onConnect
+
+onConnect?:() => void
+
+订阅完成的回调函数。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onConnectCallback() {
+ console.info('===> onConnect in test');
+}
+
+let subscriber = {
+ onConnect: onConnectCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+### onDisconnect
+
+onDisconnect?:() => void
+
+取消订阅的回调函数。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+function unsubscribeCallback(err) {
+ if (err.code) {
+ console.error(`unsubscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("unsubscribeCallback");
+ }
+};
+
+function onConnectCallback() {
+ console.info('===> onConnect in test');
+}
+function onDisconnectCallback() {
+ console.info('===> onDisconnect in test');
+}
+
+let subscriber = {
+ onConnect: onConnectCallback,
+ onDisconnect: onDisconnectCallback
+};
+
+// 订阅通知后会收到onConnect回调
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+// 取消订阅后会收到onDisconnect回调
+notificationSubscribe.unsubscribe(subscriber, unsubscribeCallback);
+```
+
+### onDestroy
+
+onDestroy?:() => void
+
+服务失联回调函数。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onDestroyCallback() {
+ console.info('===> onDestroy in test');
+}
+
+let subscriber = {
+ onDestroy: onDestroyCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+### onDoNotDisturbDateChange8+
+
+onDoNotDisturbDateChange?:(mode: notification.[DoNotDisturbDate](js-apis-notificationManager.md#donotdisturbdate)) => void
+
+免打扰时间选项发生变更时的回调函数。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| ------------ | ------------------------ | ---- | -------------------------- |
+| mode | notification.[DoNotDisturbDate](js-apis-notificationManager.md#DoNotDisturbDate) | 是 | 回调返回免打扰时间选项变更。 |
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onDoNotDisturbDateChangeCallback(mode) {
+ console.info('===> onDoNotDisturbDateChange:' + mode);
+}
+
+let subscriber = {
+ onDoNotDisturbDateChange: onDoNotDisturbDateChangeCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+
+### onEnabledNotificationChanged8+
+
+onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata)) => void
+
+监听应用通知使能变化。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| ------------ | ------------------------ | ---- | -------------------------- |
+| callback | AsyncCallback\<[EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata)\> | 是 | 回调返回监听到的应用信息。 |
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onEnabledNotificationChangedCallback(callbackData) {
+ console.info("bundle: ", callbackData.bundle);
+ console.info("uid: ", callbackData.uid);
+ console.info("enable: ", callbackData.enable);
+};
+
+let subscriber = {
+ onEnabledNotificationChanged: onEnabledNotificationChangedCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+### onBadgeChanged10+
+
+ onBadgeChanged?:(data: [BadgeNumberCallbackData](#badgenumbercallbackdata10)) => void
+
+监听应用角标个数变化。
+
+**系统能力**:SystemCapability.Notification.Notification
+
+**系统API**: 此接口为系统接口,三方应用不支持调用。
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | ------------------------------------------------------------ | ---- | -------------------------- |
+| callback | AsyncCallback\<[BadgeNumberCallbackData](#badgenumbercallbackdata10)\> | 是 | 回调返回监听到的应用信息。 |
+
+**示例:**
+
+```javascript
+function subscribeCallback(err) {
+ if (err) {
+ console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
+ } else {
+ console.info("subscribeCallback");
+ }
+};
+
+function onBadgeChangedCallback(data) {
+ console.info("bundle: ", data.bundle);
+ console.info("uid: ", data.uid);
+ console.info("badgeNumber: ", data.badgeNumber);
+};
+
+let subscriber = {
+ onBadgeChanged: onBadgeChangedCallback
+};
+
+notificationSubscribe.subscribe(subscriber, subscribeCallback);
+```
+
+## SubscribeCallbackData
+
+**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
+
+**系统API**:此接口为系统接口,三方应用不支持调用。
+
+| 名称 | 类型 | 只读 | 必传 | 说明 |
+| --------------- | ------------------------------------------------- | ---- | --- | -------- |
+| request | [NotificationRequest](js-apis-inner-notification-notificationRequest#notificationrequest) | 是 | 是 | 通知内容。 |
+| sortingMap | [NotificationSortingMap](js-apis-inner-notification-notificationSortingMap.md) | 是 | 否 | 通知排序信息。 |
+| reason | number | 是 | 否 | 删除原因。 |
+| sound | string | 是 | 否 | 通知声音。 |
+| vibrationValues | Array\ | 是 | 否 | 通知震动。 |
+
+
+## EnabledNotificationCallbackData8+
+
+**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
+
+**系统API**:此接口为系统接口,三方应用不支持调用。
+
+| 名称 | 类型 | 只读 | 必传 | 说明 |
+| ------ | ------- | ---- | --- | ---------------- |
+| bundle | string | 是 | 是 | 应用的包名。 |
+| uid | number | 是 | 是 | 应用的uid。 |
+| enable | boolean | 是 | 是 | 应用通知使能状态。 |
+
+
+## BadgeNumberCallbackData10+
+
+**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
+
+**系统API**:此接口为系统接口,三方应用不支持调用。
+
+| 名称 | 类型 | 只读 | 必传 | 描述 |
+| ----------- | ------ | ---- | ---- | ------------ |
+| bundle | string | 是 | 是 | 应用的包名。 |
+| uid | number | 是 | 是 | 应用的uid。 |
+| badgeNumber | number | 是 | 是 | 角标个数。 |
+
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md
index 58e9d4442712e965f56d6837de8d9cbfef010544..bd1c262c5417cd745f0ea0d711a09bc93141f2c5 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md
@@ -8,7 +8,7 @@
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| ---- | ---------------------- | ---- | ---- | ---------- |
-| name | string | 是 | 是 | 模板名称。 |
-| data | {[key:string]: Object} | 是 | 是 | 模板数据。 |
+| name | string | 否 | 是 | 模板名称。 |
+| data | {[key:string]: Object} | 否 | 是 | 模板数据。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md
index bc60f868ba6d787cbacf2b79e50102b7f06cb103..6623fad27f64660cfadff9e79813f152e3f01f72 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md
@@ -8,6 +8,6 @@
**系统能力**:SystemCapability.Notification.Notification
-| 名称 | 类型 | 可读 | 可写 | 说明 |
+| 名称 | 类型 | 只读 | 必填 | 说明 |
| -------- | ------ | --- | ---- | ----------------------------- |
-| inputKey | string | 是 | 是 | 用户输入时用于标识此输入的key。 |
+| inputKey | string | 否 | 是 | 用户输入时用于标识此输入的key。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-intl.md b/zh-cn/application-dev/reference/apis/js-apis-intl.md
index 1065a275779112f4950ce0c8316c02699444c798..5bcda43625069ad5d3e6ee3d258c3f1b222731f4 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-intl.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-intl.md
@@ -67,7 +67,7 @@ constructor(locale: string, options?: LocaleOptions)
| 参数名 | 类型 | 必填 | 说明 |
| -------------------- | -------------------------------- | ---- | ---------------------------- |
| locale | string | 是 | 包含区域信息的字符串,包括语言以、脚本、国家或地区。语言、脚本、国家或地区的国际标准及组合方式请见[Intl开发指导](../../internationalization/intl-guidelines.md#设置区域信息) |
-| options9+ | [LocaleOptions](#localeoptions9) | 否 | 用于创建区域对象的选项。 |
+| options | [LocaleOptions](#localeoptions6) | 否 | 用于创建区域对象的选项。 |
**示例:**
```js
@@ -159,9 +159,10 @@ minimize(): Locale
```
-## LocaleOptions9+
+## LocaleOptions6+
表示区域初始化选项。
+在API9中,LocaleOptions中的属性修改为可选属性。
**系统能力**:SystemCapability.Global.I18n
@@ -206,7 +207,7 @@ constructor(locale: string | Array<string>, options?: DateTimeOptions)
| 参数名 | 类型 | 必填 | 说明 |
| -------------------- | ------------------------------------ | ---- | ---------------------------- |
| locale | string \| Array<string> | 是 | 包含区域设置信息的字符串,包括语言以及可选的脚本和区域。 |
-| options9+ | [DateTimeOptions](#datetimeoptions9) | 否 | 用于创建时间日期格式化的选项。 |
+| options | [DateTimeOptions](#datetimeoptions6) | 否 | 用于创建时间日期格式化的选项。 |
**示例:**
```js
@@ -298,7 +299,7 @@ resolvedOptions(): DateTimeOptions
| 类型 | 说明 |
| ------------------------------------ | ----------------------------- |
-| [DateTimeOptions](#datetimeoptions9) | DateTimeFormat 对象的格式化选项。 |
+| [DateTimeOptions](#datetimeoptions6) | DateTimeFormat 对象的格式化选项。 |
**示例:**
```js
@@ -310,9 +311,10 @@ resolvedOptions(): DateTimeOptions
```
-## DateTimeOptions9+
+## DateTimeOptions6+
表示时间日期格式化选项。
+在API9中,DateTimeOptions中的属性修改为可选属性。
**系统能力**:SystemCapability.Global.I18n
@@ -370,7 +372,7 @@ constructor(locale: string | Array<string>, options?: NumberOptions)
| 参数名 | 类型 | 必填 | 说明 |
| -------------------- | -------------------------------- | ---- | ---------------------------- |
| locale | string \| Array<string> | 是 | 包含区域设置信息的字符串,包括语言以及可选的脚本和区域。 |
-| options9+ | [NumberOptions](#numberoptions9) | 否 | 用于创建数字格式化的选项。 |
+| options | [NumberOptions](#numberoptions6) | 否 | 用于创建数字格式化的选项。 |
**示例:**
```js
@@ -420,7 +422,7 @@ resolvedOptions(): NumberOptions
| 类型 | 说明 |
| -------------------------------- | --------------------------- |
-| [NumberOptions](#numberoptions9) | NumberFormat 对象的格式化选项。 |
+| [NumberOptions](#numberoptions6) | NumberFormat 对象的格式化选项。 |
**示例:**
@@ -433,9 +435,10 @@ resolvedOptions(): NumberOptions
```
-## NumberOptions9+
+## NumberOptions6+
表示设备支持的能力。
+在API9中,NumberOptions中的属性修改为可选属性。
**系统能力**:SystemCapability.Global.I18n
@@ -447,7 +450,7 @@ resolvedOptions(): NumberOptions
| currencyDisplay | string | 是 | 是 | 货币的显示方式,取值包括:"symbol", "narrowSymbol", "code", "name"。 |
| unit | string | 是 | 是 | 单位名称,如:"meter","inch",“hectare”等。 |
| unitDisplay | string | 是 | 是 | 单位的显示格式,取值包括:"long", "short", "narrow"。 |
-| unitUsage | string | 是 | 是 | 单位的使用场景,取值包括:"default", "area-land-agricult", "area-land-commercl", "area-land-residntl", "length-person", "length-person-small", "length-rainfall", "length-road", "length-road-small", "length-snowfall", "length-vehicle", "length-visiblty", "length-visiblty-small", "length-person-informal", "length-person-small-informal", "length-road-informal", "speed-road-travel", "speed-wind", "temperature-person", "temperature-weather", "volume-vehicle-fuel"。 |
+| unitUsage8+ | string | 是 | 是 | 单位的使用场景,取值包括:"default", "area-land-agricult", "area-land-commercl", "area-land-residntl", "length-person", "length-person-small", "length-rainfall", "length-road", "length-road-small", "length-snowfall", "length-vehicle", "length-visiblty", "length-visiblty-small", "length-person-informal", "length-person-small-informal", "length-road-informal", "speed-road-travel", "speed-wind", "temperature-person", "temperature-weather", "volume-vehicle-fuel"。 |
| signDisplay | string | 是 | 是 | 数字符号的显示格式,取值包括:"auto", "never", "always", "expectZero"。 |
| compactDisplay | string | 是 | 是 | 紧凑型的显示格式,取值包括:"long", "short"。 |
| notation | string | 是 | 是 | 数字的格式化规格,取值包括:"standard", "scientific", "engineering", "compact"。 |
@@ -493,7 +496,7 @@ constructor(locale: string | Array<string>, options?: CollatorOptions)
| 参数名 | 类型 | 必填 | 说明 |
| -------------------- | ------------------------------------ | ---- | ---------------------------- |
| locale | string \| Array<string> | 是 | 包含区域设置信息的字符串,包括语言以及可选的脚本和区域。 |
-| options9+ | [CollatorOptions](#collatoroptions9) | 否 | 用于创建排序对象的选项。 |
+| options | [CollatorOptions](#collatoroptions8) | 否 | 用于创建排序对象的选项。 |
**示例:**
```js
@@ -544,7 +547,7 @@ resolvedOptions(): CollatorOptions
| 类型 | 说明 |
| ------------------------------------ | ----------------- |
-| [CollatorOptions](#collatoroptions9) | 返回的Collator对象的属性。 |
+| [CollatorOptions](#collatoroptions8) | 返回的Collator对象的属性。 |
**示例:**
```js
@@ -556,9 +559,10 @@ resolvedOptions(): CollatorOptions
```
-## CollatorOptions9+
+## CollatorOptions8+
表示Collator可设置的属性。
+在API9中,CollatorOptions中的属性修改为可选属性。
**系统能力**:SystemCapability.Global.I18n
@@ -604,7 +608,7 @@ constructor(locale: string | Array<string>, options?: PluralRulesOptions)
| 参数名 | 类型 | 必填 | 说明 |
| -------------------- | ---------------------------------------- | ---- | ---------------------------- |
| locale | string \| Array<string> | 是 | 包含区域设置信息的字符串,包括语言以及可选的脚本和区域。 |
-| options9+ | [PluralRulesOptions](#pluralrulesoptions9) | 否 | 用于创建单复数对象的选项。 |
+| options | [PluralRulesOptions](#pluralrulesoptions8) | 否 | 用于创建单复数对象的选项。 |
**示例:**
```js
@@ -647,9 +651,10 @@ select(n: number): string
```
-## PluralRulesOptions9+
+## PluralRulesOptions8+
表示PluralRules对象可设置的属性。
+在API9中,PluralRulesOptions中的属性修改为可选属性。
**系统能力**:SystemCapability.Global.I18n
@@ -695,7 +700,7 @@ constructor(locale: string | Array<string>, options?: RelativeTimeFormatIn
| 参数名 | 类型 | 必填 | 说明 |
| -------------------- | ---------------------------------------- | ---- | ---------------------------- |
| locale | string \| Array<string> | 是 | 包含区域设置信息的字符串,包括语言以及可选的脚本和区域。 |
-| options9+ | [RelativeTimeFormatInputOptions](#relativetimeformatinputoptions9) | 否 | 用于创建相对时间格式化对象的选项。 |
+| options | [RelativeTimeFormatInputOptions](#relativetimeformatinputoptions8) | 否 | 用于创建相对时间格式化对象的选项。 |
**示例:**
```js
@@ -787,9 +792,10 @@ resolvedOptions(): RelativeTimeFormatResolvedOptions
```
-## RelativeTimeFormatInputOptions9+
+## RelativeTimeFormatInputOptions8+
表示RelativeTimeFormat对象可设置的属性。
+在API9中,RelativeTimeFormatInputOptions中的属性修改为可选属性。
**系统能力**:SystemCapability.Global.I18n
diff --git a/zh-cn/application-dev/reference/apis/js-apis-net-connection.md b/zh-cn/application-dev/reference/apis/js-apis-net-connection.md
index 555f84dcd7bee39b84e68a8b45730a36d06e4867..c395e6ed79b54e8c937f0ea03e31e1350a30c27c 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-net-connection.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-net-connection.md
@@ -11,7 +11,7 @@
import connection from '@ohos.net.connection'
```
-## connection.createNetConnection
+## connection.createNetConnection8+
createNetConnection(netSpecifier?: NetSpecifier, timeout?: number): NetConnection
@@ -46,7 +46,7 @@ let netConnectionCellular = connection.createNetConnection({
})
```
-## connection.getDefaultNet
+## connection.getDefaultNet8+
getDefaultNet(callback: AsyncCallback\): void
@@ -79,7 +79,7 @@ connection.getDefaultNet(function (error, data) {
})
```
-## connection.getDefaultNet
+## connection.getDefaultNet8+
getDefaultNet(): Promise\
@@ -444,7 +444,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getAllNets
+## connection.getAllNets8+
getAllNets(callback: AsyncCallback<Array<NetHandle>>): void
@@ -477,7 +477,7 @@ connection.getAllNets(function (error, data) {
});
```
-## connection.getAllNets
+## connection.getAllNets8+
getAllNets(): Promise<Array<NetHandle>>
@@ -509,7 +509,7 @@ connection.getAllNets().then(function (data) {
});
```
-## connection.getConnectionProperties
+## connection.getConnectionProperties8+
getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback\): void
@@ -547,7 +547,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getConnectionProperties
+## connection.getConnectionProperties8+
getConnectionProperties(netHandle: NetHandle): Promise\
@@ -589,7 +589,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getNetCapabilities
+## connection.getNetCapabilities8+
getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback\): void
@@ -627,7 +627,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getNetCapabilities
+## connection.getNetCapabilities8+
getNetCapabilities(netHandle: NetHandle): Promise\
@@ -734,7 +734,7 @@ connection.isDefaultNetMetered().then(function (data) {
})
```
-## connection.hasDefaultNet
+## connection.hasDefaultNet