diff --git a/CODEOWNERS b/CODEOWNERS
index 200832f4e488b910697dbb875624c74e173c1bc5..e39947e90a7e572b6f323f9f1d18da24d8f1b3ba 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -15,7 +15,302 @@
zh-cn/device-dev/kernel/ @Austin23
zh-cn/device-dev/website.md @Austin23
-README.md @Austin23
-zh-cn/device-dev/porting/ @duangavin123_admin
+zh-cn/device-dev/faqs/ @Austin23
+zh-cn/device-dev/porting/ @Austin23
+zh-cn/device-dev/security/ @Austin23
zh-cn/device-dev/guide/ @duangavin123_admin
-zh-cn/device-dev/subsystems/ @li-yan339
\ No newline at end of file
+zh-cn/device-dev/quick-start/ @li-yan339
+zh-cn/device-dev/driver/ @li-yan339
+zh-cn/device-dev/get-code/ @li-yan339
+zh-cn/device-dev/hpm-part/ @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-build-mini-lite.md @Austin23
+zh-cn/device-dev/subsystems/subsys-build-standard-large.md @Austin23
+zh-cn/device-dev/subsystems/subsys-build-gn-coding-style-and-best-practice.md @Austin23
+zh-cn/device-dev/subsystems/subsys-build-gn-kconfig-visual-config-guid.md @Austin23
+zh-cn/device-dev/subsystems/subsys-remote-start.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-graphics-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-graphics-container-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-graphics-layout-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-graphics-common-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-graphics-animation-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-multimedia-camera-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-multimedia-camera-photo-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-multimedia-camera-record-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-multimedia-camera-preview-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-multimedia-video-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-multimedia-video-play-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-multimedia-video-record-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-utils-overview.md @Austin23
+zh-cn/device-dev/subsystems/subsys-utils-guide.md @Austin23
+zh-cn/device-dev/subsystems/subsys-utils-faqs.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-guide.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-envbuild.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-tech-codemanage.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-tech-name.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-tech-interface.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-devguide-sdk.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-devguide-plugin.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-devguide-conf.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-demo-sdk.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-demo-plugin.md @Austin23
+zh-cn/device-dev/subsystems/subsys-aiframework-demo-conf.md @Austin23
+zh-cn/device-dev/subsystems/subsys-data-relational-database.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-data-relational-database-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-data-relational-database-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-data-storage.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-data-storage-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-data-storage-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-sensor-overview.md @Austin23
+zh-cn/device-dev/subsystems/subsys-sensor-guide.md @Austin23
+zh-cn/device-dev/subsystems/subsys-sensor-demo.md @Austin23
+zh-cn/device-dev/subsystems/subsys-usbservice-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-usbservice-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-usbservice-demo.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-application-framework-overview.md @Austin23
+zh-cn/device-dev/subsystems/subsys-application-framework-envbuild.md @Austin23
+zh-cn/device-dev/subsystems/subsys-application-framework-guide.md @Austin23
+zh-cn/device-dev/subsystems/subsys-application-framework-demo.md @Austin23
+zh-cn/device-dev/subsystems/subsys-ota-guide.md @Austin23
+zh-cn/device-dev/subsystems/subsys-tel-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-tel-guide.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-security-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-security-sigverify.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-security-rightmanagement.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-security-communicationverify.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-security-devicesecuritylevel.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-boot-overview.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-init.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-appspawn.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-appspawn-standard.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-bootstrap.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-syspara.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-faqs.md @Austin23
+zh-cn/device-dev/subsystems/subsys-boot-ref.md @Austin23
+zh-cn/device-dev/subsystems/subsys-testguide-test.md @Austin23
+zh-cn/device-dev/subsystems/subsys-dfx-overview.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hilog-rich.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hilog-lite.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hitrace.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hicollie.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-logging-config.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-logging.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-listening.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-tool.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hidumper.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-hichecker.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-dfx-faultlogger.md @duangavin123_admin
+zh-cn/device-dev/subsystems/subsys-toolchain-bytrace-guide.md @Austin23
+zh-cn/device-dev/subsystems/subsys-toolchain-hdc-guide.md @Austin23
+zh-cn/device-dev/subsystems/subsys-toolchain-hiperf.md @Austin23
+zh-cn/device-dev/subsystems/subsys-xts-guide.md @Austin23
+
+zh-cn/application-dev/ability/ @RayShih
+zh-cn/application-dev/ui/ @HelloCrease
+zh-cn/application-dev/notification/ @RayShih
+zh-cn/application-dev/windowmanager/ @ge-yafang
+zh-cn/application-dev/webgl/ @ge-yafang
+zh-cn/application-dev/media/ @zengyawen
+zh-cn/application-dev/security/ @zengyawen
+zh-cn/application-dev/connectivity/ @zengyawen
+zh-cn/application-dev/connectivity/ipc-rpc-overview.md @qinxiaowang
+zh-cn/application-dev/connectivity/ipc-rpc-development-guideline.md @qinxiaowang
+zh-cn/application-dev/connectivity/subscribe-remote-state.md @qinxiaowang
+zh-cn/application-dev/telephony/ @zengyawen
+zh-cn/application-dev/dfx/ @zengyawen
+zh-cn/application-dev/database/ @ge-yafang
+zh-cn/application-dev/napi/drawing_guidelines.md @ge-yafang
+zh-cn/application-dev/napi/rawfile_guidelines.md @HelloCrease
+zh-cn/application-dev/background-agent-scheduled-reminder/ @RayShih
+zh-cn/application-dev/background-task-management/ @RayShih
+zh-cn/application-dev/work-scheduler/ @HelloCrease
+zh-cn/application-dev/device/usb-overview.md @ge-yafang
+zh-cn/application-dev/device/usb-guidelines.md @ge-yafang
+zh-cn/application-dev/device/device-location-overview.md @sun-yue14
+zh-cn/application-dev/device/device-location-info.md @sun-yue14
+zh-cn/application-dev/device/device-location-geocoding.md @sun-yue14
+zh-cn/application-dev/device/sensor-overview.md @HelloCrease
+zh-cn/application-dev/device/sensor-guidelines.md @HelloCrease
+zh-cn/application-dev/device/vibrator-overview.md @HelloCrease
+zh-cn/application-dev/device/vibrator-guidelines.md @HelloCrease
+zh-cn/application-dev/device/sample-server-overview.md @HelloCrease
+zh-cn/application-dev/device/sample-server-guidelines.md @HelloCrease
+zh-cn/application-dev/reference/arkui-js/ @HelloCrease
+zh-cn/application-dev/reference/arkui-ts/ @HelloCrease
+zh-cn/application-dev/reference/native-apis @RayShih
+zh-cn/application-dev/reference/native-lib @RayShih
+zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-ability-errorCode.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-ability-wantConstant.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-ability.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-abilityConstant.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-abilitystage.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-appmanager.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-configuration.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-configurationconstant.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-featureAbility.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-formextension.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-formerror.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-formhost.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-formInfo.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-missionManager.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-formprovider.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-particleAbility.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-StartOptions.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-Want.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-Context.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-ability-context.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-abilityMonitor.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-context.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-extension-context.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-processrunninginfo.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-commonEvent.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-emitter.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-notification.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-eventhub.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-Bundle.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-zlib.md @RayShih
+zh-cn/application-dev/reference/apis/js-apis-animator.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-mediaquery.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-prompt.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-router.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-display.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-screenshot.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-window.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-webgl.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-webgl2.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-audio.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-camera.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-image.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-media.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-medialibrary.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-i18n.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-intl.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-resource-manager.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-backgroundTaskManager.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-workScheduler.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-config-policy.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-huks.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-system-cipher.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-data-ability.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-distributed-data.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-data-preferences.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-data-storage.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-system-storage.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-data-rdb.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-settings.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-data-resultset.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-document.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-environment.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-fileio.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-filemanager.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-statfs.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-storage-statistics.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-volumemanager.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-contact.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-call.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-observer.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-radio.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-sim.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-sms.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-telephony-data.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-net-connection.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-http.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-request.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-socket.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-webSocket.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-bluetooth.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-connectedTag.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-rpc.md @qinxiaowang
+zh-cn/application-dev/reference/apis/js-apis-wifi.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-wifiext.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-accessibility.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-faultLogger.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hiappevent.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hichecker.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hidebug.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hilog.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hitracechain.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-inputmethod.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-pasteboard.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-screen-lock.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-system-time.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-wallpaper.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-timer.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-battery-info.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-brightness.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-device-info.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-device-manager.md
+zh-cn/application-dev/reference/apis/js-apis-geolocation.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-inputdevice.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-power.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-runninglock.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-sensor.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-system-parameter.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-thermal.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-update.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-usb.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-vibrator.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-appAccount.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-distributed-account.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-osAccount.md @sun-yue14
+zh-cn/application-dev/reference/apis/js-apis-convertxml.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-process.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-uri.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-url.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-util.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-arraylist.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-deque.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hashmap.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-hashset.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-lightweightset.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-linkedlist.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-list.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-plainarray.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-queue.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-stack.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-treemap.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-treeset.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-vector.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-worker.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-xml.md @zengyawen
+zh-cn/application-dev/reference/apis/js-apis-testRunner.md @HelloCrease
+zh-cn/application-dev/reference/apis/js-apis-uitest.md @HelloCrease
+zh-cn/application-dev/quick-start/start-overview.md @ge-yafang
+zh-cn/application-dev/quick-start/start-with-ets.md @ge-yafang
+zh-cn/application-dev/quick-start/start-with-ets-low-code.md @ge-yafang
+zh-cn/application-dev/quick-start/start-with-js.md @ge-yafang
+zh-cn/application-dev/quick-start/start-with-js-low-code.md @ge-yafang
+zh-cn/application-dev/quick-start/package-structure.md @RayShih
+zh-cn/application-dev/quick-start/basic-resource-file-categories.md @RayShih
+zh-cn/application-dev/quick-start/syscap.md @RayShih
diff --git a/OAT.xml b/OAT.xml
index c84e1b4df3bdb1005b4c8912e0cc70055b57bd6d..414d2024d4d92853fb4a174aea6f19d54c3c770d 100644
--- a/OAT.xml
+++ b/OAT.xml
@@ -38,6 +38,7 @@
+
@@ -48,6 +49,7 @@
+
diff --git a/en/OpenHarmony-Overview.md b/en/OpenHarmony-Overview.md
index 78abcbd9df183779c9e930e8904019921970a145..7f61ce7dd8eefb4617c5baeaed025a6fc3ca1fe3 100644
--- a/en/OpenHarmony-Overview.md
+++ b/en/OpenHarmony-Overview.md
@@ -90,11 +90,11 @@ OpenHarmony supports the following types:
- Small system
- A small system runs on the devices whose memory is greater than or equal to 1 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides higher security capabilities, standard graphics frameworks, and video encoding and decoding capabilities. Typical products include smart home IP cameras, electronic cat eyes, and routers, and event data recorders \(EDRs\) for smart travel.
+ A small system runs on the devices whose memory is greater than or equal to 1 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides higher security capabilities, standard graphics frameworks, and video encoding and decoding capabilities. Typical products include smart home IP cameras, electronic cat eyes, routers, and event data recorders \(EDRs\) for smart travel.
- Standard system
- A standard system runs on the devices whose memory is greater than or equal to 128 MiB and that are equipped with application processors such as ARM Cortex-A. This system provides a complete application framework supporting the enhanced interaction, 3D GPU, hardware composer, diverse components, and rich animations. This system applies to high-end refrigerator displays.
+ A standard system runs on the devices whose memory is greater than or equal to 128 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides a complete application framework supporting the enhanced interaction, 3D GPU, hardware composer, diverse components, and rich animations. This system applies to high-end refrigerator displays.
## Subsystems
@@ -125,7 +125,7 @@ The following table describes the subsystems of OpenHarmony. For details about t
| Account | Provides interconnection with vendors' cloud account apps on the device side, and query and update of the cloud account login status. | Standard system |
| Compilation and Building | Provides a compilation and building framework based on Generate Ninja (GN) and Ninja. | All systems |
| Test | The test-driven development mode is used during the development process. You can develop new cases or modify existing cases to test new or enhanced system features. The test helps you develop high-quality code in the development phase. | All systems |
-| Data Management | Provides local data management and distributed data management:<\br> - Local app data management for lightweight preference databases and relational databases<\br> - Distributed data service to provide apps with the capability to store data in the databases of different devices | Standard system |
+| Data Management | Provides local data management and distributed data management:
- Local app data management for lightweight preference databases and relational databases
- Distributed data service to provide apps with the capability to store data in the databases of different devices | Standard system |
| Programming Language Runtime | Provides the compilation and execution environment for programs developed with JavaScript or C/C++, basic libraries that support the runtime, and the runtime-associated APIs, compilers, and auxiliary tools. | All systems |
| Distributed Scheduler | Starts, registers, queries, and manages system services. | All systems |
| JS UI framework | OpenHarmony UI development framework that supports web-development-like paradigm. | All systems |
@@ -153,7 +153,7 @@ Currently, OpenHarmony supports the development boards listed in the following t
| Standard system| Runhe HH-SCDAYU200| RK3568 | Bolstered by the Rockchip RK3568, the HH-SCDAYU200 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm fabrication process and is clocked at up to 2.0 GHz. The board is packed with Bluetooth, WiFi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as network video recorders (NVRs) and industrial gateways.| Video and audio entertainment, smart travel, and smart home, such as kitchen hoods, ovens, and treadmills.| Code repositories:
[device_soc_rockchip](https://gitee.com/openharmony/device_soc_rockchip)
[device_board_hihope](https://gitee.com/openharmony/device_board_hihope)
[vendor_hihope](https://gitee.com/openharmony/vendor_hihope)
Daily build:
http://ci.openharmony.cn/dailys/dailybuilds |
| Lightweight| Goodix GR5515-STARTER-KIT| GR5515 | The GR5515-STARTER-KIT development board is a Bluetooth 5.1-capable single-mode Bluetooth low energy (BLE) SoC and comes with multifunctional keys and LED indicators.| Smart hardware, such as watches, wristbands, and price tags.| Code repositories:
[device_soc_goodix](https://gitee.com/openharmony/device_soc_goodix)
[device_board_goodix](https://gitee.com/openharmony/device_board_goodix)
Daily build:
http://ci.openharmony.cn/dailys/dailybuilds |
| Lightweight| Langguo LANGO200| ASR582X | The LANGO200 IoT development board integrates the high-performance WiFi-BLE dual-mode chip ASR5822, external storage chip, voice playing chip, and analog-to-digital converter. It supports common peripheral interfaces like SPI, and can be connected to an external OLED display and infrared remote control.| Connection modules for smart home products.| Code repositories:
[device_soc_asrmicro](https://gitee.com/openharmony/device_soc_asrmicro)
[device_board_lango](https://gitee.com/openharmony/device_board_lango)
[vendor_asrmicro](https://gitee.com/openharmony/vendor_asrmicro)
Daily build:
http://ci.openharmony.cn/dailys/dailybuilds |
-| Lightweight| Fn-Link multi-modal V200ZR| BES2600 | The multi-modal V200Z-R development board is a high-performance, multi-functional, and cost-effective AIoT SoC powered by the BES2600WM chip of Bestechnic. It integrates a quad-core ARM processor with a frequency of up to 1 GHz as well as dual-mode WiFi and dual-mode Bluetooth. The board supports the 802.11 a/b/g/n/ and BT/BLE 5.2 standards. It is able to accommodate RAM of up to 42 MB and flash memory of up to 32 MB, and supports the MIPI display serial interface (DSI) and camera serial interface (CSI). It is applicable to various AIoT multi-modal VUI and GUI interaction scenarios.| Smart hardware with screens, such as speakers and watches.| Code repositories:
[device_soc_bestechnic](https://gitee.com/openharmony/device_soc_bestechnic)
[device_board_fnlink](https://gitee.com/openharmony/device_board_fnlink)
[vendor_bestechnic](https://gitee.com/openharmony/vendor_bestechnic)
Daily build:
http://ci.openharmony.cn/dailys/dailybuilds |
+| Lightweight| Fn-Link multi-modal V200ZR| BES2600 | The multi-modal V200Z-R development board is a high-performance, multi-functional, and cost-effective AIoT SoC powered by the BES2600WM chip of Bestechnic. It integrates a quad-core Arm processor with a frequency of up to 1 GHz as well as dual-mode WiFi and dual-mode Bluetooth. The board supports the 802.11 a/b/g/n/ and BT/BLE 5.2 standards. It is able to accommodate RAM of up to 42 MB and flash memory of up to 32 MB, and supports the MIPI display serial interface (DSI) and camera serial interface (CSI). It is applicable to various AIoT multi-modal VUI and GUI interaction scenarios.| Smart hardware with screens, such as speakers and watches.| Code repositories:
[device_soc_bestechnic](https://gitee.com/openharmony/device_soc_bestechnic)
[device_board_fnlink](https://gitee.com/openharmony/device_board_fnlink)
[vendor_bestechnic](https://gitee.com/openharmony/vendor_bestechnic)
Daily build:
http://ci.openharmony.cn/dailys/dailybuilds |
| Lightweight| BearPi-HM_Nano| Hi3861 | The BearPi-HM_Nano development board is specially designed for OpenHarmony. It is equipped with the highly integrated 2.4 GHz WiFi SoC chip Hi3861, near field communication (NFC) circuits, and standard E53 interfaces, which can be used to connect to smart humidifiers, smart desk lamps, smart security facilities, and intelligent smoke detectors.| Connection devices like smart street lamps, smart logistics sensors, and human body infrared sensors.| Code repositories:
[device_soc_hisilicon](https://gitee.com/openharmony/device_soc_hisilicon)
[device_board_bearpi](https://gitee.com/openharmony/device_board_bearpi)
[vendor_bearpi](https://gitee.com/openharmony/vendor_bearpi)
Daily build:
http://ci.openharmony.cn/dailys/dailybuilds |
## Getting Started
diff --git a/en/application-dev/IDL/figures/IDL-interface-description.png b/en/application-dev/IDL/figures/IDL-interface-description.png
new file mode 100644
index 0000000000000000000000000000000000000000..c7acc5c490e1aef26ceeafaffd0f63675cc2d488
Binary files /dev/null and b/en/application-dev/IDL/figures/IDL-interface-description.png differ
diff --git a/en/application-dev/IDL/figures/IPC-RPC-communication-model.png b/en/application-dev/IDL/figures/IPC-RPC-communication-model.png
new file mode 100644
index 0000000000000000000000000000000000000000..0af6b9fef057703ab2b00ef9153e73df87d4176b
Binary files /dev/null and b/en/application-dev/IDL/figures/IPC-RPC-communication-model.png differ
diff --git a/en/application-dev/IDL/idl-guidelines.md b/en/application-dev/IDL/idl-guidelines.md
new file mode 100644
index 0000000000000000000000000000000000000000..66b45bd4c04860e882c9104aaf3c58164f5ec29b
--- /dev/null
+++ b/en/application-dev/IDL/idl-guidelines.md
@@ -0,0 +1,661 @@
+# OpenHarmony IDL Specifications and User Guide
+
+## IDL Overview
+To ensure successful communications between the client and server, interfaces recognized by both parties must be defined. The OpenHarmony Interface Definition Language (IDL) is a tool for defining such interfaces. OpenHarmony IDL decomposes objects to be transferred into primitives that can be understood by the operating system and encapsulates cross-boundary objects based on developers' requirements.
+
+**Figure 1** IDL interface description
+
+
+
+IDL provides the following functions:
+
+- Declares interfaces provided by system services for external systems, and based on the interface declaration, generates C, C++, JS, or TS code for inter-process communication (IPC) or remote procedure call (RPC) proxies and stubs during compilation.
+
+- Declares interfaces provided by abilities for external systems, and based on the interface declaration, generates C, C++, JS, or TS code for IPC or RPC proxies and stubs during compilation.
+
+**Figure 2** IPC/RPC communication model
+
+
+
+IDL has the following advantages:
+
+- Services are defined in the form of interfaces in IDL. Therefore, you do not need to focus on implementation details.
+
+- Interfaces defined by IDL can be used in IPC or RPC scenarios. The information or code generated based on the definitions in IDL simplifies IPC or RPC implementation.
+
+## IDL File Structure
+
+### Data Types
+
+#### Primitive Type
+| IDL Primitive Type| C++ Primitive Type| TS Primitive Type|
+| -------- | -------- | -------- |
+|void | void | void |
+|boolean | bool | boolean |
+|byte | int8_t | number |
+|short | int16_t | number |
+|int | int32_t | number |
+|long | int64_t | number |
+|float | float | number |
+|double | double | number |
+|String | std::string | string |
+
+The preceding table lists the primitive types supported by IDL and the mappings to the C++ and TS primitive types.
+
+#### sequenceable Type
+The sequenceable type is declared using the keyword **sequenceable**. This type can be passed during IPC or RPC through **Parcel** objects. The declaration mode of the sequenceable type in C++ is different from that in TS.
+
+In C++, the declaration is placed in the file header in the format of **sequenceable includedir..namespace.typename**. It can be in any of the following forms:
+
+```
+sequenceable includedir..namespace.typename
+sequenceable includedir...typename
+sequenceable namespace.typename
+```
+In the preceding information, **includedir** indicates the directory where the header file of the type is located, and the dot (.) is used as the separator. **namespace** indicates the namespace where the type is located, and the dot (.) is used as the separator. **typename** indicates the data type, which can contain only English characters. **includedir** and **namespace** are separated by two dots (..). If the declaration statement does not contain two dots, all characters except the last typename will be parsed as a namespace. Example:
+```
+sequenceable a.b..C.D
+```
+The preceding statement is parsed into the following code in the C++ header file:
+```
+#include "a/b/d.h"
+using C::D;
+```
+In TS, the declaration is placed in the file header in the format of **sequenceable namespace.typename;**. It can be in the following form:
+
+```
+sequenceable idl.MySequenceable
+```
+
+In the preceding information, **namespace** indicates the namespace to which the data type belongs, **typename** indicates the data type name, and **MySequenceable** indicates that data can be passed during IPC using **Parcel** objects. The sequenceable type is not defined in the IDL file, but in the .ts file. Therefore, IDL adds the following statement to the generated .ts file based on the declaration:
+
+```
+import MySequenceable from "./my_sequenceable"
+```
+
+Note that IDL does not implement code for this type. It only imports the header file in the specified format or imports the specified module and uses the type. Therefore, you must ensure that the imported directory, namespace, and type are correct.
+
+#### Interface Type
+The interface type refers to interfaces defined in IDL files. The interfaces defined in an IDL file can be directly used as the parameter type or return value type of a method declared in the file. If an IDL file attempts to use interfaces defined in other IDL files, forward declaration must be contained in the header of that IDL file.
+
+The declaration form in C++ is similar to that of the sequenceable type. The declaration form is as follows:
+
+```
+interface includedir..namespace.typename
+```
+
+In TS, the declaration form is as follows:
+
+```
+interface namespace.interfacename
+```
+
+In the preceding information, **namespace** indicates the namespace to which the interface belongs, and **interfacename** indicates the name of the interface. For example, **interface OHOS.IIdlTestObserver;** declares the **IIdlTestObserver** interface defined in another IDL file. This interface can be used as the parameter type or return value type of a method in the current file. IDL adds the following statement to the generated .ts file based on the statement:
+
+```
+import IIdlTestObserver from "./i_idl_test_observer"
+```
+
+#### Array Type
+The array type is represented by T[], where **T** can be the primitive, sequenceable, interface, or array type. In C++, this type is generated as **std::vector<T>**.
+The table below lists the mappings between the IDL array type and TS and C++ data types.
+
+|IDL Data Type | C++ Data Type | TS Data Type |
+| -------- | -------- | -------- |
+|T[] | std::vector<T> | T[] |
+
+#### Container Type
+IDL supports two container types: List and Map. The List container is represented in the format of **List<T>**. The Map container is represented in the format of **Map**, where **T**, **KT**, and **VT** can be of the primitive, sequenceable, interface, array, or container type.
+
+In C++, the List container type is generated as **std::list**, and the Map container type is generated as **std::map**.
+
+In TS, the List container type is not supported, and the Map container type is generated as **Map**.
+
+The table below lists the mappings between the IDL container type and TS and C++ data types.
+
+|IDL Data Type | C++ Data Type | TS Data Type |
+| -------- | -------- | -------- |
+|List<T> | std::list | Not supported|
+|Map | std::map | Map |
+
+
+### Specifications for Compiling IDL Files
+Only one interface type can be defined in an IDL file, and the interface name must be the same as the file name. The interface definition of the IDL file is described in Backus-Naur form (BNF). The basic definition format is as follows:
+```
+[<*interface_attr_declaration*>]interface<*interface_name_with_namespace*>{<*method_declaration*>}
+```
+In the preceding information, <*interface_attr_declaration*> declares interface attributes. Currently, only the **oneway** attribute is supported, indicating that all methods in the interface are unidirectional. Such a method returns value without waiting for the execution to complete. This attribute is optional. If this attribute is not set, synchronous call is used. The interface name must contain the complete interface header file directory, namespace, and method declaration. Empty interfaces are not allowed.
+The method declaration format in the interface is as follows:
+```
+[<*method_attr_declaration*>]<*result_type*><*method_declaration*>
+```
+In the preceding information, <*method_attr_declaration*> describes the interface attributes. Currently, only the **oneway** attribute is supported, indicating that the method is unidirectional. Such a method returns value without waiting for the execution to complete. This attribute is optional. If this attribute is not set, synchronous call is used. <*result_type*> indicates the type of the return value, and <*method_declaration*> indicates the method name and parameter declaration.
+The parameter declaration format is as follows:
+```
+[<*formal_param_attr*>]<*type*><*identifier*>
+```
+The value of <*formal_param_attr*> can be **in**, **out**, or **inout**, indicating that the parameter is an input parameter, an output parameter, or both an input and an output parameter, respectively. A **oneway** method does not allow **output** or **inout** parameters or return values.
+
+## How to Develop
+
+### Development Using C++
+
+#### Creating an IDL File
+
+ You can use C++ to create IDL files. An example IDL file is as follows:
+
+```
+ interface OHOS.IIdlTestService {
+ int TestIntTransaction([in] int data);
+ void TestStringTransaction([in] String data);
+ }
+```
+
+You can run the **./idl -gen-cpp -d dir -c dir/iTest.idl** command (**-d** indicates the output directory) to generate the interface file, stub file, and proxy file in the **dir** directory in the execution environment. The names of the generated interface class files are the same as that of the IDL file, except that the file name extensions are **.h** and **.cpp**. For example, for **IIdlTestService.idl**, the generated files are **i_idl_test_service.h**, **idl_test_service_proxy.h**, **idl_test_service_stub.h**, **idl_test_service_proxy.cpp**, and **idl_test_service_stub.cpp**.
+
+#### Exposing Interfaces on the Server
+
+The stub class generated by IDL is an abstract implementation of the interface class and declares all methods in the IDL file.
+
+```
+#ifndef OHOS_IDLTESTSERVICESTUB_H
+#define OHOS_IDLTESTSERVICESTUB_H
+#include
+#include "iidl_test_service.h"
+
+namespace OHOS {
+class IdlTestServiceStub : public IRemoteStub {
+public:
+ int OnRemoteRequest(
+ /* [in] */ uint32_t code,
+ /* [in] */ MessageParcel& data,
+ /* [out] */ MessageParcel& reply,
+ /* [in] */ MessageOption& option) override;
+
+private:
+ static constexpr int COMMAND_TEST_INT_TRANSACTION = MIN_TRANSACTION_ID + 0;
+ static constexpr int COMMAND_TEST_STRING_TRANSACTION = MIN_TRANSACTION_ID + 1;
+};
+} // namespace OHOS
+#endif // OHOS_IDLTESTSERVICESTUB_H
+```
+
+You need to inherit the interface class defined in the IDL file and implement the methods in the class. In addition, you need to register the defined services with SAMGR during service initialization. In the following code snippet, **TestService** inherits the **IdlTestServiceStub** interface class and implements the **TestIntTransaction** and **TestStringTransaction** methods.
+
+```
+#ifndef OHOS_IPC_TEST_SERVICE_H
+#define OHOS_IPC_TEST_SERVICE_H
+
+#include "hilog/log.h"
+#include "log_tags.h"
+#include "idl_test_service_stub.h"
+
+namespace OHOS {
+class TestService : public IdlTestServiceStub {
+public:
+ TestService();
+ ~TestService();
+ static int Instantiate();
+ ErrCode TestIntTransaction(int data, int &rep) override;
+ ErrCode TestStringTransaction(const std::string& data) override;
+private:
+ static constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_ID_IPC, "TestService" };
+};
+} // namespace OHOS
+#endif // OHOS_IPC_TEST_SERVICE_H
+```
+
+The sample code for registering a service is as follows:
+
+```
+#include "test_service.h"
+
+#include
+
+#include "if_system_ability_manager.h"
+#include "ipc_debug.h"
+#include "ipc_skeleton.h"
+#include "iservice_registry.h"
+#include "system_ability_definition.h"
+
+namespace OHOS {
+using namespace OHOS::HiviewDFX;
+
+int TestService::Instantiate()
+{
+ ZLOGI(LABEL, "%{public}s call in", __func__);
+ auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
+ if (saMgr == nullptr) {
+ ZLOGE(LABEL, "%{public}s:fail to get Registry", __func__);
+ return -ENODEV;
+ }
+
+ sptr newInstance = new TestService();
+ int result = saMgr->AddSystemAbility(IPC_TEST_SERVICE, newInstance);
+ ZLOGI(LABEL, "%{public}s: IPC_TEST_SERVICE result = %{public}d", __func__, result);
+ return result;
+}
+
+TestService::TestService()
+{
+}
+
+TestService::~TestService()
+{
+}
+
+ErrCode TestService::TestIntTransaction(int data, int &rep)
+{
+ ZLOGE(LABEL, " TestService:read from client data = %{public}d", data);
+ rep = data + data;
+ return ERR_NONE;
+}
+
+ErrCode TestService::TestStringTransaction(const std::string &data)
+{
+ ZLOGE(LABEL, "TestService:read string from client data = %{public}s", data.c_str());
+ return data.size();
+}
+} // namespace OHOS
+```
+
+
+#### Calling Methods from the Client for IPC
+
+The C++ client obtains the service proxy defined in the system through SAMGR and then invokes the interface provided by the proxy. The sample code is as follows:
+
+```
+#include "test_client.h"
+
+#include "if_system_ability_manager.h"
+#include "ipc_debug.h"
+#include "ipc_skeleton.h"
+#include "iservice_registry.h"
+#include "system_ability_definition.h"
+
+namespace OHOS {
+int TestClient::ConnectService()
+{
+ auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
+ if (saMgr == nullptr) {
+ ZLOGE(LABEL, "get registry fail");
+ return -1;
+ }
+
+ sptr object = saMgr->GetSystemAbility(IPC_TEST_SERVICE);
+ if (object != nullptr) {
+ ZLOGE(LABEL, "Got test Service object");
+ testService_ = (new (std::nothrow) IdlTestServiceProxy(object));
+ }
+
+ if (testService_ == nullptr) {
+ ZLOGE(LABEL, "Could not find Test Service!");
+ return -1;
+ }
+
+ return 0;
+}
+
+void TestClient::StartIntTransaction()
+{
+ if (testService_ != nullptr) {
+ ZLOGE(LABEL, "StartIntTransaction");
+ [[maybe_unused]] int result = 0;
+ testService_->TestIntTransaction(1234, result); // 1234 : test number
+ ZLOGE(LABEL, "Rec result from server %{public}d.", result);
+ }
+}
+
+void TestClient::StartStringTransaction()
+{
+ if (testService_ != nullptr) {
+ ZLOGI(LABEL, "StartIntTransaction");
+ testService_->TestStringTransaction("IDL Test");
+ }
+}
+} // namespace OHOS
+```
+
+
+
+
+### Development Using TS
+
+#### Creating an IDL File
+
+ You can use TS to create IDL files. An example IDL file is as follows:
+
+```
+ interface OHOS.IIdlTestService {
+ int TestIntTransaction([in] int data);
+ void TestStringTransaction([in] String data);
+ }
+```
+
+Run the **./idl -c IIdlTestService.idl -gen-ts -d /data/ts/** command (**-d** indicates the output directory) to generate the interface file, stub file, and proxy file in the **/data/ts** directory in the execution environment. The names of the generated interface class files are the same as that of the IDL file, except that the file name extension is **.ts**. For example, the files generated for the **IIdlTestService.idl** file are **i_idl_test_service.ts**, **idl_test_service_proxy.ts**, and **idl_test_service_stub.ts**.
+
+#### Exposing Interfaces on the Server
+
+The stub class generated by IDL is an abstract implementation of the interface class and declares all methods in the IDL file.
+
+```
+import {testIntTransactionCallback} from "./i_idl_test_service";
+import {testStringTransactionCallback} from "./i_idl_test_service";
+import IIdlTestService from "./i_idl_test_service";
+import rpc from "@ohos.rpc";
+
+export default class IdlTestServiceStub extends rpc.RemoteObject implements IIdlTestService {
+ constructor(des: string) {
+ super(des);
+ }
+
+ onRemoteRequest(code: number, data, reply, option): boolean {
+ console.log("onRemoteRequest called, code = " + code);
+ switch(code) {
+ case IdlTestServiceStub.COMMAND_TEST_INT_TRANSACTION: {
+ let _data = data.readInt();
+ this.testIntTransaction(_data, (errCode, returnValue) => {
+ reply.writeInt(errCode);
+ if (errCode == 0) {
+ reply.writeInt(returnValue);
+ }
+ });
+ return true;
+ }
+ case IdlTestServiceStub.COMMAND_TEST_STRING_TRANSACTION: {
+ let _data = data.readString();
+ this.testStringTransaction(_data, (errCode) => {
+ reply.writeInt(errCode);
+ });
+ return true;
+ }
+ default: {
+ console.log("invalid request code" + code);
+ break;
+ }
+ }
+ return false;
+ }
+
+ testIntTransaction(data: number, callback: testIntTransactionCallback): void{}
+ testStringTransaction(data: string, callback: testStringTransactionCallback): void{}
+
+ static readonly COMMAND_TEST_INT_TRANSACTION = 1;
+ static readonly COMMAND_TEST_STRING_TRANSACTION = 2;
+}
+```
+
+You need to inherit the interface class defined in the IDL file and implement the methods in the class. The following code snippet shows how to inherit the **IdlTestServiceStub** interface class and implement the **testIntTransaction** and **testStringTransaction** methods.
+
+```
+import {testIntTransactionCallback} from "./i_idl_test_service"
+import {testStringTransactionCallback} from "./i_idl_test_service"
+import IdlTestServiceStub from "./idl_test_service_stub"
+
+
+class IdlTestImp extends IdlTestServiceStub {
+
+ testIntTransaction(data: number, callback: testIntTransactionCallback): void
+ {
+ callback(0, data + 1);
+ }
+ testStringTransaction(data: string, callback: testStringTransactionCallback): void
+ {
+ callback(0);
+ }
+}
+```
+
+After the service implements the interface, the interface needs to be exposed to the client for connection. If your service needs to expose this interface, extend **Ability** and implement **onConnect()** to return **IRemoteObject** so that the client can interact with the service process. The following code snippet shows how to expose the **IRemoteAbility** interface to the client:
+
+```
+export default {
+ onStart() {
+ console.info('ServiceAbility onStart');
+ },
+ onStop() {
+ console.info('ServiceAbility onStop');
+ },
+ onCommand(want, startId) {
+ console.info('ServiceAbility onCommand');
+ },
+ onConnect(want) {
+ console.info('ServiceAbility onConnect');
+ try {
+ console.log('ServiceAbility want:' + typeof(want));
+ console.log('ServiceAbility want:' + JSON.stringify(want));
+ console.log('ServiceAbility want name:' + want.bundleName)
+ } catch(err) {
+ console.log("ServiceAbility error:" + err)
+ }
+ console.info('ServiceAbility onConnect end');
+ return new IdlTestImp('connect');
+ },
+ onDisconnect(want) {
+ console.info('ServiceAbility onDisconnect');
+ console.info('ServiceAbility want:' + JSON.stringify(want));
+ }
+};
+```
+
+#### Calling Methods from the Client for IPC
+
+When the client calls **connectAbility()** to connect to a Service ability, the **onConnect** callback in **onAbilityConnectDone** of the client receives the **IRemoteObject** instance returned by the **onConnect()** method of the Service ability. The client and Service ability are in different applications. Therefore, the directory of the client application must contain a copy of the .idl file (the SDK automatically generates the proxy class). The **onConnect** callback then uses the **IRemoteObject** instance to create the **testProxy** instance of the **IdlTestServiceProxy** class and calls the related IPC method. The sample code is as follows:
+
+```
+import IdlTestServiceProxy from './idl_test_service_proxy'
+import featureAbility from '@ohos.ability.featureAbility';
+
+function callbackTestIntTransaction(result: number, ret: number): void {
+ if (result == 0 && ret == 124) {
+ console.log("case 1 success ");
+ }
+}
+
+function callbackTestStringTransaction(result: number): void {
+ if (result == 0) {
+ console.log("case 2 success ");
+ }
+}
+
+var onAbilityConnectDone = {
+ onConnect:function (elementName, proxy) {
+ let testProxy = new IdlTestServiceProxy(proxy);
+ testProxy.testIntTransaction(123, callbackTestIntTransaction);
+ testProxy.testStringTransaction('hello', callbackTestStringTransaction);
+ },
+ onDisconnect:function (elementName) {
+ console.log("onDisconnectService onDisconnect");
+ },
+ onFailed:function (code) {
+ console.log("onDisconnectService onFailed");
+ }
+};
+
+function connectAbility: void {
+ let want = {
+ "bundleName":"com.example.myapplicationidl",
+ "abilityName": "com.example.myapplicationidl.ServiceAbility"
+ };
+ let connectionId = -1;
+ connectionId = featureAbility.connectAbility(want, onAbilityConnectDone);
+}
+
+
+```
+
+#### Transferring a sequenceable Object During IPC
+
+You can send a class from one process to another through IPC interfaces. However, you must ensure that the peer can use the code of this class and this class supports the **marshalling** and **unmarshalling** methods. OpenHarmony uses **marshalling** and **unmarshalling** to serialize and deserialize objects into objects that can be identified by each process.
+
+To create a class that supports the sequenceable type, perform the following operations:
+
+1. Implement the **marshalling** method, which obtains the current state of the object and serializes the object into a **Parcel** object.
+2. Implement the **unmarshalling** method, which deserializes the object from a **Parcel** object.
+
+The following is an example of the **MySequenceable** class code:
+
+```
+import rpc from '@ohos.rpc';
+export default class MySequenceable {
+ constructor(num: number, str: string) {
+ this.num = num;
+ this.str = str;
+ }
+ getNum() : number {
+ return this.num;
+ }
+ getString() : string {
+ return this.str;
+ }
+ marshalling(messageParcel) {
+ messageParcel.writeInt(this.num);
+ messageParcel.writeString(this.str);
+ return true;
+ }
+ unmarshalling(messageParcel) {
+ this.num = messageParcel.readInt();
+ this.str = messageParcel.readString();
+ return true;
+ }
+ private num;
+ private str;
+}
+```
+
+
+
+## How to Develop for Interworking Between C++ and TS
+
+### TS Proxy and C++ Stub Development
+
+#### C++ Service Object
+
+1. Use C++ to construct an IDL file and run commands to generate interfaces, stub files, and proxy files.
+
+2. Create a service object, inherit the interface class defined in the C++ stub file, and implement the methods in the class. An example is as follows:
+
+ ```
+ class IdlTestServiceImpl : public IdlTestServiceStub {
+ public:
+ IdlTestServiceImpl() = default;
+ virtual ~IdlTestServiceImpl() = default;
+
+ ErrCode TestIntTransaction(int _data, int& result) override
+ {
+ result = 256;
+ return ERR_OK;
+ }
+
+ ErrCode TestStringTransaction(const std::string& _data) override
+ {
+ return ERR_OK;
+ }
+ };
+ ```
+
+#### Native APIs in C++
+
+C++ provides C++ service objects to TS in the format of native APIs. For example, C++ provides a **GetNativeObject** method, which is used to create an **IdlTestServiceImpl** instance. Using the **NAPI_ohos_rpc_CreateJsRemoteObject** method, you can create a JS remote object for the TS application.
+
+```
+NativeValue* GetNativeObject(NativeEngine& engine, NativeCallbackInfo& info)
+{
+ sptr impl = new IdlTestServiceImpl();
+ napi_value napiRemoteObject = NAPI_ohos_rpc_CreateJsRemoteObject(reinterpret_cast(&engine), impl);
+ NativeValue* nativeRemoteObject = reinterpret_cast(napiRemoteObject);
+ return nativeRemoteObject;
+}
+```
+
+#### TS Proxy Object
+
+Use TS to construct an IDL file and run commands to generate interfaces, stub files, and proxy files. An example proxy file is as follows:
+
+```
+
+import {testIntTransactionCallback} from "./i_idl_test_service";
+import {testStringTransactionCallback} from "./i_idl_test_service";
+import IIdlTestService from "./i_idl_test_service";
+import rpc from "@ohos.rpc";
+
+export default class IdlTestServiceProxy implements IIdlTestService {
+ constructor(proxy) {
+ this.proxy = proxy;
+ }
+
+ testIntTransaction(data: number, callback: testIntTransactionCallback): void
+ {
+ let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC);
+ let _data = new rpc.MessageParcel();
+ let _reply = new rpc.MessageParcel();
+ _data.writeInt(data);
+ this.proxy.sendRequest(IdlTestServiceProxy.COMMAND_TEST_INT_TRANSACTION, _data, _reply, _option).then(function(result) {
+ if (result.errCode === 0) {
+ let _errCode = result.reply.readInt();
+ if (_errCode != 0) {
+ let _returnValue = undefined;
+ callback(_errCode, _returnValue);
+ return;
+ }
+ let _returnValue = result.reply.readInt();
+ callback(_errCode, _returnValue);
+ } else {
+ console.log("sendRequest failed, errCode: " + result.errCode);
+ }
+ })
+ }
+
+ testStringTransaction(data: string, callback: testStringTransactionCallback): void
+ {
+ let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC);
+ let _data = new rpc.MessageParcel();
+ let _reply = new rpc.MessageParcel();
+ _data.writeString(data);
+ this.proxy.sendRequest(IdlTestServiceProxy.COMMAND_TEST_STRING_TRANSACTION, _data, _reply, _option).then(function(result) {
+ if (result.errCode === 0) {
+ let _errCode = result.reply.readInt();
+ callback(_errCode);
+ } else {
+ console.log("sendRequest failed, errCode: " + result.errCode);
+ }
+ })
+ }
+
+ static readonly COMMAND_TEST_INT_TRANSACTION = 1;
+ static readonly COMMAND_TEST_STRING_TRANSACTION = 2;
+ private proxy
+}
+```
+
+#### Interworking Between TS and C++ Applications
+
+1. The TS application invokes the native API to obtain the remote C++ service object.
+2. Construct a TS proxy and transfers the remote C++ service object to it.
+3. Use the TS proxy to call the method declared in the IDL file to implement the interworking between the TS proxy and C++ stub. The following is an example:
+
+```
+import IdlTestServiceProxy from './idl_test_service_proxy'
+import nativeMgr from 'nativeManager';
+
+function testIntTransactionCallback(errCode: number, returnValue: number)
+{
+ console.log("errCode: " + errCode + " returnValue: " + returnValue);
+}
+
+function testStringTransactionCallback(errCode: number)
+{
+ console.log("errCode: " + errCode);
+}
+
+function jsProxyTriggerCppStub()
+{
+ let nativeObj = nativeMgr.GetNativeObject();
+ let tsProxy = new IdlTestServiceProxy(nativeObj);
+ // Call testIntTransaction.
+ tsProxy.testIntTransaction(10, testIntTransactionCallback);
+
+ // Call testStringTransaction.
+ tsProxy.testStringTransaction("test", testIntTransactionCallback);
+}
+```
diff --git a/en/application-dev/Readme-EN.md b/en/application-dev/Readme-EN.md
index 8ef60fba9b498e0e1578d8f12641840d88933677..36d653078e36493e3927053cb636ba48062213d9 100644
--- a/en/application-dev/Readme-EN.md
+++ b/en/application-dev/Readme-EN.md
@@ -7,14 +7,14 @@
- [OpenHarmony Release Notes](../release-notes/Readme.md)
- Quick Start
- Getting Started
- - [Preparations](start-overview.md)
+ - [Preparations](quick-start/start-overview.md)
- [Getting Started with eTS in the Traditional Coding Approach](quick-start/start-with-ets.md)
- [Getting Started with eTS in the Low-Code Approach](quick-start/start-with-ets-low-code.md)
- [Getting Started with JavaScript in the Traditional Coding Approach](quick-start/start-with-js.md)
- [Getting Started with JavaScript in the Low-Code Approach](quick-start/start-with-js-low-code.md)
- Development Fundamentals
- - [Application Development Package Structure (FA Model)](quick-start/package-structure.md)
- - [Application Development Package Structure (Stage Model)](quick-start/module-structure.md)
+ - [Application Package Structure Configuration File (FA Model)](quick-start/package-structure.md)
+ - [Application Package Structure Configuration File (Stage Model)](quick-start/stage-structure.md)
- [Resource File Categories](quick-start/basic-resource-file-categories.md)
- [SysCap](quick-start/syscap.md)
- Development
@@ -36,8 +36,8 @@
- [Device Usage Statistics](device-usage-statistics/Readme-EN.md)
- [DFX](dfx/Readme-EN.md)
- [Internationalization](internationalization/Readme-EN.md)
- -
- - [Using Native APIs in Application Projects](napi/napi-guidelines.md)
+ - [OpenHarmony IDL Specifications and User Guide](IDL/idl-guidelines.md)
+ - [Using Native APIs in Application Projects](napi/Readme-EN.md)
- Tools
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
diff --git a/en/application-dev/ability/ability-delegator.md b/en/application-dev/ability/ability-delegator.md
index cbf823bacad7b9781d90c8a86224893740444f35..4e27041093bc2b9d1e3a2966f7a5f20b0f51b94c 100644
--- a/en/application-dev/ability/ability-delegator.md
+++ b/en/application-dev/ability/ability-delegator.md
@@ -1,60 +1,71 @@
# Test Framework Usage
## Overview
-The delegator test framework provides a self-test framework (environment) for OpenHarmony applications. Using this framework, you can start an ability, schedule its lifecycle, listen for its state changes, run a shell command, and print the test result.
+The delegator test framework provides a self-test environment for OpenHarmony applications. Using this framework, you can start an ability, schedule its lifecycle, listen for its state changes, run a shell command, and print the test result.
## Constraints
-The APIs provided by the test framework can be used only in the test HAP. They take effect only after the test framework is started by running the **aa test** command or using the Integrated Development Environment (IDE).
+The APIs provided by the test framework can be used only in the test HAP. They take effect only after the test framework is started.
## Starting the Test Framework
-The test framework can be started using either of the following methods:
+The test framework can be started in either of the following ways:
-- Method 1: Run the **aa test** command.
+- Method 1: Run the aa test command.
- Method 2: Use the IDE.
### Running aa test
-You can run the **aa test** command to start the test framework. You can specify the **TestRunner** to be used and the package name or module name of the HAP where the **TestRunner** is located.
+To start the test framework, specify the **TestRunner** and the package name or module name of the HAP where the **TestRunner** is located.
An example command in the FA model is as follows:
```javascript
-aa test -p com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20
+aa test -b BundleName -p com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20
```
An example command in the stage model is as follows:
```javascript
-aa test -m com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20
+aa test -b BundleName -m com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20
```
| Parameter | Mandatory| Description |
| --------------- | -------- | ------------------------------------------------------------ |
+| -b | Yes | Bundle name of the HAP where the **TestRunner** is located. |
| -p | Yes | Package name of the HAP where the **TestRunner** is located. This parameter is used by the FA model. |
| -m | Yes | Module name of the HAP where the **TestRunner** is located. This parameter is used by the stage model. |
| -s unittest | Yes | Name of the **TestRunner** to be used. The TestRunner name must be the same as the file name. |
-| -w | No | Timeout interval of a test case, in seconds. If this parameter is not specified, the test framework exits only after **finishTest** is invoked.|
-| -s | No | It can be any parameter in the key-value format. The entered parameters can be obtained in key-value mode through **AbilityDelegatorArgs.parameters**. For example, in **-s classname myTest**, **classname** is the key and **myTest** is the value.|
+| -w | No | Timeout interval of a test case, in seconds. If this parameter is not specified or is set to a value less than or equal to **0**, the test framework exits only after **finishTest** is invoked.|
+| -s \\ | No | **-s** can be followed by any key-value pair obtained through **AbilityDelegatorArgs.parameters**. For example, in **-s classname myTest**, **-s classname** is the key and **myTest** is the value.|
+| -D | No | Debug mode for starting the tested application. |
+| -h | No | Help information. |
### Using the IDE
-For details about how to start the IDE, see [IDE Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-openharmony-test-framework-0000001263160453#section1034420367508).
+For details about how to use the IDE to start the test framework, see [IDE Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-openharmony-test-framework-0000001263160453#section1034420367508).
## Introduction to TestRunner
**TestRunner** is the entry class of the test framework test process. When the test process is started, the system calls related APIs in **TestRunner**. You need to inherit this class and override the **onPrepare** and **onRun** APIs. When creating an application template, the IDE initializes the default **TestRunner** and starts the default **TestAbility** in the **onRun** API. You can modify the test code of **TestAbility** or override **onPrepare** and **onRun** in **TestRunner** to implement your own test code. For details, see [TestRunner](../reference/apis/js-apis-testRunner.md).
+## Introduction to AbilityDelegatorRegistry
+
+**AbilityDelegatorRegistry** is the **AbilityDelegator** repository class provided by the test framework. You can use **AbilityDelegatorRegistry** to obtain an **AbilityDelegator** instance and the input and generated parameters **AbilityDelegatorArgs** during the test. You can use **AbilityDelegator** to invoke the function set provided by the test framework for testing and verification. For details, see [AbilityDelegatorRegistry](../reference/apis/js-apis-abilityDelegatorRegistry.md).
+
+## Introduction to AbilityDelegatorArgs
+
+**AbilityDelegatorArgs** is a test parameter class provided by the test framework. You can use **AbilityDelegatorArgs** to obtain the parameters passed and generated during the test. For details, see [AbilityDelegatorArgs](../reference/apis/js-apis-application-abilityDelegatorArgs.md).
+
## Introduction to AbilityMonitor
-**AbilityMonitor** is provided by the test framework for binding to and listening for abilities. You can use **AbilityMonitor** to bind to an **Ability** instance and add **AbilityMonitor** to the listening list. After an ability is bound, the creation and lifecycle changes of the ability will trigger the related callback in **AbilityMonitor**. You can test and verify the ability in these callbacks. For details, see [AbilityMonitor](../reference/apis/js-apis-application-abilityMonitor.md).
+**AbilityMonitor** is provided by the test framework for binding to and listening for abilities. You can use **AbilityMonitor** to bind to an **Ability** instance and add **AbilityMonitor** to the listening list. When **AbilityMonitor** is bound to an ability, the creation and lifecycle changes of the ability will trigger the related callback in **AbilityMonitor**. You can test and verify the ability in these callbacks. For details, see [AbilityMonitor](../reference/apis/js-apis-application-abilityMonitor.md).
**Example**
```javascript
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
-function onAbilityCreateCallback() {
+function onAbilityCreateCallback(data) {
console.info("onAbilityCreateCallback");
}
@@ -64,7 +75,7 @@ var monitor = {
}
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
-abilityDelegator.addAbilityMonitor(monitor).then((void) => {
+abilityDelegator.addAbilityMonitor(monitor).then(() => {
console.info("addAbilityMonitor promise");
});
```
@@ -94,7 +105,7 @@ var abilityDelegator;
var ability;
var timeout = 100;
-function onAbilityCreateCallback() {
+function onAbilityCreateCallback(data) {
console.info("onAbilityCreateCallback");
}
@@ -113,8 +124,6 @@ var want = {
bundleName: "bundleName",
abilityName: "abilityName"
};
-
-abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.startAbility(want, (err, data) => {
console.info("startAbility callback");
});
@@ -126,14 +135,44 @@ abilityDelegator.startAbility(want, (err, data) => {
### Running a Shell Command
-**AbilityDelegator** provides APIs to run shell commands. You can run a shell command in the test code. This feature takes effect only in the test environment.
+**AbilityDelegator** provides APIs to run shell commands in the test environment.
**Example**
```javascript
- var abilityDelegator;
- var cmd = "cmd";
- abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
- abilityDelegator.executeShellCommand(cmd, (err,data) => {
+var abilityDelegator;
+var cmd = "cmd";
+abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info("executeShellCommand callback");
- });
+});
+```
+
+### Printing Log Information
+
+**AbilityDelegator** provides APIs for printing log information. You can call any API in the test code to print process logs to the unit test console.
+**Example**
+
+```javascript
+var abilityDelegator;
+var msg = "msg";
+
+abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+abilityDelegator.print(msg, (err) => {
+ console.info("print callback");
+});
+```
+
+### Finishing the Test and Printing Log Information
+
+**AbilityDelegator** provides the APIs for actively finishing the test. You can call any API in test code to finish the test and print logs to the unit test console.
+**Example**
+
+```javascript
+var abilityDelegator;
+var msg = "msg";
+
+abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+abilityDelegator.finishTest(msg, 0, (err) => {
+ console.info("finishTest callback");
+});
```
diff --git a/en/application-dev/ability/fa-pageability.md b/en/application-dev/ability/fa-pageability.md
index e6c097d55d25d1717c342c847452b0a84baf0d83..d4f6a193ff4b25859f6545b9bfd8eb2adf921229 100644
--- a/en/application-dev/ability/fa-pageability.md
+++ b/en/application-dev/ability/fa-pageability.md
@@ -2,13 +2,13 @@
## Overview
### Concepts
-The Page ability implements the ArkUI and provides the capability of interacting with developers. When you create an ability in the integrated development environment (IDE), the IDE automatically creates template code. The capabilities related to the Page ability are implemented through the **featureAbility**, and the lifecycle callbacks are implemented through the callbacks in **app.js/app.ets**.
+The Page ability implements the ArkUI and provides the capability of interacting with developers. When you create an ability in DevEco Studio, DevEco Studio automatically creates template code. The capabilities related to the Page ability are implemented through the **featureAbility**, and the lifecycle callbacks are implemented through the callbacks in **app.js** or **app.ets**.
### Page Ability Lifecycle
**Ability lifecycle**
-The Page ability lifecycle is a general term for all states of a Page ability, such as **INACTIVE**, **ACTIVE**, and **BACKGROUND**.
+The Page ability lifecycle defines all states of a Page ability, such as **INACTIVE**, **ACTIVE**, and **BACKGROUND**.
The following figure shows the lifecycle state transition of the Page ability.
@@ -17,25 +17,25 @@ The following figure shows the lifecycle state transition of the Page ability.
Description of ability lifecycle states:
- - **UNINITIALIZED**: The Page ability is not initialized. This is a temporary state. A Page ability changes directly to the **INITIAL** state upon its creation.
+ - **UNINITIALIZED**: The Page ability is not initialized. This is a temporary state, from which a Page ability changes directly to the **INITIAL** state upon its creation.
- - **INITIAL**: This state refers to the initial or stopped state. The Page ability in this state is not running. The Page ability enters the **INACTIVE** state after it is started.
+ - **INITIAL**: The Page ability is initialized but not running. The Page ability enters the **INACTIVE** state after it is started.
- - **INACTIVE**: The ability is visible but does not gain focus.
+ - **INACTIVE**: The Page ability is visible but does not gain focus.
- - **ACTIVE**: The ability runs in the foreground and gains focus.
+ - **ACTIVE**: The Page ability runs in the foreground and has focus.
- - **BACKGROUND**: The Page ability returns to the background. After being re-activated, the Page ability enters the **ACTIVE** state. After being destroyed, the Page ability enters the **INITIAL** state.
+ - **BACKGROUND**: The Page ability runs in the background. After being re-activated, the Page ability enters the **ACTIVE** state. After being destroyed, the Page ability enters the **INITIAL** state.
**The following figure shows the relationship between lifecycle callbacks and lifecycle states of the Page ability.**

-You can override the lifecycle callbacks provided by the Page ability in the **app.js/app.ets** file. Currently, the **app.js** file provides only the **onCreate** and **onDestroy** callbacks, and the **app.ets** file provides the full lifecycle callbacks.
+You can override the lifecycle callbacks provided by the Page ability in the **app.js** or **app.ets** file. Currently, the **app.js** file provides only the **onCreate** and **onDestroy** callbacks, and the **app.ets** file provides the full lifecycle callbacks.
### Launch Type
The ability supports two launch types: singleton and multi-instance.
-The **launchType** item in the **config.json** file is used to specify the launch type.
+You can specify the launch type by setting **launchType** in the **config.json** file.
| Launch Type | Description |Description |
| ----------- | ------- |---------------- |
@@ -55,7 +55,7 @@ By default, **singleton** is used.
| void startAbility(parameter: StartAbilityParameter) | Starts an ability. |
| Context getContext(): | Obtains the application context.|
| void terminateSelf() | Terminates the ability. |
-| bool hasWindowFocus() | Checks whether the ability gains focus. |
+| bool hasWindowFocus() | Checks whether the ability has focus. |
### Starting a Local Page Ability
@@ -76,37 +76,10 @@ By default, **singleton** is used.
action: "",
entities: [""],
type: "",
- options: {
- // Grant the permission to perform read operations on the URI.
- authReadUriPermission: true,
- // Grant the permission to perform write operations on the URI.
- authWriteUriPermission: true,
- // Support forwarding the Want result to the ability.
- abilityForwardResult: true,
- // Enable abiligy continuation.
- abilityContinuation: true,
- // Specify that a component does not belong to ohos.
- notOhosComponent: true,
- // Specify that an ability is started.
- abilityFormEnabled: true,
- // Grant the permission for possible persisting on the URI.
- authPersistableUriPermission: true,
- // Grant the permission for possible persisting on the prefix URI.
- authPrefixUriPermission: true,
- // Support distributed scheduling system startup on multiple devices.
- abilitySliceMultiDevice: true,
- // A service ability is started regardless of whether the host application has been started.
- startForegroundAbility: true,
- // Install the specified ability if it is not installed.
- installOnDemand: true,
- // Return the result to the ability slice.
- abilitySliceForwardResult: true,
- // Install the specified ability with background mode if it is not installed.
- installWithBackgroundMode: true
- },
deviceId: "",
- bundleName: "com.example.startability",
- abilityName: "com.example.startability.MainAbility",
+ bundleName: "com.example.myapplication",
+ /* In the FA model, abilityName consists of package and ability name. */
+ abilityName: "com.example.entry.secondAbility",
uri: ""
},
},
@@ -122,10 +95,10 @@ You can also include **parameters** in the **want** parameter and set its value
featureAbility.startAbility({
want:
{
- bundleName: "com.example.startability",
+ bundleName: "com.example.myapplication",
uri: "",
parameters: {
- abilityName: "com.example.startability.MainAbility"
+ abilityName: "com.example.entry.secondAbility"
}
},
},
@@ -227,15 +200,15 @@ In the cross-device scenario, the application must also apply for the data synch
| API | Description |
| ------------ | ------------------------------------------------------------ |
| onShow() | Called when the ability is switched from the background to the foreground. In this case, the ability is visible to users.|
-| onHide() | Called when the ability is switched from the foreground to the background. In this case, the ability is invisible.|
-| onDestroy() | Called when the ability is destroyed. In this callback, you can make preparations for app exit, such as recycling resources and clearing the cache.|
+| onHide() | Called when the ability is switched from the foreground to the background. In this case, the ability is invisible to users.|
+| onDestroy() | Called when the ability is destroyed. In this callback, you can make preparations for application exit, such as recycling resources and clearing the cache.|
| onCreate() | Called when the ability is created for the first time. You can initialize the application in this callback.|
-| onInactive() | Called when the ability loses focus. An ability loses focus before entering the background state.|
+| onInactive() | Called when the ability loses focus. An ability loses focus when it is about to enter the background state.|
| onActive() | Called when the ability is switched to the foreground and gains focus. |
**Example**
-You need to override the lifecycle callbacks in **app.js/app.ets**. The IDE template generates **onCreate()** and **onDestroy()** by default. You need to override the other callbacks.
+You need to override the lifecycle callbacks except **onCreate()** and **onDestroy()** in **app.js** or **app.ets**. The **onCreate()** and **onDestroy()** callbacks are automatically generated in the template code provided by DevEco Studio.
```javascript
export default {
@@ -261,4 +234,5 @@ export default {
```
## Samples
The following sample is provided to help you better understand how to develop a Page ability:
-- [`DMS`: Distributed Demo (eTS) (API7)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
+
+- [`DMS`: Distributed Demo (eTS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
diff --git a/en/application-dev/ability/stage-call.md b/en/application-dev/ability/stage-call.md
index 6b1ab0c3cae210aca41488cc4750382128635a1e..9f7216de316df0e4d786e8e25b770dea45be7f6d 100644
--- a/en/application-dev/ability/stage-call.md
+++ b/en/application-dev/ability/stage-call.md
@@ -8,13 +8,17 @@ The following figure shows the ability call process.

+>  **NOTE**
+> The startup mode of the callee must be **singleton**.
+> Currently, only system applications and Service Extension abilities can use the **Call** APIs to access the callee.
+
## Available APIs
The table below describes the ability call APIs. For details, see [Ability](../reference/apis/js-apis-application-ability.md#caller).
**Table 1** Ability call APIs
|API|Description|
|:------|:------|
-|Promise startAbilityByCall(want: Want)|Obtains the caller interface of the specified ability, and if the specified ability is not started, starts the ability in the background.|
+|Promise startAbilityByCall(want: Want)|Obtains the caller interface of the specified ability and, if the specified ability is not running, starts the ability in the background.|
|void on(method: string, callback: CalleeCallBack)|Callee.on: callback invoked when the callee registers a method.|
|void off(method: string)|Callee.off: callback invoked when the callee deregisters a method.|
|Promise call(method: string, data: rpc.Sequenceable)|Caller.call: sends agreed sequenceable data to the callee.|
@@ -77,7 +81,7 @@ export default class MySequenceable {
```
4. Implement **Callee.on** and **Callee.off**.
- The time to register a listener for the callee depends on your application. The data sent and received before the listener is registered and that after the listener is deregistered are not processed. In the following example, the **CalleeSortMethod** listener is registered in **onCreate** of the ability and deregistered in **onDestroy**. After receiving sequenceable data, the application processes the data and returns them. You need to implement processing based on service requirements. The sample code is as follows:
+ The time to register a listener for the callee depends on your application. The data sent and received before the listener is registered and that after the listener is deregistered are not processed. In the following example, the **CalleeSortMethod** listener is registered in **onCreate** of the ability and deregistered in **onDestroy**. After receiving sequenceable data, the application processes the data and returns the data result. You need to implement processing based on service requirements. The sample code is as follows:
```ts
const TAG: string = '[CalleeAbility]'
const MSG_SEND_METHOD: string = 'CallSendMsg'
@@ -196,7 +200,7 @@ context.requestPermissionsFromUser(permissions).then((data) => {
```
3. Send agreed sequenceable data.
-The sequenceable data can be sent to the callee in either of the following ways: without a return value or obtaining data returned by the callee. The method and sequenceable data must be consistent with those of the callee. The following example describes how to invoke the **Call** API to send data to the callee. The sample code is as follows:
+The sequenceable data can be sent to the callee with or without a return value. The method and sequenceable data must be consistent with those of the callee. The following example describes how to invoke the **Call** API to send data to the callee. The sample code is as follows:
```ts
const MSG_SEND_METHOD: string = 'CallSendMsg'
async onButtonCall() {
@@ -242,9 +246,6 @@ try {
}
```
-## Development Example
+## Samples
The following sample is provided to help you better understand how to develop an ability call in the stage model:
-
-[StageCallAbility](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
-
-In this sample, the **AbilityStage** APIs are implemented in the **AbilityStage.ts** file in the **Application** directory, the **Ability** APIs are implemented in the **MainAbility** directory, and **pages/index** is the pages of the ability. Another ability and callee are implemented in the **CalleeAbility** directory, and its pages are the content configured in **pages/second**. The **MainAbility** functions as the caller, and the **CalleeAbility** functions as the callee. After starting the **CalleeAbility**, the **MainAbility** obtains the caller interface, processes the string entered by the user, and transfers the processed string to the **CalleeAbility**. The **CalleeAbility** refreshes the page based on the received data and returns the result to the **MainAbility**.
+- [`StageCallAbility`: Stage Ability Creation and Usage (eTS, API version 9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
diff --git a/en/application-dev/application-dev-guide-for-gitee.md b/en/application-dev/application-dev-guide-for-gitee.md
index 36b0f4a7c3f8a224dbdd2dbd8f9b983203b7a2c8..f1f397fc5145208733c85a3e711f3cda0337d409 100644
--- a/en/application-dev/application-dev-guide-for-gitee.md
+++ b/en/application-dev/application-dev-guide-for-gitee.md
@@ -44,7 +44,7 @@ DevEco Studio is a high-performance integrated development environment (IDE) rec
### Hands-On Tutorials
-To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/app_samples/blob/master/README.md).
+To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) and [codelabs](https://gitee.com/openharmony/codelabs).
### API References
diff --git a/en/application-dev/application-dev-guide.md b/en/application-dev/application-dev-guide.md
index 0a4df60f399da15279a2b6d344b681b56325c50b..8e47dd69696fd4ec4f6842f9f08826e181805ada 100644
--- a/en/application-dev/application-dev-guide.md
+++ b/en/application-dev/application-dev-guide.md
@@ -44,7 +44,7 @@ DevEco Studio is a high-performance integrated development environment (IDE) rec
### Hands-On Tutorials
-To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/app_samples/blob/master/README.md).
+To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) and [codelabs](https://gitee.com/openharmony/codelabs).
### API References
diff --git a/en/application-dev/background-task-management/background-task-overview.md b/en/application-dev/background-task-management/background-task-overview.md
index 5062447a9c9491ee0854963f4360c610fb2815f6..aa140c3d734be0ec39def56d9cee0732b0f09368 100644
--- a/en/application-dev/background-task-management/background-task-overview.md
+++ b/en/application-dev/background-task-management/background-task-overview.md
@@ -1,4 +1,4 @@
-# Background Task Overview
+# Background Task Management Overview
Frequent activities of background applications cause user devices to consume power quickly and respond slowly. To meet performance and power consumption requirements, the system allows applications to execute only activities within the specifications in the background. Activities beyond the specifications are suspended by default, and resources allocated to them will be reclaimed when the available resources are insufficient.
diff --git a/en/application-dev/connectivity/Readme-EN.md b/en/application-dev/connectivity/Readme-EN.md
index f6187b328a6cfee0272e63fd8f98add01bd05bc7..16bf40cf8467bc805d3b485ca46d6f0fa295b3bc 100755
--- a/en/application-dev/connectivity/Readme-EN.md
+++ b/en/application-dev/connectivity/Readme-EN.md
@@ -1,4 +1,4 @@
-# Network and Connectivity
+# Connectivity
- Network Management
- [Network Management Overview](net-mgmt-overview.md)
@@ -7,5 +7,5 @@
- [Socket Connection](socket-connection.md)
- IPC & RPC
- [IPC & RPC Overview](ipc-rpc-overview.md)
- - [IPC & RPC Development Guidelines](ipc-rpc-development-guideline.md)
+ - [IPC & RPC Development](ipc-rpc-development-guideline.md)
- [Subscribing to State Changes of a Remote Object](subscribe-remote-state.md)
diff --git a/en/application-dev/connectivity/http-request.md b/en/application-dev/connectivity/http-request.md
index ee4610f46c3c1f25a2509e54bbfb0e9ddb473853..0a69a2e0f79a874def98d2be58d26d6dec0c3874 100644
--- a/en/application-dev/connectivity/http-request.md
+++ b/en/application-dev/connectivity/http-request.md
@@ -12,20 +12,20 @@ To use related APIs, you must declare the **ohos.permission.INTERNET** permissio
The following table describes the related APIs.
-| API | Description |
-| ----------------------------------------- | ----------------------------------- |
-| createHttp() | Creates an HTTP request. |
-| request() | Initiates an HTTP request to a given URL. |
-| destroy() | Destroys an HTTP request. |
+| API | Description |
+| ----------------------------------------- | --------------------------------------------------------- |
+| createHttp() | Creates an HTTP request. |
+| request() | Initiates an HTTP request to a given URL. |
+| destroy() | Destroys an HTTP request. |
| on(type: 'headersReceive') | Registers an observer for HTTP Response Header events. |
-| off(type: 'headersReceive') | Unregisters the observer for HTTP Response Header events.|
+| off(type: 'headersReceive') | Unregisters the observer for HTTP Response Header events. |
## How to Develop
1. Import the required HTTP module.
2. Create an **HttpRequest** object.
3. (Optional) Listen for HTTP Response Header events.
-4. Initiates an HTTP request to a given URL.
+4. Initiate an HTTP request to a given URL.
5. (Optional) Process the HTTP Response Header event and the return result of the HTTP request.
```js
@@ -71,3 +71,7 @@ httpRequest.request(
}
);
```
+
+## Samples
+The following sample is provided to help you better understand how to develop the HTTP data request feature:
+- [`Http`: HTTP Data Request (eTS) (API 8)](https://gitee.com/openharmony/app_samples/tree/master/Network/Http)
diff --git a/en/application-dev/connectivity/ipc-rpc-development-guideline.md b/en/application-dev/connectivity/ipc-rpc-development-guideline.md
index a0107dabe7b716b4f7fe2c163c8f48970337959d..03019858805cff17ef97b4c7227ee5c86947536b 100644
--- a/en/application-dev/connectivity/ipc-rpc-development-guideline.md
+++ b/en/application-dev/connectivity/ipc-rpc-development-guideline.md
@@ -6,7 +6,7 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
## Available APIs
-**Table 1** Native IPC APIs
+**Table 1** Native IPC APIs
Class/Interface
@@ -44,9 +44,9 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
**Using Native APIs**
-1. Define the IPC interface **ITestAbility**.
+1. Define the IPC interface **ITestAbility**.
- **ITestAbility** inherits the IPC base class **IRemoteBroker** and defines descriptors, functions, and message code. The functions need to be implemented on both the proxy and stub.
+ **ITestAbility** inherits the IPC base class **IRemoteBroker** and defines descriptors, functions, and message code. The functions need to be implemented on both the proxy and stub.
```
class ITestAbility : public IRemoteBroker {
@@ -58,9 +58,9 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
};
```
-2. Define and implement service provider **TestAbilityStub**.
+2. Define and implement service provider **TestAbilityStub**.
- This class is related to the IPC framework and needs to inherit **IRemoteStub**. You need to override **OnRemoteRequest** on the stub to receive requests from the proxy.
+ This class is related to the IPC framework and needs to inherit **IRemoteStub**. You need to override **OnRemoteRequest** on the stub to receive requests from the proxy.
```
class TestAbilityStub : public IRemoteStub {
@@ -85,7 +85,7 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
}
```
-3. Define the **TestAbility** class that implements functions for the stub.
+3. Define the **TestAbility** class that implements functions for the stub.
```
class TestAbility : public TestAbilityStub {
@@ -98,9 +98,9 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
}
```
-4. Define and implement **TestAbilityProxy**.
+4. Define and implement **TestAbilityProxy**.
- This class is implemented on the proxy and inherits **IRemoteProxy**. You can call **SendRequest** to send a request to the stub and expose the capabilities provided by the stub.
+ This class is implemented on the proxy and inherits **IRemoteProxy**. You can call **SendRequest** to send a request to the stub and expose the capabilities provided by the stub.
```
class TestAbilityProxy : public IRemoteProxy {
@@ -128,7 +128,7 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
5. Register and start an SA.
- Call **AddSystemAbility** to register the **TestAbilityStub** instance of the SA with **SystemAbilityManager**. The registration parameters vary depending on whether the **SystemAbilityManager** resides on the same device as the SA.
+ Call **AddSystemAbility** to register the **TestAbilityStub** instance of the SA with **SystemAbilityManager**. The registration parameters vary depending on whether the **SystemAbilityManager** resides on the same device as the SA.
```
// Register the TestAbilityStub instance with the SystemAbilityManager on the same device as the SA.
@@ -144,7 +144,7 @@ IPC/RPC enables a proxy and a stub that run on different processes to communicat
6. Obtain the SA.
- Call the **GetSystemAbility** function of the **SystemAbilityManager** class to obtain the **IRemoteObject** for the SA, and create a **TestAbilityProxy** instance.
+ Call the **GetSystemAbility** function of the **SystemAbilityManager** class to obtain the **IRemoteObject** for the SA, and create a **TestAbilityProxy** instance.
```
// Obtain the proxy of the SA registered on the local device.
diff --git a/en/application-dev/connectivity/ipc-rpc-overview.md b/en/application-dev/connectivity/ipc-rpc-overview.md
index c586dbd1fe7e7b24496be753ef95a41f3355f119..19bbe8dc26871bec8b2f6f48273d90dacc148d70 100755
--- a/en/application-dev/connectivity/ipc-rpc-overview.md
+++ b/en/application-dev/connectivity/ipc-rpc-overview.md
@@ -19,4 +19,4 @@ In OpenHarmony documents, proxy represents the service requester, and stub repre
## Related Modules
-Distributed Scheduler
+[Distributed Scheduler](https://gitee.com/openharmony/distributedschedule_dms_fwk)
diff --git a/en/application-dev/connectivity/socket-connection.md b/en/application-dev/connectivity/socket-connection.md
index 98b82c8064e58de21d742efc79b51ff3ef46a331..ede8acfcbe792f81437701cb7032e3fcf7b335b9 100644
--- a/en/application-dev/connectivity/socket-connection.md
+++ b/en/application-dev/connectivity/socket-connection.md
@@ -10,26 +10,26 @@ Your application can transmit data through Socket connections. Currently, the TC
The Socket connection function is mainly implemented by the Socket module. The following table describes the related APIs.
-| API| Description|
+| API| Description |
| -------- | -------- |
-| constructUDPSocketInstance() | Creates a **UDPSocket** object.|
-| constructTCPSocketInstance() | Creates a **TCPSocket** object.|
-| bind() | Binds the IP address and port number.|
+| constructUDPSocketInstance() | Creates a **UDPSocket** object. |
+| constructTCPSocketInstance() | Creates a **TCPSocket** object. |
+| bind() | Binds the IP address and port number. |
| send() | Sends data.|
-| close() | Closes a Socket connection.|
-| getState() | Obtains the Socket connection status.|
-| connect() | Connects to the specified IP address and port. This function is supported only for TCP.|
-| getRemoteAddress() | Obtains the peer address of the Socket connection. This function is supported only for TCP. The **connect** API must have been called before you use this API.|
-| on(type: 'message') | Enables listening for **message** events of the Socket connection.|
-| off(type: 'message') | Disables listening for **message** events of the Socket connection.|
-| on(type: 'close') | Enables listening for **close** events of the Socket connection.|
-| off(type: 'close') | Disables listening for **close** events of the Socket connection.|
-| on(type: 'error') | Enables listening for **error** events of the Socket connection.|
-| off(type: 'error') | Disables listening for **error** events of the Socket connection.|
+| close() | Closes a Socket connection. |
+| getState() | Obtains the Socket connection status. |
+| connect() | Connects to the specified IP address and port. This function is supported only for TCP. |
+| getRemoteAddress() | Obtains the peer address of the Socket connection. This function is supported only for TCP. The **connect** API must have been called before you use this API. |
+| on(type: 'message') | Enables listening for **message** events of the Socket connection. |
+| off(type: 'message') | Disables listening for **message** events of the Socket connection. |
+| on(type: 'close') | Enables listening for **close** events of the Socket connection. |
+| off(type: 'close') | Disables listening for **close** events of the Socket connection. |
+| on(type: 'error') | Enables listening for **error** events of the Socket connection. |
+| off(type: 'error') | Disables listening for **error** events of the Socket connection. |
| on(type: 'listening') | Enables listening for **listening** events of the UDPSocket connection. |
| off(type: 'listening') | Disables listening for **listening** events of the UDPSocket connection. |
| on(type: 'connect') | Enables listening for **connect** events of the TCPSocket connection. |
-| off(type: 'connect') | Disables listening for **connect** events of the TCPSocket connection.|
+| off(type: 'connect') | Disables listening for **connect** events of the TCPSocket connection. |
## How to Develop
@@ -122,3 +122,7 @@ The implementation is similar for UDPSocket and TCPSocket. The following uses th
tcp.off('close');
}, 30 * 1000);
```
+
+## Samples
+The following sample is provided to help you better understand how to develop the socket connection feature:
+- [`Socket`: Socket Connection (eTS) (API 8)](https://gitee.com/openharmony/app_samples/tree/master/Network/Socket)
diff --git a/en/application-dev/connectivity/websocket-connection.md b/en/application-dev/connectivity/websocket-connection.md
index 42501508c4c89a6a3a2c35b1d585e73946c3a629..01f5f38fad74e234c8a9fb483ee4a11ae2a8c7a7 100644
--- a/en/application-dev/connectivity/websocket-connection.md
+++ b/en/application-dev/connectivity/websocket-connection.md
@@ -12,20 +12,20 @@ If an error occurs in any of the preceding processes, the client will receive a
The WebSocket connection function is mainly implemented by the WebSocket module. To use related APIs, you must declare the **ohos.permission.INTERNET** permission. The following table describes the related APIs.
-| API| Description|
+| API | Description |
| -------- | -------- |
-| createWebSocket() | Creates a WebSocket connection.|
-| connect() | Establishes a WebSocket connection to a given URL.|
-| send() | Sends data through the WebSocket connection.|
-| close() | Closes a WebSocket connection.|
-| on(type: 'open') | Enables listening for **open** events of a WebSocket connection.|
-| off(type: 'open') | Disables listening for **open** events of a WebSocket connection.|
-| on(type: 'message') | Enables listening for **message** events of a WebSocket connection.|
-| off(type: 'message') | Disables listening for **message** events of a WebSocket connection.|
-| on(type: 'close') | Enables listening for **close** events of a WebSocket connection.|
-| off(type: 'close') | Disables listening for **close** events of a WebSocket connection.|
-| on(type: 'error') | Enables listening for **error** events of a WebSocket connection.|
-| off(type: 'error') | Disables listening for **error** events of a WebSocket connection.|
+| createWebSocket() | Creates a WebSocket connection. |
+| connect() | Establishes a WebSocket connection to a given URL. |
+| send() | Sends data through the WebSocket connection. |
+| close() | Closes a WebSocket connection. |
+| on(type: 'open') | Enables listening for **open** events of a WebSocket connection. |
+| off(type: 'open') | Disables listening for **open** events of a WebSocket connection. |
+| on(type: 'message') | Enables listening for **message** events of a WebSocket connection. |
+| off(type: 'message') | Disables listening for **message** events of a WebSocket connection. |
+| on(type: 'close') | Enables listening for **close** events of a WebSocket connection. |
+| off(type: 'close') | Disables listening for **close** events of a WebSocket connection. |
+| on(type: 'error') | Enables listening for **error** events of a WebSocket connection. |
+| off(type: 'error') | Disables listening for **error** events of a WebSocket connection. |
## How to Develop
diff --git a/en/application-dev/database/Readme-EN.md b/en/application-dev/database/Readme-EN.md
index 2be9b2dc5a8f9d6c714cc81e695ade8ad11f23ab..9f7ccd0d08e8683aca6e6c86ddef80f8e0e5aad4 100644
--- a/en/application-dev/database/Readme-EN.md
+++ b/en/application-dev/database/Readme-EN.md
@@ -6,9 +6,9 @@
- Relational Database
- [RDB Overview](database-relational-overview.md)
- [RDB Development](database-relational-guidelines.md)
-- Lightweight Data Store
- - [Lightweight Data Store Overview](database-preference-overview.md)
- - [Lightweight Data Store Development](database-preference-guidelines.md)
+- Preferences
+ - [Preferences Overview](database-preference-overview.md)
+ - [Preferences Development](database-preference-guidelines.md)
- Distributed Data Object
- [Distributed Data Object Overview](database-distributedobject-overview.md)
- [Distributed Data Object Development](database-distributedobject-guidelines.md)
diff --git a/en/application-dev/database/database-distributedobject-guidelines.md b/en/application-dev/database/database-distributedobject-guidelines.md
index 08b72e45cbd9c1f505f99be567e45296fbce8c52..516ed427b9b8d613b832b430cc63e7d3fa4cd30f 100644
--- a/en/application-dev/database/database-distributedobject-guidelines.md
+++ b/en/application-dev/database/database-distributedobject-guidelines.md
@@ -2,7 +2,7 @@
## When to Use
-The distributed data objects allow data across devices to be processed like local variables by shielding complex data interaction between devices. For the devices that form a Super Device, when data in the distributed data object of an application is added, deleted, or modified on a device, the data for the same application is also updated on the other devices. The devices can listen for the data changes and online and offline states of other devices. The distributed data objects support basic data types, such as number, string, and Boolean, as well as complex data types, such as array and nested basic types.
+The distributed data objects allow data across devices to be processed like local variables by shielding complex data interaction between devices. For the devices that form a Super Device, when data in the distributed data object of an application is added, deleted, or modified on a device, the data for the same application is also updated on the other devices. The devices can listen for the data changes and online and offline status of other devices. The distributed data objects support basic data types, such as number, string, and Boolean, as well as complex data types, such as array and nested basic types.
## Available APIs
@@ -13,47 +13,47 @@ Call **createDistributedObject()** to create a distributed data object instance.
**Table 1** API for creating a distributed data object instance
-| Package| API| Description|
-| -------- | -------- | -------- |
-| ohos.data.distributedDataObject| createDistributedObject(source: object): DistributedObject | Creates a distributed data object instance for data operations. - **source**: attributes of the **distributedObject** set. - **DistributedObject**: returns the distributed object created.|
+ | Package | API | Description |
+ | -------- | -------- | -------- |
+ | ohos.data.distributedDataObject | createDistributedObject(source: object): DistributedObject | Creates a distributed data object instance for data operations. - **source**: attributes of the **distributedObject** set. - **DistributedObject**: returns the distributed object created. |
### Generating a Session ID
Call **genSessionId()** to generate a session ID randomly. The generated session ID can be used to set the session ID of a distributed data object.
**Table 2** API for generating a session ID randomly
-| Package| API| Description|
-| -------- | -------- | -------- |
-| ohos.data.distributedDataObject| genSessionId(): string | Generates a session ID, which can be used as the session ID of a distributed data object.|
+ | Package | API | Description |
+ | -------- | -------- | -------- |
+ | ohos.data.distributedDataObject | genSessionId(): string | Generates a session ID, which can be used as the session ID of a distributed data object. |
### Setting a SessionID for Distributed Data Objects
-Call setSessionId() to set the session ID for a distributed data object. The session ID is a unique identifier for one collaboration across devices. The distributed data objects to be synchronized must be associated with the same session ID.
+Call **setSessionId()** to set a session ID for a distributed data object. The session ID is a unique identifier for one collaboration across devices. The distributed data objects to be synchronized must be associated with the same session ID.
**Table 3** API for setting a session ID
-| Class| API| Description|
-| -------- | -------- | -------- |
-| DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for distributed data objects. **sessionId**: ID of a distributed object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
+ | Class | API | Description |
+ | -------- | -------- | -------- |
+ | DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for distributed data objects. **sessionId**: session ID of a distributed object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty. |
### Observing Data Changes
Call **on()** to subscribe to data changes of a distributed data object. When the data changes, a callback will be invoked to return the data changes. You can use **off()** to unsubscribe from the data changes.
**Table 4** APIs for observing data changes of a distributed data object
-| Class| API| Description|
-| -------- | -------- | -------- |
-| DistributedDataObject| on(type: 'change', callback: Callback<{ sessionId: string, fields: Array<string> }>): void | Subscribes to data changes.|
-| DistributedDataObject| off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes. Callback used to return changes of the distributed object. If this parameter is not specified, all callbacks related to data changes will be unregistered.|
+ | Class | API | Description |
+ | -------- | -------- | -------- |
+ | DistributedDataObject | on(type: 'change', callback: Callback<{ sessionId: string, fields: Array<string> }>): void | Subscribes to data changes. |
+ | DistributedDataObject | off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes. **Callback**: specifies callback used to return changes of the distributed data object. If this parameter is not specified, all callbacks related to data changes will be unregistered. |
### Observing Online or Offline Status
Call **on()** to subscribe to status changes of a distributed data object. The status can be online or offline. When the status changes, a callback will be invoked to return the status. You can use **off()** to unsubscribe from the status changes.
**Table 5** APIs for observing status changes of a distributed data object
-| Class| API| Description|
-| -------- | -------- | -------- |
-| DistributedDataObject| on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }>): void | Subscribes to the status changes of a distributed data object.|
-| DistributedDataObject| off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }>): void | Unsubscribes from status changes of a distributed data object.|
+ | Class | API | Description |
+ | -------- | -------- | -------- |
+ | DistributedDataObject | on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' \ | 'offline' }>): void | Subscribes to the status changes of a distributed data object. |
+ | DistributedDataObject | off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' \ | 'offline' }>): void | Unsubscribes from status changes of a distributed data object. |
@@ -62,13 +62,13 @@ Call **on()** to subscribe to status changes of a distributed data object. The s
The following example shows how to implement a distributed data object synchronization.
1. Import the @ohos.data.distributedDataObject module to the development environment.
+
```js
import distributedObject from '@ohos.data.distributedDataObject'
```
2. Obtain a distributed data object instance.
- The sample code is as follows:
```js
var local_object = distributedObject.createDistributedObject({name:undefined, age:undefined, isVis:true,
parent:undefined, list:undefined});
@@ -77,8 +77,6 @@ The following example shows how to implement a distributed data object synchroni
3. Add the synchronization network. The data objects in the synchronization network include the local and remote objects.
-
- The sample code is as follows:
```js
// Local object
@@ -90,13 +88,11 @@ The following example shows how to implement a distributed data object synchroni
var remote_object = distributedObject.createDistributedObject({name:undefined, age:undefined, isVis:true,
parent:undefined, list:undefined});
remote_object.setSessionId(sessionId);
- // After obtaining that the device status goes online, the remote object synchronizes data. That is, name changes to jack and age to 18.
+ // After learning that the device goes online, the remote object synchronizes data. That is, name changes to jack and age to 18.
```
-4. Observe the data changes of the distributed data object. Subscribe to data changes of the remote end. When the data is the peer end changes, a callback will be called to return the data changes.
-
- The sample code is as follows:
-
+4. Observe the data changes of the distributed data object. You can subscribe to data changes of the remote object. When the data in the remote object changes, a callback will be called to return the data changes.
+
```js
function changeCallback(sessionId, changeData) {
console.info("change" + sessionId);
@@ -107,14 +103,13 @@ The following example shows how to implement a distributed data object synchroni
});
}
}
-
- // To refresh the page in changeCallback, correctly set this.changeCallback.bind(this) in
- changeCallback.
+
+ // To refresh the page in changeCallback, correctly bind (this) to the changeCallback.
+ local_object.on("change", this.changeCallback.bind(this));
```
5. Modify object attributes. The object attributes support basic data types (such as number, Boolean, and string) and complex data types (array and nested basic types).
-
- The sample code is as follows:
+
```js
local_object.name = "jack";
local_object.age = 19;
@@ -123,7 +118,7 @@ The following example shows how to implement a distributed data object synchroni
local_object.list = [{mother:"jack mom"}, {father:"jack Dad"}];
```
- >  **NOTE**
+ >  **NOTE**
> For the distributed data object of the complex type, only the root attribute can be modified. The subordinate attributes cannot be modified. Example:
```js
// Supported modification.
@@ -133,22 +128,22 @@ The following example shows how to implement a distributed data object synchroni
```
6. Access the distributed data object. Obtain the distributed data object attribute, which is the latest data on the network.
-
- The sample code is as follows:
+
```js
console.info("name " + local_object["name"]);
```
+
7. Unsubscribe from data changes. You can specify the callback to unsubscribe from. If you do not specify the callback, all data change callbacks of the distributed data object will be unsubscribed from.
- The sample code is as follows:
```js
- // Unsubscribe from changeCallback.
+ // Unsubscribe from the specified data change callback.
local_object.off("change", changeCallback);
// Unsubscribe from all data change callbacks.
local_object.off("change");
```
+
8. Subscribe to the status (online/offline) changes of the distributed data object. A callback will be invoked to report the status change when the target distributed data object goes online or offline.
- The sample code is as follows:
+
```js
function statusCallback(sessionId, networkId, status) {
this.response += "status changed " + sessionId + " " + status + " " + networkId;
@@ -156,27 +151,28 @@ The following example shows how to implement a distributed data object synchroni
local_object.on("status", this.statusCallback);
```
-9. Unsubscribe from the status changes of the distributed data object. You can specify the callback to unsubscribe from. If you do not specify the callback, all status change callbacks will be unsubscribe from.
-
- The sample code is as follows:
+
+9. Unsubscribe from the status changes of the distributed data object. You can specify the callback to unsubscribe from. If you do not specify the callback, this API unsubscribes from all callbacks of this distributed data object.
+
```js
- // Unsubscribe from the online status change callback.
+ // Unsubscribe from the specified status change callback.
local_object.off("status", statusCallback);
- // Unsubscribe from all online status change callbacks.
+ // Unsubscribe from all status change callbacks.
local_object.off("status");
```
-10. Remove a distributed data object from the synchronization network. After the distributed data object is removed from the network, the data changes on the local end will not be synchronized to the remote end.
- The sample code is as follows:
- ```js
- local_object.setSessionId("");
- ```
-## Development Example
+10. Remove a distributed data object from the synchronization network. Data changes on the local object will not be synchronized to the removed distributed data object.
+
+ ```js
+ local_object.setSessionId("");
+ ```
+
+## Samples
-The following example is provided for you to better understand the development of distributed data object:
+The following example is provided for you to better understand the development of distributed data objects:
- [Distributed Notepad](https://gitee.com/openharmony/distributeddatamgr_objectstore/tree/master/samples/distributedNotepad)
-When an event occurs on a device, such as a note is added, the tile or content of a note is changed, and the event list is cleared, the change will be synchronized to other devices in the trusted network by the Notepad app.
-
+When an event of the Notepad app occurs on a device, such as a note is added, the tile or content of a note is changed, or the event list is cleared, the change will be synchronized to other devices in the trusted network.
+
diff --git a/en/application-dev/database/database-mdds-guidelines.md b/en/application-dev/database/database-mdds-guidelines.md
index d59fd3904ae8d8606f0ab254d78b9a4f03be3dc8..fb45be2adf83aa7c3a1dac6cc875926c3c22a705 100644
--- a/en/application-dev/database/database-mdds-guidelines.md
+++ b/en/application-dev/database/database-mdds-guidelines.md
@@ -11,15 +11,15 @@ The table below describes the APIs provided by the OpenHarmony DDS module.
**Table 1** APIs provided by the DDS
-| Category | API | Description |
-| -------------------------- | ------------------------------------------------------------ | ----------------------------------------------- |
-| Creating a distributed database | createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager>): void createKVManager(config: KVManagerConfig): Promise<KVManager> | Creates a **KVManager** object for database management.|
-| Obtaining a distributed KV store | getKVStore<T extends KVStore>(storeId: string, options: Options, callback: AsyncCallback<T>): void getKVStore<T extends KVStore>(storeId: string, options: Options): Promise<T> | Obtains the KV store with the specified **Options** and **storeId**.|
-| Managing data in a distributed KV store| put(key: string, value: Uint8Array \| string \| number \| boolean, callback: AsyncCallback<void>): void put(key: string, value: Uint8Array \| string \| number \| boolean): Promise<void> | Inserts and updates data. |
-| Managing data in a distributed KV store| delete(key: string, callback: AsyncCallback<void>): void delete(key: string): Promise<void> | Deletes data. |
-| Managing data in a distributed KV store| get(key: string, callback: AsyncCallback<Uint8Array \| string \| boolean \| number>): void get(key: string): Promise<Uint8Array \| string \| boolean \| number> | Queries data. |
-| Subscribing to changes in the distributed data | on(event: 'dataChange', type: SubscribeType, observer: Callback<ChangeNotification>): void on(event: 'syncComplete', syncCallback: Callback<Array<[string, number]>>): void | Subscribes to data changes in the KV store. |
-| Synchronizing data across devices | sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void | Triggers database synchronization in manual mode. |
+| Category | API | Description |
+| -------- | --- | ----------- |
+| Creating a distributed database | createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager>): void createKVManager(config: KVManagerConfig): Promise<KVManager> | Creates a **KVManager** object for database management.|
+| Obtaining a distributed KV store | getKVStore<T extends KVStore>(storeId: string, options: Options, callback: AsyncCallback<T>): void getKVStore<T extends KVStore>(storeId: string, options: Options): Promise<T> | Obtains the KV store with the specified **Options** and **storeId**. |
+| Managing data in a distributed KV store | put(key: string, value: Uint8Array \| string \| number \| boolean, callback: AsyncCallback<void>): void put(key: string, value: Uint8Array \| string \| number \| boolean): Promise<void> | Inserts and updates data. |
+| Managing data in a distributed KV store| delete(key: string, callback: AsyncCallback<void>): void delete(key: string): Promise<void> | Deletes data. |
+| Managing data in a distributed KV store | get(key: string, callback: AsyncCallback<Uint8Array \| string \| boolean \| number>): void get(key: string): Promise<Uint8Array \| string \| boolean \| number> | Queries data. |
+| Subscribing to changes in the distributed data | on(event: 'dataChange', type: SubscribeType, observer: Callback<ChangeNotification>): void on(event: 'syncComplete', syncCallback: Callback<Array<[string, number]>>): void | Subscribes to data changes in the KV store. |
+| Synchronizing data across devices | sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void | Triggers database synchronization in manual mode. |
@@ -29,6 +29,7 @@ The table below describes the APIs provided by the OpenHarmony DDS module.
The following uses a single KV store as an example to describe the development procedure.
1. Import the distributed data module.
+
```js
import distributedData from '@ohos.data.distributedData';
```
@@ -95,6 +96,7 @@ The following uses a single KV store as an example to describe the development p
4. Subscribe to changes in the distributed data.
The following is the sample code for subscribing to the data changes of a single KV store:
+
```js
kvStore.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_ALL, function (data) {
console.log("dataChange callback call data: " + JSON.stringify(data));
@@ -128,6 +130,7 @@ The following uses a single KV store as an example to describe the development p
2. Query data from the single KV store.
The following is the sample code for querying data of the string type from the single KV store:
+
```js
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
@@ -177,5 +180,5 @@ The following uses a single KV store as an example to describe the development p
```
## Samples
The following samples are provided to help you better understand the distributed data development:
-- [`KvStore`: distributed database (eTS) (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Kvstore)
-- [Distributed Database](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData)
+- [`KvStore`: Distributed Data Management (eTS) (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Kvstore)
+- [Distributed Data Service](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData)
diff --git a/en/application-dev/database/database-preference-guidelines.md b/en/application-dev/database/database-preference-guidelines.md
index fcee818beffac1e1cafaf89af82c5044f111a599..36b6878057640f6cf706efec6d9abbbc1e5b2980 100644
--- a/en/application-dev/database/database-preference-guidelines.md
+++ b/en/application-dev/database/database-preference-guidelines.md
@@ -1,44 +1,44 @@
-# Lightweight Data Store Development
+# Preferences Development
## When to Use
-The lightweight data store is ideal for storing lightweight and frequently used data, but not for storing a large amount of data or data with frequent changes. The application data is persistently stored on a device in the form of files. Note that the instance accessed by an application contains all data of the file. The data is always loaded to the memory of the device until the application removes it from the memory. The application can perform data operations using the **Storage** APIs.
+Preferences are ideal for storing data frequently used by applications, but not for storing a large amount of data or data with frequent changes. The application data is persistently stored on a device in the form of files. Note that the instance accessed by an application contains all data of the file. The data is always loaded to the memory of the device until the application removes it from the memory. The application can perform data operations using the **Preferences** APIs.
## Available APIs
-The lightweight data store provides applications with data processing capability and allows applications to perform lightweight data storage and query. Data is stored in key-value (KV) pairs. Keys are of the string type, and values can be of the number, string, or Boolean type.
+Preferences provide capabilities for processing data in the form of key-value (KV) pairs and support data persistence, modification, and query. In KV pairs, keys are of the string type, and values can be of the number, string, or Boolean type.
-**Creating a Storage Instance**
+### Creating a Preferences Instance
-Create a **Storage** instance for data operations. A **Storage** instance is created after data is read from a specified file and loaded to the instance.
+Create a **Preferences** instance for data operations. A **Preferences** instance is created after data is read from a specified file and loaded to the instance.
-**Table 1** API for creating a **Storage** instance
+**Table 1** API for creating a **Preferences** instance
| Package | API | Description |
| ----------------- | ------------------------------------------- | ------------------------------------------- |
-| ohos.data.storage | getStorage(path: string): Promise\ | Obtains the **Storage** singleton corresponding to a file for data operations.|
+| ohos.data.preferences | getPreferences(context: Context, name: string): Promise\ | Obtains a **Preferences** instance for data operations.|
-**Writing Data**
+### Writing Data
-Call the **put()** method to add or modify data in a **Storage** instance.
+Call the **put()** method to add or modify data in a **Preferences** instance.
**Table 2** API for writing data
| Class | API | Description |
| ------- | -------------------------------------------------- | ----------------------------------------------- |
-| Storage | put(key: string, value: ValueType): Promise\ | Writes data of the number, string, and Boolean types.|
+| Preferences | put(key: string, value: ValueType): Promise\ | Writes data of the number, string, and Boolean types.|
-**Reading Data**
+### Reading Data
-Call the **get()** method to read data from a **Storage** instance.
+Call the **get()** method to read data from a **Preferences** instance.
**Table 3** API for reading data
| Class | API | Description |
| ------- | ---------------------------------------------------------- | ----------------------------------------------- |
-| Storage | get(key: string, defValue: ValueType): Promise\ | Reads data of the number, string, and Boolean types.|
+| Preferences | get(key: string, defValue: ValueType): Promise\ | Reads data of the number, string, and Boolean types.|
-**Storing Data Persistently**
+### Storing Data Persistently
Call the **flush()** method to write the cached data back to its text file for persistent storage.
@@ -46,119 +46,120 @@ Call the **flush()** method to write the cached data back to its text file for p
| Class | API | Description |
| ------- | ----------------------- | --------------------------------------- |
-| Storage | flush(): Promise\ | Writes data in the **Storage** instance back to its file through an asynchronous thread.|
+| Preferences | flush(): Promise\ | Writes data from the **Preferences** instance back to its file through an asynchronous thread.|
-**Observing Data Changes**
+### Observing Data Changes
-Specify **StorageObserver** as the callback to subscribe to data changes. When the value of the subscribed key is changed and the **flush()** method is executed, **StorageObserver** will be invoked.
+You can subscribe to data changes. When the value of the subscribed key is changed by **flush()**, a callback will be invoked to return the new data.
-**Table 5** APIs for observing data changes
+**Table 5** APIs for observing **Preferences** changes
| Class | API | Description |
| ------- | ------------------------------------------------------------ | -------------- |
-| Storage | on(type: 'change', callback: Callback\): void | Subscribe to data changes.|
-| Storage | off(type: 'change', callback: Callback\): void | Unsubscribes from data changes. |
+| Preferences | on(type: 'change', callback: Callback<{ key : string }>): void | Subscribes to data changes.|
+| Preferences | off(type: 'change', callback: Callback<{ key : string }>): void | Unsubscribes from data changes. |
-**Deleting Data**
+### Deleting Data
-Use the following APIs to delete a **Storage** instance or data file.
+Use the following APIs to delete a **Preferences** instance or data file.
-**Table 6** APIs for deleting data
+**Table 6** APIs for deleting **Preferences**
| Package | API | Description |
| ----------------- | ---------------------------------------------------- | ------------------------------------------------------------ |
-| ohos.data.storage | deleteStorage(path: string): Promise\ | Deletes a **Storage** instance from the cache and deletes its file from the device.|
-| ohos.data.storage | removeStorageFromCache(path: string): Promise\ | Deletes a **Storage** instance from the cache to release memory. |
+| ohos.data.preferences | deletePreferences(context: Context, name: string): Promise; | Deletes a **Preferences** instance from the cache and deletes its file from the device.|
+| ohos.data.preferences | removePreferencesFromCache(context: Context, name: string): Promise\; | Removes a **Preferences** instance from the memory to release memory.
## How to Develop
-1. Import @ohos.data.storage and related modules to the development environment.
+1. Import @ohos.data.preferences and related modules to the development environment.
```js
- import dataStorage from '@ohos.data.storage'
- import featureAbility from '@ohos.ability.featureAbility' // Used to obtain the file storage path.
+ import data_preferences from '@ohos.data.preferences'
```
-2. Create a **Storage** instance.
+2. Create a **Preferences** instance.
- Read the specified file and load its data to the **Storage** instance for data operations.
+ Read the specified file and load its data to the **Preferences** instance for data operations.
```js
- var context = featureAbility.getContext()
- context.getFilesDir().then(() => {
- console.info("======================>getFilesDirPromsie====================>");
- });
-
- let promise = dataStorage.getStorage(path + '/mystore')
+ let promise = data_preferences.getPreferences(this.context, 'mystore')
```
3. Write data.
- Use the **put()** method of the **Storage** class to write data to the cached **Storage** instance.
+ Use the **put()** method of the **Preferences** class to write data to the cached **Preferences** instance.
```js
- promise.then((storage) => {
- let getPromise = storage.put('startup', 'auto') // Save data to the Storage instance.
+ promise.then((preferences) => {
+ let getPromise = preferences.put('startup', 'auto')
getPromise.then(() => {
console.info("Put the value of startup successfully.")
}).catch((err) => {
- console.info("Put the value of startup failed with err: " + err)
+ console.info("Failed to put the value of startup with err: " + err)
})
}).catch((err) => {
- console.info("Get the storage failed")
+ console.info("Failed to get the preferences")
})
```
4. Read data.
- Use the **get()** method of the **Storage** class to read data.
+ Use the **get()** method of the **Preferences** class to read data.
```js
- promise.then((storage) => {
- let getPromise = storage.get('startup', 'default')
+ promise.then((preferences) => {
+ let getPromise = preferences.get('startup', 'default')
getPromise.then((value) => {
console.info("The value of startup is " + value)
}).catch((err) => {
- console.info("Get the value of startup failed with err: " + err)
+ console.info("Failed to get the value of startup with err: " + err)
})
}).catch((err) => {
- console.info("Get the storage failed")})
+ console.info("Failed to get the preferences")})
```
5. Store data persistently.
- Use the **flush()** or **flushSync()** method to flush data in the **Storage** instance to its file.
+ Use the **flush()** method to flush data from the **Preferences** instance to its file.
```js
- storage.flush();
+ preferences.flush();
```
-6. Observe data changes.
+6. Observe data changes.
- Specify **StorageObserver** as the callback to subscribe to data changes for an application. When the value of the subscribed key is changed and the **flush()** method is executed, **StorageObserver** will be invoked. Unregister the **StorageObserver** when it is no longer required.
+ Specify an observer as the callback to subscribe to data changes for an application. When the value of the subscribed key is changed and the **flush()** method is executed, the observe callback will be invoked to return the change.
```js
- promise.then((storage) => {
- var observer = function (key) {
- console.info("The key of " + key + " changed.")
- }
- storage.on('change', observer)
- storage.putSync('startup', 'auto') // Modify data in the Storage instance.
- storage.flushSync() // Trigger the StorageObserver callback.
-
- storage.off(...change..., observer) // Unsubscribe from the data changes.
- }).catch((err) => {
- console.info("Get the storage failed")
- })
+ var observer = function (key) {
+ console.info("The key of " + key + " changed.")
+ }
+ preferences.on('change', observer)
+ preferences.put('startup', 'auto', function (err) {
+ if (err) {
+ console.info("Failed to put the value of startup with err: " + err)
+ return
+ }
+ console.info("Put the value of startup successfully.")
+ preferences.flush(function (err) {
+ if (err) {
+ console.info("Failed to flush data to file with err: " + err)
+ return
+ }
+ console.info("Flushed to file successfully.") // Observer will be called.
+ })
+ })
```
7. Delete the specified file.
- Use the **deleteStorage** method to delete the **Storage** singleton of the specified file from the memory, and delete the specified file, its backup file, and damaged files. After the specified files are deleted, the application cannot use that instance to perform any data operation. Otherwise, data inconsistency will occur. The deleted data and files cannot be restored.
+ Use the **deletePreferences** method to delete the **Preferences** singleton of the specified file from the memory, and delete the specified file, its backup file, and corrupted files. After the specified files are deleted, the application cannot use that instance to perform any data operation. Otherwise, data inconsistency will occur. The deleted data and files cannot be restored.
```js
- let promise = dataStorage.deleteStorage(path + '/mystore')
- promise.then(() => {
- console.info("Deleted successfully.")
- }).catch((err) => {
- console.info("Deleted failed with err: " + err)})
+ let proDelete = data_preferences.deletePreferences(context, 'mystore')
+ proDelete.then(() => {
+ console.info("Data deleted successfully.")
+ }).catch((err) => {
+ console.info("Failed to delete data with err: " + err)
+ })
```
diff --git a/en/application-dev/database/database-preference-overview.md b/en/application-dev/database/database-preference-overview.md
index 45639c75e8ad5d1b3f68c79da90fbc598af7e840..b26943b6109818b1ca9d74038f9df4471f69531e 100644
--- a/en/application-dev/database/database-preference-overview.md
+++ b/en/application-dev/database/database-preference-overview.md
@@ -1,31 +1,29 @@
-# Lightweight Data Store Overview
+# Preferences Overview
-Lightweight data store is applicable to access and persistence operations on the data in key-value pairs. When an application accesses a lightweight **Storage** instance, data in the **Storage** instance will be cached in the memory for faster access. The cached data can also be written back to the text file for persistent storage. Since file read and write consume system resources, you are advised to minimize the frequency of reading and writing persistent files.
+Preferences are used for access and persistence operations on the data in the key-value structure. When an application accesses a **Preferences** instance, the data in the instance will be cached in the memory for faster access. The cached data can also be written back to the text file for persistent storage. Since file read and write consume system resources, you are advised to minimize the frequency of reading and writing persistent files.
-## Basic Concepts
+## Basic Concepts
-- **Key-Value data structure**
+- **Key-value data structure**
- A type of data structure. The key is the unique identifier for a piece of data, and the value is the specific data being identified.
+ A type of data structure. The key is the unique identifier for a piece of data, and the value is the specific data being identified.
-- **Non-relational database**
+- **Non-relational database**
- A database not in compliance with the atomicity, consistency, isolation, and durability \(ACID\) database management properties of relational data transactions. The data in a non-relational database is independent.
+ A database not in compliance with the atomicity, consistency, isolation, and durability (ACID) database management properties of relational data transactions. The data in a non-relational database is independent.
+## Working Principles
-## Working Principles
+When an application loads data from a **Preferences** file to a **Preferences** instance, the system stores the instance in the memory through a static container. Each file of an application or process has only one **Preferences** instance in the memory, till the application removes the instance from the memory or deletes the **Preferences** file.
-1. When an application loads data from a specified **Storage** file to a **Storage** instance, the system stores the instance in the memory through a static container. Each file of an application or process has only one **Storage** instance in the memory, till the application removes the instance from the memory or deletes the **Storage** file.
-2. When obtaining a **Storage** instance, the application can read data from or write data to the instance. The data in the **Storage** instance can be flushed to its **Storage** file by calling the **flush** or **flushSync** method.
+When obtaining a **Preferences** instance, the application can read data from or write data to the instance. The data in the instance can be flushed to its **Preferences** file by calling the **flush()** method.
-**Figure 1** How lightweight data store works
+**Figure 1** How **Preferences** work
+
-
-
-## Constraints
-
-- **Storage** instances are loaded to the memory. To minimize non-memory overhead, the number of data records stored in a **Storage** instance cannot exceed 10,000. Delete the instances that are no longer used in a timely manner.
-- The key in the key-value pairs is of the string type. It cannot be empty or exceed 80 characters.
-- If the value in the key-value pairs is of the string type, it can be empty or contain a maximum of 8192 characters.
+## Constraints
+- **Preferences** instances are loaded to the memory. To minimize non-memory overhead, the number of data records stored in a **Preferences** instance cannot exceed 10,000. Delete the instances that are no longer used in a timely manner.
+- The key in key-value pairs is of the string type. It cannot be empty or exceed 80 bytes.
+- The value of the string type in key-value pairs can be empty, but cannot exceed 8192 bytes if not empty.
diff --git a/en/application-dev/database/database-relational-guidelines.md b/en/application-dev/database/database-relational-guidelines.md
index d23f0c0c5735f5fdd91b16f67705af26523ca550..d43b11ff62e73d65de6d77623641b7748a82c824 100644
--- a/en/application-dev/database/database-relational-guidelines.md
+++ b/en/application-dev/database/database-relational-guidelines.md
@@ -116,8 +116,8 @@ The RDB provides **RdbPredicates** for you to set database operation conditions.
A result set can be regarded as a row of data in the queried results. It allows you to traverse and access the data you have queried. The following table describes the external APIs of **ResultSet**.
->  **NOTICE**
-> After a result set is used, you must call the **close()** method to close it explicitly.**
+>  **NOTICE**
+> After a result set is used, you must call the **close()** method to close it explicitly.
**Table 7** APIs for using the result set
@@ -306,3 +306,8 @@ You can obtain the distributed table name for a remote device based on the local
let tableName = rdbStore.obtainDistributedTableName(deviceId, "test");
let resultSet = rdbStore.querySql("SELECT * FROM " + tableName)
```
+## Samples
+The following samples are provided for you to better understand the RDB development:
+- [`Rdb`: eTS RDB (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Rdb)
+- [`DistributedRdb`: eTS Distributed Relational Database (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/DistributedRdb)
+- [Relational Database](https://gitee.com/openharmony/codelabs/tree/master/Data/JSRelationshipData)
diff --git a/en/application-dev/database/figures/en-us_image_0000001199139454.png b/en/application-dev/database/figures/en-us_image_0000001199139454.png
deleted file mode 100644
index ca52bd43d384c5b2d06fe19623b50e0c66ba6295..0000000000000000000000000000000000000000
Binary files a/en/application-dev/database/figures/en-us_image_0000001199139454.png and /dev/null differ
diff --git a/en/application-dev/database/figures/preferences.png b/en/application-dev/database/figures/preferences.png
new file mode 100644
index 0000000000000000000000000000000000000000..ab91e2d4fb3019ca3f48a195041c9b19bdaec830
Binary files /dev/null and b/en/application-dev/database/figures/preferences.png differ
diff --git a/en/application-dev/device/Readme-EN.md b/en/application-dev/device/Readme-EN.md
index f77f56a5cab3c2d3765762fe6790566405e9c119..41f8cf0de280706eff7ae88c051d50d18630f173 100644
--- a/en/application-dev/device/Readme-EN.md
+++ b/en/application-dev/device/Readme-EN.md
@@ -13,3 +13,6 @@
- Vibrator
- [Vibrator Overview](vibrator-overview.md)
- [Vibrator Development](vibrator-guidelines.md)
+- Update Servcie
+ - [Sample Server Overview](sample-server-overview.md)
+ - [Sample Server Development](sample-server-guidelines.md)
diff --git a/en/application-dev/device/sample-server-guidelines.md b/en/application-dev/device/sample-server-guidelines.md
new file mode 100644
index 0000000000000000000000000000000000000000..c957c109caf505ba90686d62e7ca3d1b9ab8f89a
--- /dev/null
+++ b/en/application-dev/device/sample-server-guidelines.md
@@ -0,0 +1,198 @@
+# Sample Server Development
+
+## When to Use
+
+The sample server provides a package search server for checking update packages and obtaining the update package download URLs, which was previously unavailable in the real-world update service. The sample server supports update service testing and secondary development function verification, building an end-to-end environment to cater for diverse update service use cases.
+
+## How to Develop
+
+1. Generate an SSL certificate.
+
+ Generate the **serverKey.pem** and **serverCert.cer** files for SSL communication of the sample server.
+
+ ```
+ openssl req -newkey rsa:2048 -nodes -keyout serverKey.pem -x509 -days 365 -out serverCert.cer -subj "/C=CN/ST=GD/L=GZ/O=abc/OU=defg/CN=hijk/emailAddress=test.com"
+ ```
+
+
+
+2. Modify the **bundle.json** file.
+
+ Add **sub_component** to the **build** field.
+
+ ```
+ "sub_component": [
+ "//base/update/updateservice/server_sample:testserver",
+ ...
+ ],
+ ```
+
+3. Create a code directory.
+
+ Go to the **update_updateservice** directory and run the following commands to create a code directory:
+
+ ```
+ mkdir server_sample // Create the server_sample folder.
+ touch server_sample/BUILD.gn // Create the BUILD.gn file.
+ mkdir server_sample/include // Create the include folder to store the header file of the sample server.
+ touch server_process.h // Create the server_process.h header file.
+ mkdir server_sample/src // Create the src folder to store the C/C++ files of the sample server.
+ touch server_sample/src/server_process.c // Create the server_process.c file.
+ touch server_sample/src/main.cpp // Create the main.cpp file.
+ ```
+
+4. Write the **BUILD.gn** file.
+
+ The **BUILD.gn** file contains two **ohos** components: **ohos_shared_library** file named **libserver_process.z.so** and **ohos_executable** file named **testserver**.
+
+ ```
+ import("//build/ohos.gni")
+
+ ohos_shared_library("server_process") {
+ sources = [
+ "//base/update/updateservice/server_sample/src/server_process.c",
+ ]
+
+ include_dirs = [
+ "//base/update/updateservice/server_sample/include",
+ "//third_party/openssl/include",
+ ]
+
+ deps = [
+ "//base/update/updater/services/log:libupdaterlog",
+ "//third_party/bounds_checking_function:libsec_static",
+ "//third_party/openssl:crypto_source",
+ "//third_party/openssl:ssl_source",
+ "//utils/native/base:utils",
+ ]
+
+ part_name = "update_service"
+ }
+
+ ohos_executable("testserver") {
+ sources = [
+ "//base/update/updateservice/server_sample/src/main.cpp",
+ ]
+
+ include_dirs = [
+ "//base/update/updateservice/server_sample/include",
+ ]
+
+ deps = [
+ "//base/update/updateservice/server_sample:server_process",
+ ]
+
+ part_name = "update_service"
+ }
+ ```
+
+5. Write the **server_process.h** file.
+
+ Declare the sample server APIs in the **server_process.h** file.
+
+ ```c++
+ #ifndef __SERVER_PROCESS_H__
+ #define __SERVER_PROCESS_H__
+
+ /*
+ Init: creates a socket environment and presets certain attributes.
+ */
+ int Init();
+
+ /*
+ SetParam: sets all plug-in parameters.
+ */
+ int SetParam(const char *key, const char *value);
+
+ /*
+ GetParam: obtains all plug-in parameters.
+ */
+ int GetParam(const char *key, char *value);
+
+ /*
+ ReverseSetParamCallback: callback.
+ */
+ int ReverseSetParamCallback(int(*setParam)(const char *key, const char *value));
+
+ /*
+ Open: starts the service.
+ */
+ int Open();
+
+ /*
+ MainLoop: invoked every 100 ms.
+ */
+ int MainLoop();
+
+ /*
+ Close: stops the service and releases related resources.
+ */
+ int Close();
+
+ #endif //__SERVER_PROCESS_H__
+ ```
+
+6. Write the **server_process.c** and **main.cpp** files.
+
+ In the **server_process.c** file, mainly declare **respondContent**, the format of the response message returned by the server. Write the **main.cpp** file based on instructions for the common SSL protocol server. Be sure to include related header files and load the **serverKey.pem** and **serverCert.cer** files.
+
+ ```c
+ #include "server_process.h"
+
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+
+ #include "openssl/err.h"
+ #include "openssl/ssl.h"
+
+ #define SERVER_PEM "/data/sdcard/serverKey.pem" // Use an absolute path.
+ #define SERVER_CER "/data/sdcard/serverCert.cer" // Use an absolute path.
+
+ #define LOG_PRINT(fmt, ...) printf("[ServerProcess][%s:%d] " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
+ #define DO_CHECK(cond, log, ...) \
+ if (!(cond)) {\
+ LOG_PRINT(log);\
+ __VA_ARGS__;\
+ return -1;\
+ }
+
+ // Implement the function by referring to the APIs in the server_process.h file. Pay attention to the format of the response message from the server.
+ respondContent = "{"
+ "\"searchStatus\": 0,"
+ "\"errMsg\": \"success\","
+ "\"checkResults\": [{"
+ "\"versionName\": \"sampleVersionName\","
+ "\"versionCode\": \"sampleVersionCode\","
+ "\"verifyInfo\": \"sampleVerifyInfoSha256Value\","
+ "\"size\": 1234567,"
+ "\"packageType\": 1,"
+ "\"descriptPackageId\": \"abcdefg1234567ABCDEFG\","
+ "}],"
+ "\"descriptInfo\": [{"
+ "\"descriptPackageId\": \"abcdefg1234567ABCDEFG\","
+ "\"content\": \"This package message is used for sampleContent\""
+ "}]"
+ "}";
+ ```
+
+7. Start building.
+
+ The **testserver** and **libserver_process.z.so** files are added to the build output directory.
+
+8. Develop an update package.
+
+ For details, see the [update_packaging_tools repository](https://gitee.com/openharmony/update_packaging_tools).
+
+9. Start the package search server.
+
+ Create a directory that contains only English characters on the development board. Place the **testserver**, **libserver_process.z.so**, **serverCert.cer**, and **serverKey.pem** files in the directory, go to the directory, and run the following command to start the package search server:
+
+ ```
+ ./testserver ./libserver_process.z.so &
+ ```
diff --git a/en/application-dev/device/sample-server-overview.md b/en/application-dev/device/sample-server-overview.md
new file mode 100644
index 0000000000000000000000000000000000000000..6924f8d7f2256dff9ec828cc5fb62248f68599f1
--- /dev/null
+++ b/en/application-dev/device/sample-server-overview.md
@@ -0,0 +1,37 @@
+# Sample Server Overview
+
+The sample server provides a simple server instance for deploying update packages. It can be used as an auxiliary test environment for the UpdateService subsystem.
+
+## Basic Concepts
+
+- Package search service: one of the service capabilities provided by the UpdateService. It depends on the server that supports the TCP and SSL protocols.
+
+- Package search server: a server that provisions the package search service through the TCP connection and the SSL protocol. The sample server mentioned in this document is such a package search server.
+
+- Download server: an HTTP server.
+
+- update.serverip.search: a system parameter that indicates the IP address of the package search server configured on the UpdateService. The default value is **127.0.0.1**.
+
+## Constraints
+
+The following is an example of the JSON response returned by the server. Note that the **verifyInfo** field indicates the SHA-256 value of the update package, and the **size** field indicates the size of the update package, in bytes.
+
+```json
+{
+ "searchStatus": 0,
+ "errMsg": "success",
+ "checkResults": [{
+ "versionName": "versionNameSample",
+ "versionCode": "versionCodeSample",
+ "verifyInfo": "verifyInfoSHA256Value1234567",
+ "size": 1234567,
+ "packageType": 1,
+ "url": "http://serverAddressSample/packageNameSample.fileTypeSample",
+ "descriptPackageId": "abcdefg1234567ABCDEFG"
+ }],
+ "descriptInfo": [{
+ "descriptPackageId": "abcdefg1234567ABCDEFG",
+ "content": "This package is used for update."
+ }]
+}
+```
diff --git a/en/application-dev/device/vibrator-guidelines.md b/en/application-dev/device/vibrator-guidelines.md
index b1d7f7c42bf05cbf616742d63351dd5bc542b50a..f0eb8c5f896ae881550aeae85759692fd052c2ce 100644
--- a/en/application-dev/device/vibrator-guidelines.md
+++ b/en/application-dev/device/vibrator-guidelines.md
@@ -20,38 +20,38 @@ You can set different vibration effects as needed, for example, customizing the
## How to Develop
-1. Declare the permissions required for controlling vibrators on the hardware device in the **config.json** file.
+1. Declare the permissions required for controlling vibrators on the hardware device in the `config.json` file.
```
- "reqPermissions":[
+ "reqPermissions": [
{
- "name":"ohos.permission.ACCELEROMETER",
- "reason"":"",
- "usedScene":{
- "ability""[
- ".MainAbility"
+ "name": "ohos.permission.ACCELEROMETER",
+ "reason": "",
+ "usedScene": {
+ "ability": [
+ ".MainAbility"
],
- "when":"inuse"
+ "when": "inuse"
}
},
{
- "name":"ohos.permission.VIBRATE",
- "reason"":"",
- "usedScene":{
- "ability""[
- ".MainAbility"
+ "name": "ohos.permission.VIBRATE",
+ "reason": "",
+ "usedScene": {
+ "ability": [
+ ".MainAbility"
],
- "when":"inuse"
+ "when": "inuse"
}
},
{
- "name":"ohos.permission.ACTIVITY_MOTION",
- "reason"":"",
- "usedScene":{
- "ability""[
- ".MainAbility"
+ "name": "ohos.permission.ACTIVITY_MOTION",
+ "reason": "",
+ "usedScene": {
+ "ability": [
+ ".MainAbility"
],
- "when":"inuse"
+ "when": "inuse"
}
},
]
@@ -77,7 +77,7 @@ You can set different vibration effects as needed, for example, customizing the
vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then((error)=>{
if(error){ // The call fails, and error.code and error.message are printed.
Console.log("Promise return failed.error.code"+error.code+"error.message"+error.message);
- }else{ // The call is successful, and the device stops vibration.
+ }else{ // The call is successful, and the device stops vibrating.
Console.log("Promise returned to indicate a successful stop.");
};
})
diff --git a/en/application-dev/dfx/hiappevent-guidelines.md b/en/application-dev/dfx/hiappevent-guidelines.md
index 17c599878816756cdf40f2dd3791dde61ed2ea00..b4d267de31436a70061f5f97e4bbd9b739006328 100644
--- a/en/application-dev/dfx/hiappevent-guidelines.md
+++ b/en/application-dev/dfx/hiappevent-guidelines.md
@@ -75,4 +75,4 @@ In this example, an application event is logged after the application startup ex
The following sample is provided to help you better understand how to develop the application event logging feature:
-- [`JsDotTest`: Event Logging Test (JavaScript) (API 7)](https://gitee.com/openharmony/app_samples/tree/master/DFX/JsDotTest)
+- [`JsDotTest`: Event Logging Test (JavaScript) (API 8)](https://gitee.com/openharmony/app_samples/tree/master/DFX/JsDotTest)
diff --git a/en/application-dev/internationalization/i18n-guidelines.md b/en/application-dev/internationalization/i18n-guidelines.md
index 1be7b7dff8fe59b423fa2766b81dc6c164aeec31..4b1d2c4998f74700553127216fe48354d13dce6a 100644
--- a/en/application-dev/internationalization/i18n-guidelines.md
+++ b/en/application-dev/internationalization/i18n-guidelines.md
@@ -9,7 +9,7 @@ APIs are provided to access the system language and region information.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.i18n | getSystemLanguage(): string | Obtains the system language. |
| ohos.i18n | getSystemRegion(): string | Obtains the system region. |
@@ -22,7 +22,7 @@ APIs are provided to access the system language and region information.
### How to Develop
-1. Obtain the system language.
+1. Obtain the system language.
Call the **getSystemLanguage** method to obtain the system language (**i18n** is the name of the imported module).
@@ -30,21 +30,21 @@ APIs are provided to access the system language and region information.
var language = i18n.getSystemLanguage();
```
-2. Obtains the system region.
+2. Obtain the system region.
Call the **getSystemRegion** method to obtain the system region.
```
var region = i18n.getSystemRegion();
```
-3. Obtain the system locale.
+3. Obtain the system locale.
Call the **getSystemLocale** method to obtain the system locale.
```
var locale = i18n.getSystemLocale();
```
-4. Check whether the locale's language is RTL.
+4. Check whether the locale's language is RTL.
Call the **isRTL** method to check whether the locale's language is RTL.
@@ -52,15 +52,15 @@ APIs are provided to access the system language and region information.
var rtl = i18n.isRTL("zh-CN");
```
-5. Check whether the system uses a 24-hour clock.
- Call the **is24HourClock** method to check whether the system uses a 24-hour clock.
+5. Check whether the system uses a 24-hour clock.
+ Call the **is24HourClock** method to check whether the system uses a 24-hour clock.
```
var hourClock = i18n.is24HourClock();
```
-6. Obtain the localized display of a language.
- Call the **getDisplayLanguage** method to obtain the localized display of a language. **language** indicates the language to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
+6. Obtain the localized display of a language.
+ Call the **getDisplayLanguage** method to obtain the localized display of a language. **language** indicates the language to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
```
var language = "en";
@@ -69,8 +69,8 @@ APIs are provided to access the system language and region information.
var localizedLanguage = i18n.getDisplayLanguage(language, locale, sentenceCase);
```
-7. Obtain the localized display of a country.
- Call the **getDisplayCountry** method to obtain the localized display of a country. **country** indicates the country to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
+7. Obtain the localized display of a country.
+ Call the **getDisplayCountry** method to obtain the localized display of a country. **country** indicates the country to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
```
var country = "US";
@@ -105,7 +105,7 @@ APIs are provided to access the system language and region information.
### How to Develop
-1. Instantiate a **Calendar** object.
+1. Instantiate a **Calendar** object.
Call the **getCalendar** method to obtain the time zone object of a specific locale and type (**i18n** is the name of the imported module). **type** indicates the valid calendar type, for example, **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic_civil**, **islamic_tbla**, **islamic_umalqura**, **japanese**, and **persian**. If **type** is left unspecified, the default calendar type of the locale is used.
@@ -113,8 +113,8 @@ APIs are provided to access the system language and region information.
var calendar = i18n.getCalendar("zh-CN", "gregory);
```
-2. Set the time for the **Calendar** object.
- Call the **setTime** method to set the time of the **Calendar** object. This method receives two types of parameters. One is a **Date** object, and the other is a value indicating the number of milliseconds elapsed since January 1, 1970, 00:00:00 GMT.
+2. Set the time for the **Calendar** object.
+ Call the **setTime** method to set the time of the **Calendar** object. This method receives two types of parameters. One is a **Date** object, and the other is a value indicating the number of milliseconds elapsed since January 1, 1970, 00:00:00 GMT.
```
var date1 = new Date();
@@ -123,14 +123,14 @@ APIs are provided to access the system language and region information.
calendar.setTime(date2);
```
-3. Set the year, month, day, hour, minute, and second for the **Calendar** object.
- Call the **set** method to set the year, month, day, hour, minute, and second for the **Calendar** object.
+3. Set the year, month, day, hour, minute, and second for the **Calendar** object.
+ Call the **set** method to set the year, month, day, hour, minute, and second for the **Calendar** object.
```
calendar.set(2021, 12, 21, 6, 0, 0)
```
-4. Set and obtain the time zone for the **Calendar** object.
+4. Set and obtain the time zone for the **Calendar** object.
Call the **setTimeZone** and **getTimeZone** methods to set and obtain the time zone for the **Calendar** object. The **setTimeZone** method requires an input string to indicate the time zone to be set.
@@ -139,7 +139,7 @@ APIs are provided to access the system language and region information.
var timezone = calendar.getTimeZone();
```
-5. Set and obtain the first day of a week for the **Calendar** object.
+5. Set and obtain the first day of a week for the **Calendar** object.
Call the **setFirstDayOfWeek** and **getFirstDayOfWeek** methods to set and obtain the first day of a week for the **Calendar** object. **setFirstDayOfWeek** must be set to a value indicating the first day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.
@@ -148,15 +148,15 @@ APIs are provided to access the system language and region information.
var firstDayOfWeek = calendar.getFirstDayOfWeek();
```
-6. Set and obtain the minimum count of days in the first week for the **Calendar** object.
- Call the **setMinimalDaysInFirstWeek** and **getMinimalDaysInFirstWeek** methods to set and obtain the minimum count of days in the first week for the **Calendar** object.
+6. Set and obtain the minimum count of days in the first week for the **Calendar** object.
+ Call the **setMinimalDaysInFirstWeek** and **getMinimalDaysInFirstWeek** methods to set and obtain the minimum count of days in the first week for the **Calendar** object.
```
calendar.setMinimalDaysInFirstWeek(3);
var minimalDaysInFirstWeek = calendar.getMinimalDaysInFirstWeek();
```
-7. Obtain the localized display of the **Calendar** object.
+7. Obtain the localized display of the **Calendar** object.
Call the **getDisplayName** method to obtain the localized display of the **Calendar** object.
@@ -164,7 +164,7 @@ APIs are provided to access the system language and region information.
var localizedName = calendar.getDisplayName("zh-CN");
```
-8. Check whether a date is a weekend.
+8. Check whether a date is a weekend.
Call the **isWeekend** method to determine whether the input date is a weekend.
@@ -181,7 +181,7 @@ APIs are provided to access the system language and region information.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.i18n | constructor(country: string, options?: PhoneNumberFormatOptions)8+ | Instantiates a **PhoneNumberFormat** object. |
| ohos.i18n | isValidNumber(number: string): boolean8+ | Checks whether the value of **number** is a phone number in the correct format. |
@@ -190,7 +190,7 @@ APIs are provided to access the system language and region information.
### How to Develop
-1. Instantiate a **PhoneNumberFormat** object.
+1. Instantiate a **PhoneNumberFormat** object.
Call the **PhoneNumberFormat** constructor to instantiate a **PhoneNumberFormat** object. The country code and formatting options of the phone number need to be passed into this constructor. The formatting options are optional, including a style option. Values of this option include: **E164**, **INTERNATIONAL**, **NATIONAL**, and **RFC3966**.
@@ -199,14 +199,14 @@ APIs are provided to access the system language and region information.
```
2. Check whether the phone number format is correct.
- Call the **isValidNumber** method to check whether the format of the input phone number is correct.
+ Call the **isValidNumber** method to check whether the format of the input phone number is correct.
```
var validNumber = phoneNumberFormat.isValidNumber("15812341234");
```
3. Format a phone number.
- Call the **format** method of **PhoneNumberFormat** to format the input phone number.
+ Call the **format** method of **PhoneNumberFormat** to format the input phone number.
```
var formattedNumber = phoneNumberFormat.format("15812341234");
@@ -258,7 +258,7 @@ An API can be called to implement measurement conversion.
### How to Develop
-1. Instantiate an **IndexUtil** object.
+1. Instantiate an **IndexUtil** object.
Call the **getInstance** method to instantiate an **IndexUtil** object for a specific locale. When the **locale** parameter is empty, instantiate an **IndexUtil** object of the default locale.
@@ -266,22 +266,22 @@ An API can be called to implement measurement conversion.
var indexUtil = getInstance("zh-CN");
```
-2. Obtain the index list.
- Call the **getIndexList** method to obtain the alphabet index list of the current locale.
+2. Obtain the index list.
+ Call the **getIndexList** method to obtain the alphabet index list of the current locale.
```
var indexList = indexUtil.getIndexList();
```
-3. Add an index.
- Call the **addLocale** method to add the alphabet index of a new locale to the current index list.
+3. Add an index.
+ Call the **addLocale** method to add the alphabet index of a new locale to the current index list.
```
indexUtil.addLocale("ar")
```
-4. Obtain the index of a string.
- Call the **getIndex** method to obtain the alphabet index of a string.
+4. Obtain the index of a string.
+ Call the **getIndex** method to obtain the alphabet index of a string.
```
var text = "access index";
@@ -312,7 +312,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api
### How to Develop
-1. Instantiate a **BreakIterator** object.
+1. Instantiate a **BreakIterator** object.
Call the **getLineInstance** method to instantiate a **BreakIterator** object.
@@ -321,7 +321,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api
var breakIterator = i18n.getLineInstance(locale);
```
-2. Set and access the text that requires line breaking.
+2. Set and access the text that requires line breaking.
Call the **setLineBreakText** and **getLineBreakText** methods to set and access the text that requires line breaking.
@@ -331,7 +331,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api
var breakText = breakIterator.getLineBreakText();
```
-3. Obtain the current position of the **BreakIterator** object.
+3. Obtain the current position of the **BreakIterator** object.
Call the **current** method to obtain the current position of the **BreakIterator** object in the text being processed.
@@ -339,7 +339,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api
var pos = breakIterator.current();
```
-4. Set the position of a **BreakIterator** object.
+4. Set the position of a **BreakIterator** object.
The following APIs are provided to adjust the **first**, **last**, **next**, **previous**, or **following** position of the **BreakIterator** object in the text to be processed.
@@ -355,7 +355,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api
var followingPos = breakIterator.following(10);
```
-5. Determine whether a position is a break point.
+5. Determine whether a position is a break point.
Call the **isBoundary** method to determine whether a position is a break point. If yes, **true** is returned and the **BreakIterator** object is moved to this position. If no, **false** is returned and the **BreakIterator** object is moved to a break point after this position.
diff --git a/en/application-dev/internationalization/intl-guidelines.md b/en/application-dev/internationalization/intl-guidelines.md
index 76c00eb557816681efb54e9e7ec5d0a3754471b6..a27df95ea9c9657c30401b1fd1ad9d9b21d77fca 100644
--- a/en/application-dev/internationalization/intl-guidelines.md
+++ b/en/application-dev/internationalization/intl-guidelines.md
@@ -2,14 +2,17 @@
This development guide describes how to use i18n APIs that are defined in ECMA 402.
+> **NOTE**
+> In the code snippets in this document, **intl** refers to the name of the imported module.
+
## Setting Locale Information
-[Locale](../reference/apis/js-apis-intl.md) APIs are used to maximize or minimize locale information.
+Use [Locale](../reference/apis/js-apis-intl.md) APIs to maximize or minimize locale information.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()8+ | Instantiates a **Locale** object. |
| ohos.intl | constructor(locale?: string, options?: options) | Instantiates a **Locale** object based on the locale parameter and options. |
@@ -20,8 +23,8 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
### How to Develop
-1. Instantiate a **Locale** object.
- Create a **Locale** object using the **Locale** constructor. This method receives a string representing the locale and an optional [Attributes](../reference/apis/js-apis-intl.md) list (**intl** is the name of the imported module).
+1. Instantiate a **Locale** object.
+ Create a **Locale** object by using the **Locale** constructor. This method receives a string representing the locale and an optional [Attributes](../reference/apis/js-apis-intl.md) list.
```
@@ -30,22 +33,22 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
var localeObj = new intl.Locale(locale, options);
```
-2. Obtain the string representing a **Locale** object.
- Call the **toString** method to obtain the string representing a **Locale** object, including the language, region, and other options.
+2. Obtain the string representing a **Locale** object.
+ Call the **toString** method to obtain the string representing a **Locale** object, which includes the language, region, and other options.
```
var localeStr = localeObj.toString();
```
-3. Maximize locale information.
- Call the **maximize** method to maximize locale information; that is, supplement the missing script and region information.
+3. Maximize locale information.
+ Call the **maximize** method to maximize locale information; that is, supplement the missing script and region information.
```
var maximizedLocale = localeObj.maximize();
```
-4. Minimize locale information.
- Call the **minimize** method to minimize locale information; that is, delete the unnecessary script and region information.
+4. Minimize locale information.
+ Call the **minimize** method to minimize locale information; that is, delete the unnecessary script and region information.
```
var minimizedLocale = localeObj.minimize();
@@ -54,12 +57,12 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
## Formatting the Date and Time
-[DateTimeFormat](../reference/apis/js-apis-intl.md) APIs are used to format the date and time for a specific locale.
+Use [DateTimeFormat](../reference/apis/js-apis-intl.md) APIs to format the date and time for a specific locale.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()8+ | Creates a **DateTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array<string>, options?: DateTimeOptions) | Creates a **DateTimeFormat** object and sets the locale and other formatting-related attributes. |
@@ -70,31 +73,31 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
### How to Develop
-1. Instantiate a **DateTimeFormat** object.
- Use the default constructor of **DateTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **DateTimeFormat** object (**intl** is the name of the imported module).
+1. Instantiate a **DateTimeFormat** object.
+ Use the default constructor of **DateTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **DateTimeFormat** object.
```
var dateTimeFormat = new intl.DateTimeFormat();
```
- Alternatively, use your own locale and formatting parameters to create a **DateTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [DateTimeOptions](../reference/apis/js-apis-intl.md).
+ Alternatively, use your own locale and formatting parameters to create a **DateTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [DateTimeOptions](../reference/apis/js-apis-intl.md).
```
var options = {dateStyle: "full", timeStyle: "full"};
var dateTimeFormat = new intl.DateTimeFormat("zh-CN", options);
```
-2. Format the date and time.
- Use the **format** method of **DateTimeFormat** to format a **Date** object. A string is returned as the formatting result.
+2. Format the date and time.
+ Call the **format** method to format a **Date** object. This method returns a string representing the formatting result.
```
Date date = new Date();
var formatResult = dateTimeFormat.format(date);
```
-3. Format a period.
- Use the **formatRange** method of **DateTimeFormat** to format a period. This method requires the input of two **Date** objects, which respectively indicate the start date and end date of a period. A string is returned as the formatting result.
+3. Format a period.
+ Call the **formatRange** method to format a period. This method requires input of two **Date** objects, which respectively indicate the start date and end date of a period. This method returns a string representing the formatting result.
```
Date startDate = new Date();
@@ -102,8 +105,8 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
var formatResult = dateTimeFormat.formatRange(startDate, endDate);
```
-4. Access the attributes of the **DateTimeFormat** object.
- The **resolvedOptions** method of **DateTimeFormat** returns an object that contains all related attributes and values of the **DateTimeFormat** object.
+4. Obtain attributes of the **DateTimeFormat** object.
+ Call the **resolvedOptions** method to obtain attributes of the **DateTimeFormat** object. This method will return an array that contains all attributes and values of the object.
```
var options = dateTimeFormat.resolvedOptions();
@@ -112,46 +115,46 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
## Number Formatting
-[NumberFormat](../reference/apis/js-apis-intl.md) APIs are used to format a number for a specific locale.
+Use [NumberFormat](../reference/apis/js-apis-intl.md) APIs to format a number for a specific locale.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()8+ | Creates a **NumberFormat** object. |
| ohos.intl | constructor(locale: string \| Array<string>, options?: NumberOptions) | Creates a **NumberFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(number: number): string | Calculates the number based on the locale and other formatting-related attributes of the **NumberFormat** object. |
-| ohos.intl | resolvedOptions(): NumberOptions | Obtains the attributes of the **NumberFormat** object. |
+| ohos.intl | resolvedOptions(): NumberOptions | Obtains attributes of the **NumberFormat** object. |
### How to Develop
-1. Instantiate a **NumberFormat** object.
- Use the default constructor of **NumberFormat** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **NumberFormat** object (**intl** is the name of the imported module).
+1. Instantiate a **NumberFormat** object.
+ Use the default constructor of **NumberFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **NumberFormat** object.
```
var numberFormat = new intl.NumberFormat();
```
- Alternatively, use your own locale and formatting parameters to create a **NumberFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [NumberOptions](../reference/apis/js-apis-intl.md).
+ Alternatively, use your own locale and formatting parameters to create a **NumberFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [NumberOptions](../reference/apis/js-apis-intl.md).
```
var options = {compactDisplay: "short", notation: "compact"};
var numberFormat = new intl.NumberFormat("zh-CN", options);
```
-2. Format a number.
- Use the **format** method of **NumberFormat** to format a number. A string is returned as the formatting result.
+2. Format a number.
+ Call the **format** method to format a number. A string is returned as the formatting result.
```
var number = 1234.5678
var formatResult = numberFormat.format(number);
```
-3. Access the attributes of the **NumberFormat** object.
- The **resolvedOptions** method of NumberFormat returns an object that contains all related attributes and values of the **NumberFormat** object.
+3. Obtain attributes of the **NumberFormat** object.
+ Call the **resolvedOptions** method to obtain attributes of the **NumberFormat** object. This method will return an array that contains all attributes and values of the object.
```
var options = numberFormat.resolvedOptions();
@@ -160,37 +163,37 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
## String Sorting
-Users in different regions have different requirements for string sorting. [Collator](../reference/apis/js-apis-intl.md) APIs are used to sort strings based on a specific locale.
+Use [Collator](../reference/apis/js-apis-intl.md) APIs to sort strings based on a specific locale. Users in different regions have different preferences for string sorting.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()8+ | Creates a **Collator** object. |
| ohos.intl | constructor(locale: string \| Array<string>, options?: CollatorOptions)8+ | Creates a **Collator** object and sets the locale and other related attributes. |
| ohos.intl | compare(first: string, second: string): number8+ | Calculates the comparison result of two strings based on the locale and other attributes of the **Collator** object. |
-| ohos.intl | resolvedOptions(): CollatorOptions8+ | Obtains the attributes of the **Collator** object. |
+| ohos.intl | resolvedOptions(): CollatorOptions8+ | Obtains attributes of the **Collator** object. |
### How to Develop
-1. Instantiate a **Collator** object.
- Use the default constructor of **Collator** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **Collator** object (**intl** is the name of the imported module).
+1. Instantiate a **Collator** object.
+ Use the default constructor of **Collator** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **Collator** object.
```
var collator = new intl.Collator();
```
- Alternatively, use your own locale and formatting parameters to create a **Collator** object. For a full list of parameters, see [CollatorOptions](../reference/apis/js-apis-intl.md).
+ Alternatively, use your own locale and formatting parameters to create a **Collator** object. For a full list of parameters, see [CollatorOptions](../reference/apis/js-apis-intl.md).
```
var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"};
```
-2. Compare two strings.
- Use the **compare** method of **Collator** to compare two input strings. This method returns a value as the comparison result. The return value **-1** indicates that the first string is shorter than the second string, the return value **1** indicates that the first string is longer than the second string, and the return value **0** indicates that the two strings are of equal lengths.
+2. Compare two strings.
+ Call the **compare** method to compare two input strings. This method returns a value as the comparison result. The return value **-1** indicates that the first string is shorter than the second string, the return value **1** indicates that the first string is longer than the second string, and the return value **0** indicates that the two strings are of equal lengths.
```
var str1 = "first string";
@@ -198,8 +201,8 @@ Users in different regions have different requirements for string sorting. [Coll
var compareResult = collator.compare(str1, str2);
```
-3. Access the attributes of the **Collator** object.
- The **resolvedOptions** method of **Collator** returns an object that contains all related attributes and values of the **Collator** object.
+3. Obtain attributes of the **Collator** object.
+ Call the **resolvedOptions** method to obtain attributes of the **Collator** object. This method will return an array that contains all attributes and values of the object.
```
var options = collator.resolvedOptions();
@@ -208,12 +211,12 @@ Users in different regions have different requirements for string sorting. [Coll
## Determining the Singular-Plural Type
-According to grammars in certain languages, the singular or plural form of a noun depends on the number prior to the noun. [PluralRules](../reference/apis/js-apis-intl.md) APIs are used to determine the singular-plural type for a specific locale.
+Use [PluralRules](../reference/apis/js-apis-intl.md) APIs to determine the singular-plural type for a specific locale. According to the grammar of certain languages, the singular or plural form of a noun depends on its preceding number.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()8+ | Creates a **PluralRules** object. |
| ohos.intl | constructor(locale: string \| Array<string>, options?: PluralRulesOptions)8+ | Creates a **PluralRules** object and sets the locale and other related attributes. |
@@ -222,22 +225,22 @@ According to grammars in certain languages, the singular or plural form of a nou
### How to Develop
-1. Instantiate a **PluralRules** object.
- Use the default constructor of **PluralRules** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **PluralRules** object (**intl** is the name of the imported module).
+1. Instantiate a **PluralRules** object.
+ Use the default constructor of **PluralRules** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **PluralRules** object.
```
var pluralRules = new intl.PluralRules();
```
- Alternatively, use your own locale and formatting parameters to create a **PluralRules** object. For a full list of parameters, see [PluralRulesOptions](../reference/apis/js-apis-intl.md).
+ Alternatively, use your own locale and formatting parameters to create a **PluralRules** object. For a full list of parameters, see [PluralRulesOptions](../reference/apis/js-apis-intl.md).
```
var plurals = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"};
```
-2. Determine the singular or plural category.
- Use the **select** method of **PluralRules** to determine the singular-plural type for an input number. This method returns a string as the category of the input number, which can be any of the following: **zero**, **one**, **two**, **few**, **many**, and **other**.
+2. Determine the singular-plural type.
+ Call the **select** method to determine the singular-plural type of an input number. This method will return a string representing the singular-plural type, which can be any of the following: **zero**, **one**, **two**, **few**, **many**, and **other**.
```
var number = 1234.5678
@@ -247,38 +250,38 @@ According to grammars in certain languages, the singular or plural form of a nou
## Formatting Relative Time
-[RelativeTimeFormat](../reference/apis/js-apis-intl.md) APIs are used to format the relative time for a specific locale.
+Use [RelativeTimeFormat](../reference/apis/js-apis-intl.md) APIs to format the relative time for a specific locale.
### Available APIs
- | Module | API | Description |
+| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()8+ | Creates a **RelativeTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array<string>, options?: RelativeTimeFormatInputOptions)8+ | Creates a **RelativeTimeFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(value: number, unit: string): string8+ | Calculates the relative time format based on the locale and other formatting-related attributes of the **RelativeTimeFormat** object. |
| ohos.intl | formatToParts(value: number, unit: string): Array<object>8+ | Returns each part of the relative time format based on the locale and other formatting-related attributes of the **RelativeTimeFormat** object. |
-| ohos.intl | resolvedOptions(): RelativeTimeFormatResolvedOptions8+ | Obtains the attributes of the **RelativeTimeFormat** object. |
+| ohos.intl | resolvedOptions(): RelativeTimeFormatResolvedOptions8+ | Obtains attributes of the **RelativeTimeFormat** object. |
### How to Develop
-1. Instantiate a **RelativeTimeFormat** object.
- Use the default constructor of **RelativeTimeFormat** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **RelativeTimeFormat** object (**intl** is the name of the imported module).
+1. Instantiate a **RelativeTimeFormat** object.
+ Use the default constructor of **RelativeTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **RelativeTimeFormat** object.
```
var relativeTimeFormat = new intl.RelativeTimeFormat();
```
- Alternatively, use your own locale and formatting parameters to create a **RelativeTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [ RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md).
+ Alternatively, use your own locale and formatting parameters to create a **RelativeTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [ RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md).
```
var relativeTimeFormat = new intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"};
```
-2. Format the relative time.
- Use the **format** method of **RelativeTimeFormat** to format the relative time. This method receives a numeric value representing the time length and a string-form unit, like **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, and **second**. A string is returned as the formatting result.
+2. Format the relative time.
+ Call the **format** method to format the relative time. This method receives a numeric value representing the time length and a string-form unit, like **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, and **second**. This method returns a string representing the formatting result.
```
var number = 2;
@@ -286,8 +289,8 @@ According to grammars in certain languages, the singular or plural form of a nou
var formatResult = relativeTimeFormat.format(number, unit);
```
-3. Obtain each part of the relative time format.
- On obtaining each part of the relative time format, customize the relative time formatting result.
+3. Obtain each part of the relative time format.
+ Upon obtaining each part of the relative time format, customize the relative time formatting result.
```
var number = 2;
@@ -295,8 +298,8 @@ According to grammars in certain languages, the singular or plural form of a nou
var formatResult = relativeTimeFormat.formatToParts(number, unit);
```
-4. Access the attributes of the **RelativeTimeFormat** object.
- The **resolvedOptions** method of **RelativeTimeFormat** returns an object that contains all related attributes and values of the **RelativeTimeFormat** object. For a full list of attributes, see [ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md).
+4. Obtain attributes of the **RelativeTimeFormat** object.
+ Call the **resolvedOptions** method to obtain attributes of the **RelativeTimeFormat** object. This method will return an array that contains all attributes and values of the object. For a full list of attributes, see [ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md).
```
var options = numberFormat.resolvedOptions();
@@ -306,4 +309,4 @@ According to grammars in certain languages, the singular or plural form of a nou
The following sample is provided to help you better understand how to develop internationalization capabilities:
--[`International`: Internationalization (JS) (API7)](https://gitee.com/openharmony/app_samples/tree/master/UI/International)
+-[`International`: Internationalization (JS) (API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/International)
diff --git a/en/application-dev/media/Readme-EN.md b/en/application-dev/media/Readme-EN.md
index 926bb335311ed38323d8a481aa39c0b2047902c9..f4c117684b891c43b1dd94513420f6793f52d886 100755
--- a/en/application-dev/media/Readme-EN.md
+++ b/en/application-dev/media/Readme-EN.md
@@ -4,11 +4,10 @@
- [Audio Overview](audio-overview.md)
- [Audio Playback Development](audio-playback.md)
-
- [Audio Recording Development](audio-recorder.md)
- [Audio Rendering Development](audio-renderer.md)
-
- - [Audio Capture Development](audio-capturer)
+ - [Audio Capture Development](audio-capturer.md)
+ - [OpenSL ES Audio Playback Development](opensles-playback.md)
- Video
- [Video Playback Development](video-playback.md)
diff --git a/en/application-dev/media/audio-playback.md b/en/application-dev/media/audio-playback.md
index 085506f3c514624f8fd8a2a8526b149a8e0927a8..c8dabdf0bea89476f3ff9d81392d2d0d1ee4dc28 100644
--- a/en/application-dev/media/audio-playback.md
+++ b/en/application-dev/media/audio-playback.md
@@ -39,36 +39,36 @@ function printfDescription(obj) {
// Set the player callbacks.
function setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the dataLoad event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
- audioPlayer.play(); // The play() API can be invoked only after the 'dataLoad' event callback is complete. The 'play' event callback is then triggered.
+ audioPlayer.play(); // The play() API can be invoked only after the dataLoad event callback is complete. The play event callback is then triggered.
});
- audioPlayer.on('play', () => { // Set the 'play' event callback.
+ audioPlayer.on('play', () => { // Set the play event callback.
console.info('audio play success');
- audioPlayer.pause(); // Trigger the 'pause' event callback and pause the playback.
+ audioPlayer.pause(); // Trigger the pause event callback and pause the playback.
});
- audioPlayer.on('pause', () => { // Set the 'pause' event callback.
+ audioPlayer.on('pause', () => { // Set the pause event callback.
console.info('audio pause success');
- audioPlayer.seek(5000); // Trigger the 'timeUpdate' event callback, and seek to 5000 ms for playback.
+ audioPlayer.seek(5000); // Trigger the timeUpdate event callback, and seek to 5000 ms for playback.
});
- audioPlayer.on('stop', () => { // Set the 'stop' event callback.
+ audioPlayer.on('stop', () => { // Set the stop event callback.
console.info('audio stop success');
- audioPlayer.reset(); // Trigger the 'reset' event callback, and reconfigure the src attribute to switch to the next song.
+ audioPlayer.reset(); // Trigger the reset event callback, and reconfigure the src attribute to switch to the next song.
});
- audioPlayer.on('reset', () => { // Set the 'reset' event callback.
+ audioPlayer.on('reset', () => { // Set the reset event callback.
console.info('audio reset success');
audioPlayer.release(); // Release the AudioPlayer resources.
audioPlayer = undefined;
});
- audioPlayer.on('timeUpdate', (seekDoneTime) => {// Set the 'timeUpdate' event callback.
+ audioPlayer.on('timeUpdate', (seekDoneTime) => {// Set the timeUpdate event callback.
if (typeof(seekDoneTime) == 'undefined') {
console.info('audio seek fail');
return;
}
console.info('audio seek success, and seek time is ' + seekDoneTime);
- audioPlayer.setVolume(0.5); // Trigger the 'volumeChange' event callback.
+ audioPlayer.setVolume(0.5); // Trigger the volumeChange event callback.
});
- audioPlayer.on('volumeChange', () => { // Set the 'volumeChange' event callback.
+ audioPlayer.on('volumeChange', () => { // Set the volumeChange event callback.
console.info('audio volumeChange success');
audioPlayer.getTrackDescription((error, arrlist) => { // Obtain the audio track information in callback mode.
if (typeof (arrlist) != 'undefined') {
@@ -78,13 +78,13 @@ function setCallBack(audioPlayer) {
} else {
console.log(`audio getTrackDescription fail, error:${error.message}`);
}
- audioPlayer.stop(); // Trigger the 'stop' event callback to stop the playback.
+ audioPlayer.stop(); // Trigger the stop event callback to stop the playback.
});
});
- audioPlayer.on('finish', () => { // Set the 'finish' event callback, which is triggered when the playback is complete.
+ audioPlayer.on('finish', () => { // Set the finish event callback, which is triggered when the playback is complete.
console.info('audio play finish');
});
- audioPlayer.on('error', (error) => { // Set the 'error' event callback.
+ audioPlayer.on('error', (error) => { // Set the error event callback.
console.info(`audio error called, errName is ${error.name}`);
console.info(`audio error called, errCode is ${error.code}`);
console.info(`audio error called, errMessage is ${error.message}`);
@@ -92,22 +92,22 @@ function setCallBack(audioPlayer) {
}
async function audioPlayerDemo() {
- // 1. Create an audioPlayer instance.
+ // 1. Create an AudioPlayer instance.
let audioPlayer = media.createAudioPlayer();
setCallBack(audioPlayer); // Set the event callbacks.
- // 2. Set the URI of the audio file selected by the user.
+ // 2. Set the URI of the audio file.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = fdPath; // Set the src attribute and trigger the dataLoad event callback.
}
```
@@ -119,14 +119,14 @@ import fileIO from '@ohos.fileio'
export class AudioDemo {
// Set the player callbacks.
setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the dataLoad event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
- audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
+ audioPlayer.play(); // Call the play() API to start the playback and trigger the play event callback.
});
- audioPlayer.on('play', () => { // Set the 'play' event callback.
+ audioPlayer.on('play', () => { // Set the play event callback.
console.info('audio play success');
});
- audioPlayer.on('finish', () => { // Set the 'finish' event callback, which is triggered when the playback is complete.
+ audioPlayer.on('finish', () => { // Set the finish event callback, which is triggered when the playback is complete.
console.info('audio play finish');
audioPlayer.release(); // Release the AudioPlayer resources.
audioPlayer = undefined;
@@ -141,13 +141,13 @@ export class AudioDemo {
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = fdPath; // Set the src attribute and trigger the dataLoad event callback.
}
}
```
@@ -161,15 +161,15 @@ export class AudioDemo {
// Set the player callbacks.
private isNextMusic = false;
setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the dataLoad event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
- audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
+ audioPlayer.play(); // Call the play() API to start the playback and trigger the play event callback.
});
- audioPlayer.on('play', () => { // Set the 'play' event callback.
+ audioPlayer.on('play', () => { // Set the play event callback.
console.info('audio play success');
- audioPlayer.reset(); // Call the reset() API and trigger the 'reset' event callback.
+ audioPlayer.reset(); // Call the reset() API and trigger the reset event callback.
});
- audioPlayer.on('reset', () => { // Set the 'reset' event callback.
+ audioPlayer.on('reset', () => { // Set the reset event callback.
console.info('audio play success');
if (!this.isNextMusic) { // When isNextMusic is false, changing songs is implemented.
this.nextMusic(audioPlayer); // Changing songs is implemented.
@@ -187,13 +187,13 @@ export class AudioDemo {
let nextpath = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/02.mp3';
await fileIO.open(nextpath).then((fdNumber) => {
nextFdPath = nextFdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + nextFdPath);
+ console.info('open fd success fd is' + nextFdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = nextFdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = nextFdPath; // Set the src attribute and trigger the dataLoad event callback.
}
async audioPlayerDemo() {
@@ -204,13 +204,13 @@ export class AudioDemo {
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = fdPath; // Set the src attribute and trigger the dataLoad event callback.
}
}
```
@@ -223,12 +223,12 @@ import fileIO from '@ohos.fileio'
export class AudioDemo {
// Set the player callbacks.
setCallBack(audioPlayer) {
- audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callback, which is triggered when the src attribute is set successfully.
+ audioPlayer.on('dataLoad', () => { // Set the dataLoad event callback, which is triggered when the src attribute is set successfully.
console.info('audio set source success');
audioPlayer.loop = true; // Set the loop playback attribute.
- audioPlayer.play(); // Call the play() API to start the playback and trigger the 'play' event callback.
+ audioPlayer.play(); // Call the play() API to start the playback and trigger the play event callback.
});
- audioPlayer.on('play', () => { // Sets the 'play' event callback to start loop playback.
+ audioPlayer.on('play', () => { // Sets the play event callback to start loop playback.
console.info('audio play success');
});
}
@@ -241,13 +241,13 @@ export class AudioDemo {
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
console.info('open fd failed err is' + err);
});
- audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' event callback.
+ audioPlayer.src = fdPath; // Set the src attribute and trigger the dataLoad event callback.
}
}
```
@@ -256,7 +256,7 @@ export class AudioDemo {
The following samples are provided to help you better understand how to develop audio playback:
-- [`JsDistributedMusicPlayer`: Distributed Music Player (JS) (API7)](https://gitee.com/openharmony/app_samples/tree/master/ability/JsDistributedMusicPlayer)
-- [`JsAudioPlayer`: Audio Playback and Management (JS, API 7)](https://gitee.com/openharmony/app_samples/tree/master/media/JsAudioPlayer)
-- [`eTsAudioPlayer`: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets)
+- [JsDistributedMusicPlayer: Distributed Music Player (JS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/ability/JsDistributedMusicPlayer)
+- [JsAudioPlayer: Audio Playback and Management (JS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/media/JsAudioPlayer)
+- [eTsAudioPlayer: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets)
- [Audio Player](https://gitee.com/openharmony/codelabs/tree/master/Media/Audio_OH_ETS)
diff --git a/en/application-dev/media/audio-recorder.md b/en/application-dev/media/audio-recorder.md
index cd8d8ee0d976d6a2ee56cdb0e7ad93d2d46ac05d..d24ee72f4a322e44734a0eb7a70ca04d11dc8994 100644
--- a/en/application-dev/media/audio-recorder.md
+++ b/en/application-dev/media/audio-recorder.md
@@ -30,35 +30,35 @@ export class AudioRecorderDemo {
// Set the callbacks related to audio recording.
setCallBack(audioRecorder) {
- audioRecorder.on('prepare', () => { // Set the 'prepare' event callback.
+ audioRecorder.on('prepare', () => { // Set the prepare event callback.
console.log('prepare success');
- audioRecorder.start(); // Call the start API to start recording and trigger the 'start' event callback.
+ audioRecorder.start(); // Call the start API to start recording and trigger the start event callback.
});
- audioRecorder.on('start', () => { // Set the 'start' event callback.
+ audioRecorder.on('start', () => { // Set the start event callback.
console.log('audio recorder start success');
- audioRecorder.pause(); // Call the pause API to pause recording and trigger the 'pause' event callback.
+ audioRecorder.pause(); // Call the pause API to pause recording and trigger the pause event callback.
});
- audioRecorder.on('pause', () => { // Set the 'pause' event callback.
+ audioRecorder.on('pause', () => { // Set the pause event callback.
console.log('audio recorder pause success');
- audioRecorder.resume(); // Call the resume API to resume recording and trigger the 'resume' event callback.
+ audioRecorder.resume(); // Call the resume API to resume recording and trigger the resume event callback.
});
- audioRecorder.on('resume', () => { // Set the 'resume' event callback.
+ audioRecorder.on('resume', () => { // Set the resume event callback.
console.log('audio recorder resume success');
- audioRecorder.stop(); // Call the stop API to stop recording and trigger the 'stop' event callback.
+ audioRecorder.stop(); // Call the stop API to stop recording and trigger the stop event callback.
});
- audioRecorder.on('stop', () => { // Set the 'stop' event callback.
+ audioRecorder.on('stop', () => { // Set the stop event callback.
console.log('audio recorder stop success');
- audioRecorder.reset(); // Call the reset API to reset the recorder and trigger the 'reset' event callback.
+ audioRecorder.reset(); // Call the reset API to reset the recorder and trigger the reset event callback.
});
- audioRecorder.on('reset', () => { // Set the 'reset' event callback.
+ audioRecorder.on('reset', () => { // Set the reset event callback.
console.log('audio recorder reset success');
- audioRecorder.release(); // Call the release API to release resources and trigger the 'release' event callback.
+ audioRecorder.release(); // Call the release API to release resources and trigger the release event callback.
});
- audioRecorder.on('release', () => { // Set the 'release' event callback.
+ audioRecorder.on('release', () => { // Set the release event callback.
console.log('audio recorder release success');
audioRecorder = undefined;
});
- audioRecorder.on('error', (error) => { // Set the 'error' event callback.
+ audioRecorder.on('error', (error) => { // Set the error event callback.
console.info(`audio error called, errName is ${error.name}`);
console.info(`audio error called, errCode is ${error.code}`);
console.info(`audio error called, errMessage is ${error.message}`);
@@ -103,7 +103,7 @@ export class AudioRecorderDemo {
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4A,
}
- audioRecorder.prepare(audioRecorderConfig); // Call the prepare method to trigger the 'prepare' event callback.
+ audioRecorder.prepare(audioRecorderConfig); // Call the prepare method to trigger the prepare event callback.
}
}
```
@@ -120,23 +120,23 @@ export class AudioRecorderDemo {
// Set the callbacks related to audio recording.
setCallBack(audioRecorder) {
- audioRecorder.on('prepare', () => { // Set the 'prepare' event callback.
+ audioRecorder.on('prepare', () => { // Set the prepare event callback.
console.log('prepare success');
- audioRecorder.start(); // Call the start API to start recording and trigger the 'start' event callback.
+ audioRecorder.start(); // Call the start API to start recording and trigger the start event callback.
});
- audioRecorder.on('start', () => { // Set the 'start' event callback.
+ audioRecorder.on('start', () => { // Set the start event callback.
console.log('audio recorder start success');
- audioRecorder.stop(); // Call the stop API to stop recording and trigger the 'stop' event callback.
+ audioRecorder.stop(); // Call the stop API to stop recording and trigger the stop event callback.
});
- audioRecorder.on('stop', () => { // Set the 'stop' event callback.
+ audioRecorder.on('stop', () => { // Set the stop event callback.
console.log('audio recorder stop success');
- audioRecorder.release(); // Call the release API to release resources and trigger the 'release' event callback.
+ audioRecorder.release(); // Call the release API to release resources and trigger the release event callback.
});
- audioRecorder.on('release', () => { // Set the 'release' event callback.
+ audioRecorder.on('release', () => { // Set the release event callback.
console.log('audio recorder release success');
audioRecorder = undefined;
});
- audioRecorder.on('error', (error) => { // Set the 'error' event callback.
+ audioRecorder.on('error', (error) => { // Set the error event callback.
console.info(`audio error called, errName is ${error.name}`);
console.info(`audio error called, errCode is ${error.code}`);
console.info(`audio error called, errMessage is ${error.message}`);
@@ -181,7 +181,7 @@ export class AudioRecorderDemo {
audioEncoderMime : media.CodecMimeType.AUDIO_AAC,
fileFormat : media.ContainerFormatType.CFT_MPEG_4A,
}
- audioRecorder.prepare(audioRecorderConfig); // Call the prepare method to trigger the 'prepare' event callback.
+ audioRecorder.prepare(audioRecorderConfig); // Call the prepare method to trigger the prepare event callback.
}
}
```
@@ -190,6 +190,7 @@ export class AudioRecorderDemo {
The following samples are provided to help you better understand how to develop audio recording:
-- [`Recorder`: Recorder (eTS, API 8)](https://gitee.com/openharmony/app_samples/tree/master/media/Recorder)
-- [`eTsAudioPlayer`: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets)
+- [Recorder: Recorder (eTS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/media/Recorder)
+- [JsRecorder: Recorder (JS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/media/JSRecorder)
+- [eTsAudioPlayer: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets)
- [Audio Player](https://gitee.com/openharmony/codelabs/tree/master/Media/Audio_OH_ETS)
diff --git a/en/application-dev/media/opensles-playback.md b/en/application-dev/media/opensles-playback.md
new file mode 100644
index 0000000000000000000000000000000000000000..b8568a6946d7c4f0d1647f23c9d52909e1cbd8df
--- /dev/null
+++ b/en/application-dev/media/opensles-playback.md
@@ -0,0 +1,122 @@
+# OpenSL ES Audio Playback Development
+
+
+
+## When to Use
+
+You can use OpenSL ES to develop the audio playback function in OpenHarmony. Currently, only some [OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
+
+
+
+## How to Develop
+
+To use OpenSL ES to develop the audio playback function in OpenHarmony, perform the following steps:
+
+1. Add the header files.
+
+ ```c++
+ #include
+ #include
+ #include
+ ```
+
+
+
+2. Use the **slCreateEngine** API to obtain an **engine** instance.
+
+ ```c++
+ SLObjectItf engineObject = nullptr;
+ slCreateEngine(&engineObject, 0, nullptr, 0, nullptr, nullptr);
+ (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE);
+ ```
+
+
+
+3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface.
+
+ ```c++
+ SLEngineItf engineEngine = nullptr;
+ (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine);
+ ```
+
+
+
+4. Configure the player and create an **AudioPlayer** instance.
+
+ ```c++
+ SLDataLocator_BufferQueue slBufferQueue = {
+ SL_DATALOCATOR_BUFFERQUEUE,
+ 0
+ };
+
+ // Configure the parameters based on the audio file format.
+ SLDataFormat_PCM pcmFormat = {
+ SL_DATAFORMAT_PCM,
+ 2,
+ 48000,
+ 16,
+ 0,
+ 0,
+ 0
+ };
+ SLDataSource slSource = {&slBufferQueue, &pcmFormat};
+
+ SLObjectItf pcmPlayerObject = nullptr;
+ (*engineEngine)->CreateAudioPlayer(engineEngine, &pcmPlayerObject, &slSource, null, 0, nullptr, nullptr);
+ (*pcmPlayerObject)->Realize(pcmPlayerObject, SL_BOOLEAN_FALSE);
+ ```
+
+
+
+5. Obtain the **bufferQueueItf** instance of the **SL_IID_OH_BUFFERQUEUE** interface.
+
+ ```
+ SLOHBufferQueueItf bufferQueueItf;
+ (*pcmPlayerObject)->GetInterface(pcmPlayerObject, SL_IID_OH_BUFFERQUEUE, &bufferQueueItf);
+ ```
+
+
+
+6. Open an audio file and register the **BufferQueueCallback** function.
+
+ ```c++
+ FILE *wavFile_ = nullptr;
+
+ static void BuqqerQueueCallback (SLOHBufferQueueItf bufferQueueItf, void *pContext, SLuint32 size)
+ {
+ FILE *wavFile = (FILE *)pContext;
+ if (!feof(wavFile)) {
+ SLuint8 *buffer = nullptr;
+ SLuint32 pSize = 0;
+ (*bufferQueueItf)->GetBuffer(bufferQueueItf, &buffer, pSize);
+ // Read data from the file.
+ fread(buffer, 1, size, wavFile);
+ (*bufferQueueItf)->Enqueue(bufferQueueItf, buffer, size);
+ }
+ return;
+ }
+
+ // Set wavFile_ to the descriptor of the file to be played.
+ wavFile_ = fopen(path, "rb");
+ (*bufferQueueItf)->RegisterCallback(bufferQueueItf, BuqqerQueueCallback, wavFile_);
+ ```
+
+
+
+7. Obtain the **playItf** instance of the **SL_PLAYSTATE_PLAYING** interface and start playback.
+
+ ```c++
+ SLPlayItf playItf = nullptr;
+ (*pcmPlayerObject)->GetInterface(pcmPlayerObject, SL_IID_PLAY, &playItf);
+ (*playItf)->SetPlayState(playItf, SL_PLAYSTATE_PLAYING);
+ ```
+
+
+
+8. Stop audio playback.
+
+ ```c++
+ (*playItf)->SetPlayState(playItf, SL_PLAYSTATE_STOPPED);
+ (*pcmPlayerObject)->Destroy(pcmPlayerObject);
+ (*engineObject)->Destroy(engineObject);
+ ```
diff --git a/en/application-dev/media/video-playback.md b/en/application-dev/media/video-playback.md
index 49f0f084420b7302806ea46833636815ab12ade0..4317e0362769936b16844f22d592e5163dfbcdff 100644
--- a/en/application-dev/media/video-playback.md
+++ b/en/application-dev/media/video-playback.md
@@ -76,13 +76,13 @@ export class VideoPlayerDemo {
async videoPlayerDemo() {
let videoPlayer = undefined;
- let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent interface. For details about the document link, see the method of creating the XComponent.
+ let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent API. For details about the document link, see the method of creating the XComponent.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\H264_AAC.mp4 /data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/H264_AAC.mp4';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
@@ -97,7 +97,7 @@ export class VideoPlayerDemo {
console.info('createVideoPlayer fail!');
}
}, this.failureCallback).catch(this.catchCallback);
- // Set the playback source URL for the player.
+ // Set the playback source for the player.
videoPlayer.url = fdPath;
// Set the surface ID to display the video image.
@@ -134,19 +134,19 @@ export class VideoPlayerDemo {
this.printfDescription(arrayDescription[i]);
}
- // Seek to the 50s position. For details about the input parameters, see the interface document.
+ // Seek to the 50s position. For details about the input parameters, see the API document.
let seekTime = 50000;
await videoPlayer.seek(seekTime, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
console.info('seek success');
}, this.failureCallback).catch(this.catchCallback);
- // Set the volume. For details about the input parameters, see the interface document.
+ // Set the volume. For details about the input parameters, see the API document.
let volume = 0.5;
await videoPlayer.setVolume(volume).then(() => {
console.info('setVolume success');
}, this.failureCallback).catch(this.catchCallback);
- // Set the playback speed. For details about the input parameters, see the interface document.
+ // Set the playback speed. For details about the input parameters, see the API document.
let speed = media.PlaybackSpeed.SPEED_FORWARD_2_00_X;
await videoPlayer.setSpeed(speed).then(() => {
console.info('setSpeed success');
@@ -205,13 +205,13 @@ export class VideoPlayerDemo {
async videoPlayerDemo() {
let videoPlayer = undefined;
- let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent interface. For details about the document link, see the method of creating the XComponent.
+ let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent API. For details about the document link, see the method of creating the XComponent.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\H264_AAC.mp4 /data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/H264_AAC.mp4';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
@@ -292,14 +292,14 @@ export class VideoPlayerDemo {
async videoPlayerDemo() {
let videoPlayer = undefined;
- let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent interface. For details about the document link, see the method of creating the XComponent.
+ let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent API. For details about the document link, see the method of creating the XComponent.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\H264_AAC.mp4 /data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/H264_AAC.mp4';
let nextPath = '/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/MP4_AAC.mp4';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
@@ -341,7 +341,7 @@ export class VideoPlayerDemo {
fdPath = 'fd://'
await fileIO.open(nextPath).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
@@ -350,7 +350,7 @@ export class VideoPlayerDemo {
// Set the second video playback source.
videoPlayer.url = fdPath;
- // Call the prepare interface to prepare for playback.
+ // Call the prepare API to prepare for playback.
await videoPlayer.prepare().then(() => {
console.info('prepare success');
}, this.failureCallback).catch(this.catchCallback);
@@ -401,19 +401,15 @@ export class VideoPlayerDemo {
}
}
- sleep(time) {
- for(let t = Date.now(); Date.now() - t <= time;);
- }
-
async videoPlayerDemo() {
let videoPlayer = undefined;
- let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent interface. For details about the document link, see the method of creating the XComponent.
+ let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent API. For details about the document link, see the method of creating the XComponent.
let fdPath = 'fd://'
// The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\H264_AAC.mp4 /data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile" command.
let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/H264_AAC.mp4';
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
- console.info('open fd sucess fd is' + fdPath);
+ console.info('open fd success fd is' + fdPath);
}, (err) => {
console.info('open fd failed err is' + err);
}).catch((err) => {
@@ -442,23 +438,15 @@ export class VideoPlayerDemo {
}, this.failureCallback).catch(this.catchCallback);
// Set the loop playback attribute.
videoPlayer.loop = true;
- // Call the play API to start playback.
+ // Call the play API to start loop playback.
await videoPlayer.play().then(() => {
- console.info('play success');
- }, this.failureCallback).catch(this.catchCallback);
- // After the progress bar reaches the end, the playback continues for 3 seconds and then starts from the beginning, since loop playback is configured.
- await videoPlayer.seek(videoPlayer.duration, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
- console.info('seek duration success');
+ console.info('play success, loop value is ' + videoPlayer.loop);
}, this.failureCallback).catch(this.catchCallback);
- this.sleep(3000);
- // Release playback resources.
- await videoPlayer.release().then(() => {
- console.info('release success');
- }, this.failureCallback).catch(this.catchCallback);
-
- // Set the related instances to undefined.
- videoPlayer = undefined;
- surfaceID = undefined;
}
}
```
+
+## Samples
+The following samples are provided to help you better understand how to develop video playback:
+
+- [`VideoPlayer`: Video Playback (eTS, API version 9)](https://gitee.com/openharmony/app_samples/tree/master/media/VideoPlayer)
diff --git a/en/application-dev/napi/Readme-EN.md b/en/application-dev/napi/Readme-EN.md
new file mode 100644
index 0000000000000000000000000000000000000000..33670e46af96c2bb35b120bd4be23958bce8f84b
--- /dev/null
+++ b/en/application-dev/napi/Readme-EN.md
@@ -0,0 +1,3 @@
+# Native APIs
+
+- [Using Native APIs in Application Projects](napi-guidelines.md)
diff --git a/en/application-dev/notification/common-event.md b/en/application-dev/notification/common-event.md
index 99cbc2a32b9cfdc29e56f834e7b834ce3179ef7c..8ea3eaa2d6b2f450f28660ca9f50ad3b99947c8b 100644
--- a/en/application-dev/notification/common-event.md
+++ b/en/application-dev/notification/common-event.md
@@ -174,4 +174,4 @@ if (this.subscriber != null) {
The following sample is provided to help you better understand how to use the common event functionality:
-- [`CommonEvent`: eTS Common Event (API 7)](https://gitee.com/openharmony/app_samples/tree/master/Notification/CommonEvent)
+- [`CommonEvent`: eTS Common Event (API 8)](https://gitee.com/openharmony/app_samples/tree/master/Notification/CommonEvent)
diff --git a/en/application-dev/notification/notification.md b/en/application-dev/notification/notification.md
index 129db615d8cf7bc52d3707cbace5121546203868..1a24922a0f7ce6e17e6d65963f13622798348dad 100644
--- a/en/application-dev/notification/notification.md
+++ b/en/application-dev/notification/notification.md
@@ -133,7 +133,7 @@ var subscriber = {
##### Enabling Notification
-Before publishing a notification, check whether the notification feature is enabled for your application. By default, the feature is disabled. The application can use **Notification.requestEnableNotification** to prompt the user to enable the feature.
+Before publishing a notification, check whether the notification feature is enabled for your application. By default, the feature is disabled. The application calls **Notification.requestEnableNotification** to prompt the user to enable the feature.
```js
Notification.requestEnableNotification() .then((data) => {
@@ -262,4 +262,4 @@ Notification.cancel(1, "label", cancelCallback)
The following sample is provided to help you better understand how to develop notification functions:
-[`Notification`: EtsNotification (API 7)](https://gitee.com/openharmony/app_samples/tree/master/common/Notification)
\ No newline at end of file
+[`Notification`: EtsNotification (API 8)](https://gitee.com/openharmony/app_samples/tree/master/common/Notification)
\ No newline at end of file
diff --git a/en/application-dev/quick-start/Readme-EN.md b/en/application-dev/quick-start/Readme-EN.md
index e101158532d51ba2a072a1d860bb7eaf1bee1602..228d2f0442007f51177f074b6d2e70fcf7486395 100644
--- a/en/application-dev/quick-start/Readme-EN.md
+++ b/en/application-dev/quick-start/Readme-EN.md
@@ -6,9 +6,9 @@
- [Getting Started with eTS in the Low-Code Approach](start-with-ets-low-code.md)
- [Getting Started with JavaScript in the Traditional Coding Approach](start-with-js.md)
- [Getting Started with JavaScript in the Low-Code Approach](start-with-js-low-code.md)
-
- Development Fundamentals
- - [Application Development Package Structure (FA Model)](package-structure.md)
- - [Application Development Package Structure (Stage Model)](module-structure.md)
+ - [Application Package Structure Configuration File (FA Model)](package-structure.md)
+ - [Application Package Structure Configuration File (Stage Model)](stage-structure.md)
- [Resource File Categories](basic-resource-file-categories.md)
- [SysCap](syscap.md)
+
diff --git a/en/application-dev/quick-start/package-structure.md b/en/application-dev/quick-start/package-structure.md
index 07a151684093b7d0b85745b7211b53a7283bac2b..7bdb44c158b921d8ff550b16d9b2f22b910262e7 100644
--- a/en/application-dev/quick-start/package-structure.md
+++ b/en/application-dev/quick-start/package-structure.md
@@ -271,11 +271,12 @@ Example of the **module** tag structure:
Table 12 Internal structure of the distro attribute
-| Attribute | Description | Data Type| Initial Value Allowed|
-| ---------------- | ------------------------------------------------------------ | -------- | ---------- |
-| moduleName | Name of the current HAP file. The maximum length is 31 characters. | String | No |
-| moduleType | Type of the current HAP file. The value can be **entry** or **feature**. For the HAR type, set this attribute to **har**.| String | No |
-| installationFree | Whether the HAP file supports the installation-free feature. **true**: The HAP file supports the installation-free feature and meets installation-free constraints. **false**: The HAP file does not support the installation-free feature. Pay attention to the following: When **entry.hap** is set to **true**, all **feature.hap** fields related to **entry.hap **must be **true**. When **entry.hap** is set to **false**, **feature.hap** related to **entry.hap** can be set to **true** or **false** based on service requirements.| Boolean | No |
+| Attribute | Description | Data Type| Initial Value Allowed|
+| ---------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -------- | ---------- |
+| moduleName | Name of the current HAP file. The maximum length is 31 characters. | String | No |
+| moduleType | Type of the current HAP file. The value can be **entry** or **feature**. For the HAR type, set this attribute to **har**. | String | No |
+| installationFree | Whether the HAP file supports the installation-free feature. **true**: The HAP file supports the installation-free feature and meets installation-free constraints. **false**: The HAP file does not support the installation-free feature. Pay attention to the following: When **entry.hap** is set to **true**, all **feature.hap** fields related to **entry.hap **must be **true**. When **entry.hap** is set to **false**, **feature.hap** related to **entry.hap** can be set to **true** or **false** based on service requirements. | Boolean | No |
+| deliveryWithInstall | Whether the HAP file supports the installation with application。 true: Support。 false:No Support。 | Boolean | No |
Example of the **distro** attribute structure:
@@ -283,7 +284,8 @@ Example of the **distro** attribute structure:
"distro": {
"moduleName": "ohos_entry",
"moduleType": "entry",
- "installationFree": true
+ "installationFree": true,
+ "deliveryWithInstall": true
}
```
diff --git a/en/application-dev/quick-start/module-structure.md b/en/application-dev/quick-start/stage-structure.md
similarity index 97%
rename from en/application-dev/quick-start/module-structure.md
rename to en/application-dev/quick-start/stage-structure.md
index ef19d2b394b87375811dd483ab162d81a7068b4a..7d733b1b06c5996fb16cc01cbeb712422edf2b1f 100644
--- a/en/application-dev/quick-start/module-structure.md
+++ b/en/application-dev/quick-start/stage-structure.md
@@ -175,12 +175,12 @@ Table 2 Internal structure of the app tag
| vendor | Application vendor. The value is a string with a maximum of 255 bytes.| String | Yes (initial value: left empty) |
| versionCode | Version number of the application. The value is a 32-bit non-negative integer and less than 2 to the power of 31. It is used only to determine whether a version is later than another version. A larger value indicates a later version. Ensure that a new version of the application uses a value greater than any of its predecessors. | Number | No |
| versionName | Text description of the version number, which is displayed to users. The value consists of only digits and dots. The four-segment format *A.B.C.D* is recommended, wherein: Segment 1: major version number, which ranges from 0 to 99. A major version consists of major new features or large changes. Segment 2: minor version number, which ranges from 0 to 99. A minor version consists of some new features and large bug fixes. Segment 3: feature version number, which ranges from 0 to 99. A feature version consists of scheduled new features. Segment 4: maintenance release number or patch number, which ranges from 0 to 999. A maintenance release or patch consists of resolution to security flaws or minor bugs.| String | No |
-| minCompatibleVersionCode | Minimum API version required for running the application. | Number | Yes (initial value: value of **versionCode**)|
-| minAPIVersion | Target API version required for running the application. | Number | No |
+| minCompatibleVersionCode | Minimum API version compatible with the application. | Number | Yes (initial value: value of **versionCode**)|
+| minAPIVersion | Minimum API version required for running the application. | Number | No |
| targetAPIVersion | Target API version required for running the application. | Integer | No |
| 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.| String | Yes (initial value: **"Release"**) |
| distributedNotificationEnabled | Whether the distributed notification feature is enabled for the application. | Boolean | Yes (initial value: **true**) |
-| entityType | Category of the application, which can be **game**, **media**, **communication**, **news**, **travel**, **utility**, **shopping**, **education**, **kids**, **business**, and **photography**.| String | Yes (initial value: unspecified) |
+| entityType | Type of the application, which can be **game**, **media**, **communication**, **news**, **travel**, **utility**, **shopping**, **education**, **kids**, **business**, and **photography**.| String | Yes (initial value: unspecified) |
### Internal Structure of the module Tag
@@ -212,9 +212,9 @@ Table 4 System-defined deviceTypes values
| Device Type | Value | Description |
| ------------ | ------------ | -------------------------------------------------------- |
| tablet | tablet | Tablet, speaker with a screen |
-| smart TV | tv | |
+| smart TV | tv | N/A |
| smart watch | wearable | Smart watch, kids' watch, especially a watch that provides call features|
-| head unit | car | |
+| head unit | car | N/A |
| router | router | Router |
Example of the **deviceTypes** attribute structure:
@@ -309,7 +309,7 @@ Table 6 Internal structure of the abilities attribute
| icon | Icon of the ability. The value is the index to the resource file. This attribute can be left empty, and the default value is an empty array. If **ability** is set to **MainElement**, this attribute is mandatory.| String | Yes (initial value: left empty) If **ability** is set to **MainElement**, this attribute is mandatory.|
| permissions | A set of permissions that need to be applied for when the capability of another application is invoked. The value is a string array. Each array element is a permission name, which is usually represented by a reverse domain name (a maximum of 255 bytes). The permission can be predefined by the system or customized by the application. For the latter, the value must be the same as the **name** value of a permission defined in the **defPermissions** attribute. | String array| Yes (initial value: left empty) |
| metadata | Metadata about the ability. For details about metadata, see [Internal Structure of the metadata Attribute](#internal-structure-of-the-metadata-attribute).| Array | Yes (initial value: left empty) |
-| visible | Indicates whether the ability can be invoked by other applications. The value **true** means that the ability can be invoked by other applications, and **false** means the opposite.| Boolean | Yes (initial value: **false**) |
+| visible | Whether the ability can be invoked by other applications. The value **true** means that the ability can be invoked by other applications, and **false** means the opposite.| Boolean | Yes (initial value: **false**) |
| continuable | Whether the ability can be migrated. The value **true** means that the ability can be migrated, and **false** means the opposite.| Boolean | Yes (initial value: **false**) |
| skills | Feature set of wants that can be received by the ability. Configuration rule: In an entry package, you can configure multiple abilities with the **skills** attribute (where **action.system.home** and **entity.system.home** are configured) that has the entry capability. The **label** and **icon** in the first ability that has **skills** configured are used as the **label** and **icon** of the entire service/application. The **skills** attribute with the entry capability can be configured for the feature package of an OpenHarmony application, but not for an OpenHarmony service. For details about the internal structure of **skills**, see [Internal Structure of the skills Attribute](#internal-structure-of-the-skills-attribute).| Array | Yes (initial value: left empty) |
| backgroundModes | Continuous task modes of the ability. Continuous tasks are classified into the following types: **dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices **audioPlayback**: audio playback service **audioRecording**: audio recording service **location**: location and navigation services **bluetoothInteraction**: Bluetooth scanning, connection, and transmission services (wearables) **multiDeviceConnection**: multi-device interconnection service **wifiInteraction**: Wi-Fi scanning, connection, and transmission services (multi-screen cloning) **voip**: voice/video call and VoIP services **taskKeeping**: computing service | String | Yes (initial value: left empty) |
@@ -361,7 +361,7 @@ Table 7 Internal structure of the skills attribute
| -------- | ------------------------------------------------------------ | ---------- | -------------------- |
| actions | A set of want action values that can be received. The value can be a value predefined by the system or a custom value.| String array| Yes (initial value: left empty)|
| entities | Categories of abilities that can receive the want. The value can be a value predefined by the system or a custom value.| String array| Yes (initial value: left empty)|
-| uris | Data specifications to be added to the want filter. The specification can be of data type only (**mimeType** attribute), URI only, or both. For details about the internal structure of **uris**, see Table 8.| Object array | Yes (initial value: left empty)|
+| uris | Data specification to be added to the want filter. The specification can be of data type only (**mimeType** attribute), URI only, or both. For details about the internal structure of **uris**, see Table 8.| Object array | Yes (initial value: left empty)|
Table 8 Internal structure of the uris attribute
@@ -612,7 +612,7 @@ Table 13 Internal structure of the shortcuts attribute
| Attribute | Description | Data Type| Initial Value Allowed |
| ---------- | ------------------------------------------------------------ | -------- | -------------------------- |
-| shortcutId | Shortcut ID. The value is a string with a maximum of 63 bytes. | String | No |
+| shortcutId | ID of the shortcut. The value is a string with a maximum of 63 bytes. | String | No |
| label | Label of the shortcut, that is, the text description displayed by the shortcut. The value can be a string or a resource index to the description. The value is a string with a maximum of 63 bytes.| String | Yes (initial value: left empty) |
| icon | Icon of the shortcut. The value is the index to the resource file. | String | Yes (initial value: left empty)|
| wants | Wants to which the shortcut points. The attribute consists of the **bundleName** and **abilityName** sub-attributes. **bundleName**: target bundle name of the shortcut; string type. **abilityName**: target component name of the shortcut; string type.| Object | Yes (initial value: left empty) |
diff --git a/en/application-dev/quick-start/start-overview.md b/en/application-dev/quick-start/start-overview.md
index 7dcfb3583408d68454489f1eef38f1b1e19defea..6f5bcb31545c055124156a366eea31e19f91c8c4 100644
--- a/en/application-dev/quick-start/start-overview.md
+++ b/en/application-dev/quick-start/start-overview.md
@@ -47,4 +47,4 @@ This document provides a Page ability instance with two pages. For more informat
2. Install DevEco Studio and configure the development environment. For details, see [Configuring the OpenHarmony SDK](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-setting-up-environment-0000001263160443).
-When you are done, follow the instructions in [Getting Started with eTS in the Traditional Coding Approach](start-with-ets.md),[Getting Started with eTS in the Low-Code Approach](start-with-ets-low-code.md), [Getting Started with JavaScript in the Traditional Coding Approach](start-with-js.md), and [Getting Started with JavaScript in the Low-Code Approach](start-with-js-low-code.md).
+When you are done, follow the instructions in [Getting Started with eTS in the Traditional Coding Approach](start-with-ets.md), [Getting Started with eTS in the Low-Code Approach](start-with-ets-low-code.md), [Getting Started with JavaScript in the Traditional Coding Approach](start-with-js.md), and [Getting Started with JavaScript in the Low-Code Approach](start-with-js-low-code.md).
diff --git a/en/application-dev/quick-start/start-with-ets.md b/en/application-dev/quick-start/start-with-ets.md
index 53c1133bfb918ed07e1c6d81f90a2f46a85ca500..66485cd8aaeada2f1896013c7822aacc30b5872d 100644
--- a/en/application-dev/quick-start/start-with-ets.md
+++ b/en/application-dev/quick-start/start-with-ets.md
@@ -20,17 +20,18 @@
## eTS Project Files
-- **entry** : OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
- - **src > main > ets** : a collection of eTS source code.
- - **src > main > ets > MainAbility** : entry to your application/service.
- - **src > main > ets > MainAbility > pages** : pages contained in **MainAbility**.
- - **src > main > ets > MainAbility > app.ets** : ability lifecycle file.
- - **src > main > resources** : a collection of resource files used by your application/service, such as graphics, multimedia, character strings, and layout files.
- - **src > main > config.json** : module configuration file. This file describes the global configuration information of the application/service, the device-specific configuration information, and the configuration information of the HAP file.
- - **build-profile.json5** : current module information and build configuration options, including **buildOption target**.
- - **hvigorfile.js** : module-level compilation and build task script. You can customize related tasks and code implementation.
-- **build-profile.json5** : application-level configuration information, including the signature and product configuration.
-- **hvigorfile.js** : application-level compilation and build task script.
+- **entry**: OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
+ - **src > main > ets**: a collection of eTS source code.
+ - **src > main > ets > MainAbility**: entry to your application/service.
+ - **src > main > ets > MainAbility > pages**: pages contained in **MainAbility**.
+ - **src > main > ets > MainAbility > pages > index.ets**: the first page in the pages list, that is, the home page of your application.
+ - **src > main > ets > MainAbility > app.ets**: ability lifecycle file.
+ - **src > main > resources**: a collection of resource files used by your application/service, such as graphics, multimedia, character strings, and layout files.
+ - **src > main > config.json**: module configuration file. This file describes the global configuration information of the application/service, the device-specific configuration information, and the configuration information of the HAP file.
+ - **build-profile.json5**: current module information and build configuration options, including **buildOption target**.
+ - **hvigorfile.js**: module-level compilation and build task script. You can customize related tasks and code implementation.
+- **build-profile.json5**: application-level configuration information, including the signature and product configuration.
+- **hvigorfile.js**: application-level compilation and build task script.
## Building the First Page
@@ -62,7 +63,7 @@
2. Add a **<Button>** component.
- On the default page, add a **<Button>** component to accept user clicks and implement redirection to another page. The sample code in the **index.ets** file is shown below:
+ On the default page, add a **<Button>** component to respond to user clicks and implement redirection to another page. The sample code in the **index.ets** file is shown below:
```
@@ -77,7 +78,7 @@
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
- // Add a button to accept user clicks.
+ // Add a button to respond to user clicks.
Button() {
Text('Next')
.fontSize(30)
@@ -174,7 +175,7 @@ You can implement page redirection through the page router, which finds the targ
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
- // Add a button to accept user clicks.
+ // Add a button to respond to user clicks.
Button() {
Text('Next')
.fontSize(30)
diff --git a/en/application-dev/quick-start/start-with-js-low-code.md b/en/application-dev/quick-start/start-with-js-low-code.md
index a20c01c2f459fc07b799ca847683f99350dd4829..69e650671909a57d56c6486346938a4804de2fdf 100644
--- a/en/application-dev/quick-start/start-with-js-low-code.md
+++ b/en/application-dev/quick-start/start-with-js-low-code.md
@@ -37,10 +37,11 @@ After the project synchronization is complete, a low-code directory structure is

-- **entry > src > main > js > MainAbility > pages > index > index.js** : defines logical relationships, such as data and events, used on low-code pages. For details, see [JavaScript](../ui/js-framework-syntax-js.md). If multiple low-code development pages are created, a page folder and the corresponding **.js** file will be created for each of these pages.
+- **entry > src > main > js > MainAbility > pages > index > index.js**: defines logical relationships, such as data and events, used on low-code pages. For details, see [JavaScript](../ui/js-framework-syntax-js.md). If multiple low-code development pages are created, a page folder and the corresponding **.js** file will be created for each of these pages.
+
>  **NOTE** To avoid build errors when using the low-code development page, make sure the directory where the corresponding **.js** file is located does not contain **.hml** or **.css** files. For example, in the preceding example, no **.hml** or **.css** file is allowed in **js** > **MainAbility** > **pages** > **index**.
>
-- **entry > src > main > supervisual > MainAbility > pages > index > index.visual** : stores the data model of the low-code development page. You can double-click the file to open the low-code development page. If multiple low-code development pages are created, a page folder and the corresponding **.visual** file will be created for each of these pages.
+- **entry > src > main > supervisual > MainAbility > pages > index > index.visual**: stores the data model of the low-code development page. You can double-click the file to open the low-code development page. If multiple low-code development pages are created, a page folder and the corresponding **.visual** file will be created for each of these pages.
## Building the First Page
diff --git a/en/application-dev/quick-start/start-with-js.md b/en/application-dev/quick-start/start-with-js.md
index 60131768f2dd3727a4d1467ca92896abb0239752..301da91e43a7f751c4e70135acf5fbce64c3eef8 100644
--- a/en/application-dev/quick-start/start-with-js.md
+++ b/en/application-dev/quick-start/start-with-js.md
@@ -19,7 +19,7 @@
## JavaScript Project Files
-- **entry** : OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
+- **entry**: OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
- **src > main > js**: a collection of JS source code.
- **src > main > js > MainAbility**: entry to your application/service.
- **src > main > js > MainAbility > i18n**: resources in different languages, for example, UI strings and image paths.
@@ -50,7 +50,7 @@
2. Add a button and bind the **onclick** method to this button.
- On the default page, add an **<input>** component of the button type to accept user clicks and implement redirection to another page. The sample code in the **index.hml** file is shown below:
+ On the default page, add an **<input>** component of the button type to respond to user clicks and implement redirection to another page. The sample code in the **index.hml** file is shown below:
```
diff --git a/en/application-dev/quick-start/syscap.md b/en/application-dev/quick-start/syscap.md
index 3d9d733441f5ab19016a3cabeada6abe41d6e1bc..41ce7f114359edae353b6fd0783cf55aab8a2adb 100644
--- a/en/application-dev/quick-start/syscap.md
+++ b/en/application-dev/quick-start/syscap.md
@@ -1,4 +1,4 @@
-# SysCap Usage Guidelines
+# SysCap
## Overview
diff --git a/en/application-dev/reference/Readme-EN.md b/en/application-dev/reference/Readme-EN.md
index c2252e1a8f56f93c52ee4278681fc7fb23d28366..30bb3aacd85d9e11012fb66dc276a88476139126 100644
--- a/en/application-dev/reference/Readme-EN.md
+++ b/en/application-dev/reference/Readme-EN.md
@@ -4,7 +4,8 @@
- [TypeScript-based Declarative Development Paradigm](arkui-ts/Readme-EN.md)
- [APIs](apis/Readme-EN.md)
- - [JS (eTS Included) APIs](reference/apis/Readme-EN.md)
+ - [JS (eTS Included) APIs](apis/Readme-EN.md)
- Native APIs
- - [Standard Library](reference/native-lib/third_party_libc/musl.md)
- - [Node_API](reference/native-lib/third_party_napi/napi.md)
\ No newline at end of file
+ - [Standard Library](native-lib/third_party_libc/musl.md)
+ - [Node_API](native-lib/third_party_napi/napi.md)
+
diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md
index 83b61077eeae144c95e92cdad94b35b8f01ccca7..e62395b2437a0f24917a3f7356b353dad2c8dd67 100644
--- a/en/application-dev/reference/apis/js-apis-Bundle.md
+++ b/en/application-dev/reference/apis/js-apis-Bundle.md
@@ -1,8 +1,8 @@
# Bundle Module (JavaScript SDK APIs)
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-
+> API version 9 is a canary version for trial use. The APIs of this version may be unstable.
## Modules to Import
```
@@ -17,8 +17,8 @@ SystemCapability.BundleManager.BundleFramework
| Required Permissions | Permission Level | Description |
| ---------------------------------------- | ------------ | --------- |
-| ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about the current application.|
-| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all applications.|
+| ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about the current application. |
+| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all applications. |
| ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall applications. |
## bundle.getApplicationInfo
@@ -37,17 +37,17 @@ SystemCapability.BundleManager.BundleFramework
**Parameters**
-| Name | Type | Mandatory | Description |
+| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
-| bundleName | string | Yes | Bundle name of the application. |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
-| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
+| bundleName | string | Yes | Bundle name of the application. |
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
+| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value**
| Type | Description |
| ------------------------- | ------------------ |
-| Promise\ | Promise used to return the application information.|
+| Promise\ | Promise used to return the application information. |
**Example**
@@ -84,7 +84,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback\ | Yes | Callback used to return the application information. |
@@ -123,7 +123,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| callback | AsyncCallback\ | Yes | Callback used to return the application information. |
**Example**
@@ -159,14 +159,14 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | ---------- | ---- | --------------------------------------- |
-| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value**
| Type | Description |
| --------------------------- | -------------------------- |
-| Promise> | Promise used to return the information of all available bundles.|
+| Promise> | Promise used to return the information of all available bundles. |
**Example**
@@ -201,7 +201,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | --------------------------------- | ---- | --------------------------------------- |
-| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| callback | AsyncCallback> | Yes | Callback used to return the information of all available bundles. |
**Example**
@@ -236,7 +236,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | --------------------------------- | ---- | --------------------------------------- |
-| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback> | Yes | Callback used to return the information of all available bundles. |
@@ -275,14 +275,14 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name. |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| options | BundleOptions | No | Includes **userId**. |
**Return value**
| Type | Description |
| -------------------- | ---------------------------- |
-| Promise\ | Promise used to return the bundle information.|
+| Promise\ | Promise used to return the bundle information. |
**Example**
@@ -321,7 +321,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name. |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| callback | AsyncCallback\ | Yes | Callback used to return the bundle information. |
**Example**
@@ -358,7 +358,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name. |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| options | BundleOptions | Yes | Includes **userId**. |
| callback | AsyncCallback\ | Yes | Callback used to return the bundle information. |
@@ -398,14 +398,14 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value**
| Type | Description |
| -------------------------------- | ------------------------------- |
-| Promise> | Promise used to return the application information.|
+| Promise> | Promise used to return the application information. |
**Example**
@@ -440,7 +440,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | -------------------------------------- | ---- | --------------------------------------- |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback> | Yes | Callback used to return the application information. |
@@ -463,7 +463,7 @@ bundle.getAllApplicationInfo(bundleFlags, userId, (err, data) => {
getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void;
-Obtains the information about all applications of the specified user. This API uses an asynchronous callback to return the result.
+Obtains the information about all applications. This API uses an asynchronous callback to return the result.
**Required permissions**
@@ -477,7 +477,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | -------------------------------------- | ---- | --------------------------------------- |
-| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0. |
| callback | AsyncCallback> | Yes | Callback used to return the application information. |
**Example**
@@ -512,13 +512,13 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. |
-| abilityName | string | Yes | Ability name.|
+| abilityName | string | Yes | Ability name. |
**Return value**
| Type | Description |
| --------------------- | --------------------- |
-| Promise\ | Promise used to return the ability information.|
+| Promise\ | Promise used to return the ability information. |
**Example**
@@ -552,8 +552,8 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. |
-| abilityName | string | Yes | Ability name.|
-| callback | AsyncCallback\ | Yes | Callback used to return the ability information.|
+| abilityName | string | Yes | Ability name. |
+| callback | AsyncCallback\ | Yes | Callback used to return the ability information. |
**Example**
@@ -588,13 +588,13 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. |
-| abilityName | string | Yes | Ability name.|
+| abilityName | string | Yes | Ability name. |
**Return value**
| Type | Description |
| ---------------- | ------------------ |
-| Promise\ | Promise used to return the application name.|
+| Promise\ | Promise used to return the application name. |
**Example**
@@ -628,7 +628,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ---------------------- | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. |
-| abilityName | string | Yes | Ability name.|
+| abilityName | string | Yes | Ability name. |
| callback | AsyncCallback\ | Yes | Callback used to return the application name. |
**Example**
@@ -649,7 +649,7 @@ bundle.getAbilityLabel(bundleName, abilityName, (err, data) => {
isAbilityEnabled(info: AbilityInfo): Promise\
-Checks whether an ability is enabled based on a given want. This API uses a promise to return the result.
+Checks whether an ability is enabled based on a given **AbilityInfo** object. This API uses a promise to return the result.
**Required permissions**
@@ -663,13 +663,13 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---- | ----------- | ---- | ------------ |
-| info | AbilityInfo | Yes | Ability information.|
+| info | AbilityInfo | Yes | Ability information. |
**Return value**
| Type | Description |
| ----------------- | ------------------------- |
-| Promise\ | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
+| Promise\ | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned. |
**Example**
@@ -690,7 +690,7 @@ bundle.isAbilityEnabled(Info)
isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\): void
-Checks whether an ability is enabled based on a given want. This API uses an asynchronous callback to return the result.
+Checks whether an ability is enabled based on a given **AbilityInfo** object. This API uses an asynchronous callback to return the result.
**Required permissions**
@@ -705,7 +705,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | --------------- |
| info | AbilityInfo | Yes | Ability information. |
-| callback | AsyncCallback\ | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
+| callback | AsyncCallback\ | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned. |
**Example**
@@ -727,7 +727,7 @@ bundle.isAbilityEnabled(Info, (err, data) => {
isApplicationEnabled(bundleName: string): Promise\
-Checks whether an application is enabled based on a given want. This API uses a promise to return the result.
+Checks whether an application is enabled based on a given bundle name. This API uses a promise to return the result.
**Required permissions**
@@ -741,13 +741,13 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------ |
-| bundleName | string | Yes | Bundle name of the application.|
+| bundleName | string | Yes | Bundle name of the application. |
**Return value**
| Type | Description |
| ----------------- | ------------------------- |
-| Promise\ | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
+| Promise\ | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned. |
**Example**
@@ -780,7 +780,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | ----------------------- | ---- | --------------- |
| bundleName | string | Yes | Bundle name of the application. |
-| callback | AsyncCallback\ | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
+| callback | AsyncCallback\ | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned. |
**Example**
@@ -814,14 +814,14 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. |
-| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value**
| Type | Description |
| ---------------------------- | --------------------- |
-| Promise\>| Promise used to return the ability information.|
+| Promise\>| Promise used to return the ability information. |
**Example**
@@ -857,7 +857,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. |
-| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of the ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback> | Yes | Callback used to return the ability information. |
@@ -894,7 +894,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. |
-| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| bundleFlags | number | Yes | Type of the ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback> | Yes | Callback used to return the ability information. |
**Example**
@@ -934,12 +934,12 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------ |
-| bundleName | string | Yes | Bundle name of the application.|
+| bundleName | string | Yes | Bundle name of the application. |
**Return value**
| Type | Description |
| -------------- | -------------------------------------- |
-| Promise\ | Promise used to return the **Want** object.|
+| Promise\ | Promise used to return the **Want** object. |
**Example**
@@ -972,7 +972,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---------- | -------------------- | ---- | ------------------------------ |
| bundleName | string | Yes | Bundle name of the application. |
-| callback | AsyncCallback\ | Yes | Callback used to return the **Want** object.|
+| callback | AsyncCallback\ | Yes | Callback used to return the **Want** object. |
**Example**
@@ -1002,12 +1002,12 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | -------- |
-| uid | number | Yes | UID based on which the bundle name is to obtain.|
+| uid | number | Yes | UID based on which the bundle name is to obtain. |
**Return value**
| Type | Description |
| ---------------- | --------------------------------- |
-| Promise\ | Promise used to return the bundle name.|
+| Promise\ | Promise used to return the bundle name. |
**Example**
@@ -1036,7 +1036,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
| uid | number | Yes | UID based on which the bundle name is to obtain. |
-| callback | AsyncCallback\ | Yes | Callback used to return the bundle name.|
+| callback | AsyncCallback\ | Yes | Callback used to return the bundle name. |
**Example**
@@ -1056,7 +1056,7 @@ bundle.getNameForUid(uid, (err, data) => {
getAbilityIcon(bundleName: string, abilityName: string): Promise\;
-Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This API uses a promise to return the result.
+Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result.
**Required permissions**
@@ -1076,7 +1076,7 @@ SystemCapability.BundleManager.BundleFramework
**Return value**
| Type | Description |
| --------------------- | ------------------------------------------------------------ |
-| Promise\ | Promise used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.|
+| Promise\ | Promise used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>. |
**Example**
@@ -1095,7 +1095,7 @@ bundle.getAbilityIcon(bundleName, abilityName)
getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\): void;
-Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This API uses an asynchronous callback to return the result.
+Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result.
**Required permissions**
@@ -1111,7 +1111,7 @@ SystemCapability.BundleManager.BundleFramework
| ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. |
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain. |
-| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.|
+| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>. |
**Example**
@@ -1147,14 +1147,14 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| -------------- | ------ | ---- | ---------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. |
-| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value**
| Type | Description |
| ------------------------------------- | ------------------------------ |
-| Promise> | Promise used to return the Extension ability information.|
+| Promise> | Promise used to return the Extension ability information. |
**Example**
@@ -1194,7 +1194,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. |
-| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback> | Yes | Callback used to return the Extension ability information. |
@@ -1235,7 +1235,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| want | Want | Yes | Want that contains the bundle name. |
-| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
+| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0. |
| callback | AsyncCallback> | Yes | Callback used to return the Extension ability information. |
**Example**
@@ -1262,8 +1262,8 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => {
| Name | Readable/Writable| Type | Mandatory | Description |
| ----------- | ---- | ------ | ---- | ---------------------------------------- |
| deviceId | Read-only | string | No | ID of the device that runs the ability. |
-| bundleName | Read-only | string | Yes | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
-| abilityName | Read-only | string | Yes | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
+| bundleName | Read-only | string | Yes | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability. |
+| abilityName | Read-only | string | Yes | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability. |
| uri | Read-only | string | No | Resource ID. |
| shortName | Read-only | string | No | Short name of the **ElementName**. |
@@ -1274,13 +1274,13 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => {
| Name | Default Value | Description |
| ---------------------------------------- | ---- | ------------------------- |
| SUCCESS | 0 | Installation succeeded. |
-| STATUS_INSTALL_FAILURE | 1 | Installation failed. (The application to be installed does not exist.) |
+| STATUS_INSTALL_FAILURE | 1 | Installation failed. (The application to be installed is not found.) |
| STATUS_INSTALL_FAILURE_ABORTED | 2 | Installation aborted. |
| STATUS_INSTALL_FAILURE_INVALID | 3 | Invalid installation parameter. |
-| STATUS_INSTALL_FAILURE_CONFLICT | 4 | Installation conflict. (The basic information about the application to upgrade is inconsistent with that of the existing application.) |
+| STATUS_INSTALL_FAILURE_CONFLICT | 4 | Installation conflict. (The basic information of the application to update is inconsistent with that of the existing application.) |
| STATUS_INSTALL_FAILURE_STORAGE | 5 | Failed to store the bundle information. |
-| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | Installation incompatible. (A downgrade occurs or the signature information is incorrect.) |
-| STATUS_UNINSTALL_FAILURE | 7 | Uninstallation failed. (The application to be uninstalled does not exist.) |
+| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | Installation incompatibility. (A downgrade occurs or the signature information is incorrect.) |
+| STATUS_UNINSTALL_FAILURE | 7 | Uninstallation failed. (The application to be uninstalled is not found.) |
| STATUS_UNINSTALL_FAILURE_BLOCKED | 8 | Uninstallation aborted. (This error code is not in use.) |
| STATUS_UNINSTALL_FAILURE_ABORTED | 9 | Uninstallation aborted. (Invalid parameters.) |
| STATUS_UNINSTALL_FAILURE_CONFLICT | 10 | Uninstallation conflict. (Failed to uninstall a system application or end the application process.)|
@@ -1309,9 +1309,9 @@ Enumerates bundle flags.
| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000008 | Obtains the application information with the permission information. |
| GET_BUNDLE_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains the bundle information with the information about the required permissions. |
| GET_ABILITY_INFO_WITH_METADATA8+ | 0x00000020 | Obtains the ability metadata information. |
-| GET_BUNDLE_WITH_EXTENSION_ABILITY9+ | 0x00000020 | Obtains the bundle information with the Extension ability information.|
+| GET_BUNDLE_WITH_EXTENSION_ABILITY9+ | 0x00000020 | Obtains the bundle information with the Extension ability information. |
| GET_APPLICATION_INFO_WITH_METADATA8+ | 0x00000040 | Obtains the application metadata information. |
-| GET_ABILITY_INFO_SYSTEMAPP_ONLY8+ | 0x00000080 | Obtains the ability information with information about system applications.|
+| GET_ABILITY_INFO_SYSTEMAPP_ONLY8+ | 0x00000080 | Obtains the ability information of system applications.|
| GET_ABILITY_INFO_WITH_DISABLE8+ | 0x00000100 | Obtains information about disabled abilities. |
| GET_APPLICATION_INFO_WITH_DISABLE8+ | 0x00000200 | Obtains information about disabled applications. |
| GET_ALL_APPLICATION_INFO | 0xFFFF0000 | Obtains all application information. |
@@ -1324,7 +1324,7 @@ Describes the bundle options.
| Name | Type | Readable | Writable | Description |
| ------ | ------ | ---- | ---- | ---------------------------- |
-| userId | number | Yes | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.|
+| userId | number | Yes | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
## BundleInfo
@@ -1343,7 +1343,7 @@ Describes the application bundle information.
| appInfo | ApplicationInfo | Yes | No | Application configuration information. |
| abilityInfos | Array\ | Yes | No | Ability configuration information. |
| reqPermissions | Array\ | Yes | No | Array of the permissions to request from the system. |
-| reqPermissionDetails | Array\ | Yes | No | Detailed information of the permissions to request from the system.|
+| reqPermissionDetails | Array\ | Yes | No | Detailed information of the permissions to request from the system. |
| vendor | string | Yes | No | Vendor of the bundle. |
| versionCode | number | Yes | No | Version number of the bundle. |
| versionName | string | Yes | No | Version description of the bundle. |
@@ -1355,7 +1355,7 @@ Describes the application bundle information.
| cpuAbi | string | Yes | No | cpuAbi information of the bundle. |
| isSilentInstallation | string | Yes | No | Whether to install the bundle in silent mode. |
| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. |
-| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry. |
+| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. |
| reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. |
| extensionAbilityInfo9+ | Array\ | Yes | No | Extended information of the ability. |
@@ -1376,7 +1376,7 @@ Describes the application information.
| labelId | string | Yes | No | Application label ID. |
| icon | string | Yes | No | Application icon. |
| iconId | string | Yes | No | Application icon ID. |
-| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used by default.|
+| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used.|
| supportedModes | number | Yes | No | Running modes supported by the application. |
| moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. |
| permissions | Array\ | Yes | No | Permissions required for accessing the application. |
@@ -1398,8 +1398,8 @@ Describes the module information of the application.
| Name | Type | Readable | Writable | Description |
| --------------- | ------ | ---- | ---- | ---- |
-| moduleName | string | Yes | No | Module name.|
-| moduleSourceDir | string | Yes | No | Installation directory.|
+| moduleName | string | Yes | No | Module name. |
+| moduleSourceDir | string | Yes | No | Installation directory. |
## CustomizeData
@@ -1409,7 +1409,7 @@ Describes the custom metadata.
| Name | Type | Readable | Writable | Description |
| ------------------ | ------ | ---- | ---- | -------- |
-| name | string | Yes | Yes | Custom metadata name.|
+| name | string | Yes | Yes | Custom metadata name. |
| value | string | Yes | Yes | Custom metadata value. |
| extra8+ | string | Yes | Yes | Custom resources. |
@@ -1438,7 +1438,7 @@ Describes the HAP module information.
| mainAbilityName | string | Yes | No | Name of the entry ability. |
| installationFree | boolean | Yes | No | Whether installation-free is supported. |
| mainElementName9+ | string | Yes | No | Information about the entry ability. |
-| extensionAbilityInfo9+ | Array\ | Yes | No | Extension ability information.|
+| extensionAbilityInfo9+ | Array\ | Yes | No | Extension ability information. |
| metadata9+ | Array\ | Yes | No | Metadata of the ability. |
## ReqPermissionDetail
@@ -1451,7 +1451,7 @@ Describes the detailed information of the permissions to request from the system
| --------- | --------- | ---- | ---- | ---------- |
| name | string | Yes | Yes | Name of the permission to request. |
| reason | string | Yes | Yes | Reason for requesting the permission. |
-| usedScene | UsedScene | Yes | Yes | Application scenario and timing for using the permission.|
+| usedScene | UsedScene | Yes | Yes | Application scenario and timing for using the permission. |
## UsedScene
@@ -1461,7 +1461,7 @@ Describes the application scenario and timing for using the permission.
| Name | Type | Readable | Writable | Description |
| --------- | -------------- | ---- | ---- | ---------------- |
-| abilities | Array\ | Yes | Yes | Abilities that use the permission.|
+| abilities | Array\ | Yes | Yes | Abilities that use the permission. |
| when | string | Yes | Yes | Time when the permission is used. |
@@ -1481,7 +1481,7 @@ Describes the ability information.
| descriptionId | number | Yes | No | Ability description ID. |
| iconId | number | Yes | No | Ability icon ID. |
| moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. |
-| process | string | Yes | No | Process in which this ability runs. If this parameter is not set, the bundle name is used by default.|
+| process | string | Yes | No | Process in which this ability runs. If this parameter is not set, the bundle name is used by default. |
| targetAbility | string | Yes | No | Target ability that the ability alias points to. |
| backgroundModes | number | Yes | No | Background service mode of the ability. |
| isVisible | boolean | Yes | No | Whether the ability can be called by other applications. |
@@ -1489,7 +1489,7 @@ Describes the ability information.
| type | AbilityType | Yes | No | Ability type. |
| orientation | DisplayOrientation | Yes | No | Ability display orientation. |
| launchMode | LaunchMode | Yes | No | Ability launch mode. |
-| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability.|
+| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability. |
| deviceTypes | Array\ | Yes | No | Device types supported by the ability. |
| deviceCapabilities | Array\ | Yes | No | Device capabilities required for the ability. |
| readPermission | string | Yes | No | Permission required for reading the ability data. |
@@ -1513,7 +1513,7 @@ Enumerates ability types.
| UNKNOWN | None | Unknown ability type. |
| PAGE | None | Ability that has a UI. |
| SERVICE | None | Ability that does not have a UI. |
-| DATA | None | Ability that is used to provide data access services.|
+| DATA | None | Ability that is used to provide data access services. |
## DisplayOrientation
@@ -1526,7 +1526,7 @@ Enumerates display orientations.
| UNSPECIFIED | None | The system automatically determines the display orientation. |
| LANDSCAPE | None | Landscape orientation. |
| PORTRAIT | None | Portrait orientation. |
-| FOLLOW_RECENT | None | The page ability orientation is the same as that of the nearest ability in the stack.|
+| FOLLOW_RECENT | None | The page ability orientation is the same as that of the nearest ability in the stack. |
## LaunchMode
@@ -1536,7 +1536,7 @@ Enumerates launch modes.
| Name | Type | Description |
| --------- | ---- | ------------- |
-| SINGLETON | 0 | The ability has only one instance.|
+| SINGLETON | 0 | The ability has only one instance. |
| STANDARD | 1 | The ability can have multiple instances. |
## AbilitySubType
@@ -1548,7 +1548,7 @@ Enumerates ability subtypes.
| Name | Type | Description |
| ----------- | ---- | -------------------- |
| UNSPECIFIED | 0 | Undefined ability subtype. |
-| CA | 1 | Ability that has a UI.|
+| CA | 1 | Ability that has a UI. |
## ExtensionAbilityType9+
@@ -1560,12 +1560,12 @@ Enumerates Extension ability types.
| Name | Type | Description |
| ------------------------------ | ---- | ------------------------- |
| FORM9+ | 0 | Form included. |
-| WORK_SCHEDULER9+ | 1 | Work scheduler included.|
+| WORK_SCHEDULER9+ | 1 | Work scheduler included. |
| INPUT_METHOD9+ | 2 | Input method included. |
| SERVICE9+ | 3 | Service included. |
| ACCESSIBILITY9+ | 4 | Accessibility included. |
-| DATA_SHARE9+ | 5 | Data sharing included.|
-| FILE_SHARE9+ | 6 | File sharing included.|
+| DATA_SHARE9+ | 5 | Data sharing included. |
+| FILE_SHARE9+ | 6 | File sharing included. |
| STATIC_SUBSCRIBER9+ | 7 | Subscribers included. |
| WALLPAPER9+ | 8 | Wallpaper included. |
| UNSPECIFIED9+ | 9 | Unspecified type. |
@@ -1581,7 +1581,7 @@ Enumerates Extension flags.
| GET_EXTENSION_INFO_DEFAULT9+ | 0x00000000 | Obtains the default Extension ability information. |
| GET_EXTENSION_INFO_WITH_PERMISSION9+ | 0x00000002 | Obtains the Extension ability information that carries permission information. |
| GET_EXTENSION_INFO_WITH_APPLICATION9+ | 0x00000004 | Obtains the Extension ability information that carries application information. |
-| GET_EXTENSION_INFO_WITH_METADATA9+ | 0x00000020 | Obtains the Extension ability information that carries metadata information.|
+| GET_EXTENSION_INFO_WITH_METADATA9+ | 0x00000020 | Obtains the Extension ability information that carries metadata information. |
## ColorMode
@@ -1592,20 +1592,20 @@ Enumerates color modes.
| Name | Type | Description |
| ---------- | ---- | ---- |
-| AUTO_MODE | -1 | Automatic mode.|
-| DARK_MODE | 0 | Dark mode.|
-| LIGHT_MODE | 1 | Light mode.|
+| AUTO_MODE | -1 | Automatic mode. |
+| DARK_MODE | 0 | Dark mode. |
+| LIGHT_MODE | 1 | Light mode. |
## GrantStatus
-Enumerates permission grant statuses.
+Enumerates permission grant states.
**System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type | Description |
| ------------------ | ---- | ---- |
-| PERMISSION_DENIED | -1 | Permission denied.|
+| PERMISSION_DENIED | -1 | Permission denied. |
| PERMISSION_GRANTED | 0 | Permission granted. |
@@ -1625,7 +1625,7 @@ Describes the Extension ability information.
| iconId9+ | number | Yes | No | Icon ID of the Extension ability. |
| isVisible9+ | boolean | Yes | No | Whether the Extension ability can be called by other applications. |
| extensionAbilityType9+ | bundle.ExtensionAbilityType | Yes | No | Type of the Extension ability. |
-| permissions9+ | Array\ | Yes | No | Permissions required for other applications to call the Extension ability.|
+| permissions9+ | Array\ | Yes | No | Permissions required for other applications to call the Extension ability. |
| applicationInfo9+ | ApplicationInfo | Yes | No | Application configuration information. |
| metaData9+ | Array\ | Yes | No | Metadata of the Extension ability. |
| enabled9+ | boolean | Yes | No | Whether the Extension ability is enabled. |
@@ -1641,6 +1641,6 @@ Describes the metadata information.
| Name | Type | Readable | Writable | Description |
| --------------------- | ------ | ---- | ---- | ----- |
-| name9+ | string | Yes | Yes | Metadata name.|
+| name9+ | string | Yes | Yes | Metadata name. |
| value9+ | string | Yes | Yes | Metadata value. |
-| resource9+ | string | Yes | Yes | Metadata resource.|
+| resource9+ | string | Yes | Yes | Metadata resource. |
diff --git a/en/application-dev/reference/apis/js-apis-Context.md b/en/application-dev/reference/apis/js-apis-Context.md
index bc7b0afa88f6e9ee253b8cd8af3a5ba6633ce8b6..62ab1faf7ec09a0323252ce17873d1aca9ba13f1 100644
--- a/en/application-dev/reference/apis/js-apis-Context.md
+++ b/en/application-dev/reference/apis/js-apis-Context.md
@@ -1,6 +1,6 @@
# Context Module
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -30,9 +30,9 @@ If this API is called for the first time, a root directory will be created.
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | -------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the local root directory.|
+| callback | AsyncCallback\ | Yes | Callback used to return the local root directory. |
**Example**
@@ -58,9 +58,9 @@ If this API is called for the first time, a root directory will be created.
**Return value**
-| Type | Description |
+| Type | Description |
| ---------------- | ---------------------- |
-| Promise\ | Promise used to return the local root directory.|
+| Promise\ | Promise used to return the local root directory. |
**Example**
@@ -84,11 +84,11 @@ Verifies whether a specific PID and UID have the given permission. This API uses
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ---------- | --------------------------------------- | ---- | ------------------------------------- |
-| permission | string | Yes | Name of the permission to verify. |
-| options | [PermissionOptions](#permissionoptions) | Yes | Permission options. |
-| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.|
+| permission | string | Yes | Name of the permission to verify. |
+| options | [PermissionOptions](#permissionoptions) | Yes | Permission options. |
+| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission. |
**Example**
@@ -113,10 +113,10 @@ Verifies whether the current PID and UID have the given permission. This API use
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ---------- | ---------------------- | ---- | ------------------------------------- |
-| permission | string | Yes | Name of the permission to verify. |
-| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.|
+| permission | string | Yes | Name of the permission to verify. |
+| callback | AsyncCallback\ | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission. |
**Example**
@@ -136,16 +136,16 @@ Verifies whether a specific PID and UID have the given permission. This API uses
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ---------- | --------------------------------------- | ---- | ---------------- |
-| permission | string | Yes | Name of the permission to verify.|
-| options | [PermissionOptions](#permissionoptions) | No | Permission options. |
+| permission | string | Yes | Name of the permission to verify. |
+| options | [PermissionOptions](#permissionoptions) | No | Permission options. |
**Return value**
-| Type | Description |
+| Type | Description |
| ---------------- | ----------------------------------------------------------- |
-| Promise\ | Promise used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.|
+| Promise\ | Promise used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission. |
**Example**
@@ -171,11 +171,11 @@ Requests certain permissions from the system. This API uses an asynchronous call
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------------- | ------------------------------------------------------------ | ---- | ----------------------------------------------- |
-| permissions | Array\ | Yes | Permissions to request. This parameter cannot be **null**. |
-| requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**.|
-| resultCallback | AsyncCallback<[PermissionRequestResult](#permissionrequestresult)> | Yes | Permission request result. |
+| permissions | Array\ | Yes | Permissions to request. This parameter cannot be **null**. |
+| requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**. |
+| resultCallback | AsyncCallback<[PermissionRequestResult](#permissionrequestresult)> | Yes | Permission request result. |
**Example**
@@ -207,9 +207,9 @@ Obtains information about the current application. This API uses an asynchronous
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ------------------------------- | ---- | ------------------------ |
-| callback | AsyncCallback\ | Yes | Callback used to return the application information.|
+| callback | AsyncCallback\ | Yes | Callback used to return the application information. |
**Example**
@@ -231,9 +231,9 @@ Obtains information about the current application. This API uses a promise to re
**Return value**
-| Type | Description |
+| Type | Description |
| ------------------------- | ------------------ |
-| Promise\ | Promise used to return the application information.|
+| Promise\ | Promise used to return the application information. |
**Example**
@@ -258,9 +258,9 @@ Obtains the bundle name of the current ability. This API uses an asynchronous ca
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ----------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the bundle name.|
+| callback | AsyncCallback\ | Yes | Callback used to return the bundle name. |
**Example**
@@ -282,9 +282,9 @@ Obtains the bundle name of the current ability. This API uses a promise to retur
**Return value**
-| Type | Description |
+| Type | Description |
| ---------------- | ------------------------- |
-| Promise\ | Promise used to return the bundle name.|
+| Promise\ | Promise used to return the bundle name. |
**Example**
@@ -309,9 +309,9 @@ Obtains information about the current process, including the PID and process nam
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | -------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the process information.|
+| callback | AsyncCallback\ | Yes | Callback used to return the process information. |
**Example**
@@ -333,9 +333,9 @@ Obtains information about the current process, including the PID and process nam
**Return value**
-| Type | Description |
+| Type | Description |
| --------------------- | -------------- |
-| Promise\ | Promise used to return the process information.|
+| Promise\ | Promise used to return the process information. |
**Example**
@@ -362,9 +362,9 @@ This API is available only to Page abilities.
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ---------------------------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the **ohos.bundle.ElementName** object.|
+| callback | AsyncCallback\ | Yes | Callback used to return the **ohos.bundle.ElementName** object. |
**Example**
@@ -388,9 +388,9 @@ This API is available only to Page abilities.
**Return value**
-| Type | Description |
+| Type | Description |
| --------------------- | ------------------------------------------ |
-| Promise\ | Promise used to return the **ohos.bundle.ElementName** object.|
+| Promise\ | Promise used to return the **ohos.bundle.ElementName** object. |
**Example**
@@ -413,9 +413,9 @@ Obtains the name of the current process. This API uses an asynchronous callback
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | -------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the process name.|
+| callback | AsyncCallback\ | Yes | Callback used to return the process name. |
**Example**
@@ -437,9 +437,9 @@ Obtains the name of the current process. This API uses a promise to return the r
**Return value**
-| Type | Description |
+| Type | Description |
| ---------------- | -------------------- |
-| Promise\ | Promise used to return the process name.|
+| Promise\ | Promise used to return the process name. |
**Example**
@@ -464,9 +464,9 @@ Obtains the bundle name of the calling ability. This API uses an asynchronous ca
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the bundle name.|
+| callback | AsyncCallback\ | Yes | Callback used to return the bundle name. |
**Example**
@@ -488,9 +488,9 @@ Obtains the bundle name of the calling ability. This API uses a promise to retur
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\ | Promise used to return the bundle name.|
+| Promise\ | Promise used to return the bundle name. |
**Example**
@@ -513,9 +513,9 @@ Obtains the cache directory of the application on the internal storage. This API
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the cache directory.|
+| callback | AsyncCallback\ | Yes | Callback used to return the cache directory. |
**Example**
@@ -541,9 +541,9 @@ Obtains the cache directory of the application on the internal storage. This API
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\ | Promise used to return the cache directory.|
+| Promise\ | Promise used to return the cache directory. |
**Example**
@@ -566,9 +566,9 @@ Obtains the file directory of the application on the internal storage. This API
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the file directory.|
+| callback | AsyncCallback\ | Yes | Callback used to return the file directory. |
**Example**
@@ -594,9 +594,9 @@ Obtains the file directory of the application on the internal storage. This API
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\ | Promise used to return the file directory.|
+| Promise\ | Promise used to return the file directory. |
**Example**
@@ -621,9 +621,9 @@ If the distributed file path does not exist, the system will create one and retu
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the distributed file path. If the distributed file path does not exist, the system will create one and return the created path.|
+| callback | AsyncCallback\ | Yes | Callback used to return the distributed file path. If the distributed file path does not exist, the system will create one and return the created path. |
**Example**
@@ -651,9 +651,9 @@ If the distributed file path does not exist, the system will create one and retu
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\ | Promise used to return the distributed file path. If this API is called for the first time, a new path will be created.|
+| Promise\ | Promise used to return the distributed file path. If this API is called for the first time, a new path will be created. |
**Example**
@@ -675,9 +675,9 @@ Obtains the application type. This API uses an asynchronous callback to return t
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\ | Yes | Callback used to return the application type.|
+| callback | AsyncCallback\ | Yes | Callback used to return the application type. |
**Example**
@@ -703,9 +703,9 @@ Obtains the application type. This API uses a promise to return the result.
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\ | Promise used to return the application type.|
+| Promise\ | Promise used to return the application type. |
**Example**
@@ -727,9 +727,9 @@ Obtains the **ModuleInfo** object of the application. This API uses an asynchron
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object.|
+| callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object. |
**Example**
@@ -755,9 +755,9 @@ Obtains the **ModuleInfo** object of the application. This API uses a promise to
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\<[HapModuleInfo](#hapmoduleinfo)> | Promise used to return the **ModuleInfo** object.|
+| Promise\<[HapModuleInfo](#hapmoduleinfo)> | Promise used to return the **ModuleInfo** object. |
**Example**
@@ -779,9 +779,9 @@ Obtains the version information of the application. This API uses an asynchronou
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\<[AppVersionInfo](#appversioninfo)> | Yes | Callback used to return the version information.|
+| callback | AsyncCallback\<[AppVersionInfo](#appversioninfo)> | Yes | Callback used to return the version information. |
**Example**
@@ -807,9 +807,9 @@ Obtains the version information of the application. This API uses a promise to r
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\<[AppVersionInfo](#appversioninfo)> | Promise used to return the version information.|
+| Promise\<[AppVersionInfo](#appversioninfo)> | Promise used to return the version information. |
**Example**
@@ -831,9 +831,9 @@ Obtains information of the current ability. This API uses an asynchronous callba
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- |
-| callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes |Callback used to return the ability information.|
+| callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes |Callback used to return the ability information. |
**Example**
@@ -859,9 +859,9 @@ Obtains information of the current ability. This API uses a promise to return th
**Return value**
-| Type | Description |
+| Type | Description |
| --------------- | ------------------------- |
-| Promise\<[AbilityInfo](#abilityInfo)> | Promise used to return the ability information.|
+| Promise\<[AbilityInfo](#abilityInfo)> | Promise used to return the ability information. |
**Example**
@@ -883,9 +883,9 @@ Obtains the context of the application.
**Return value**
-| Type | Description |
+| Type | Description |
| --------- |------ |
-| Context |Application context.|
+| Context |Application context. |
**Example**
@@ -898,48 +898,48 @@ var context = featureAbility.getContext().getApplicationContext();
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name| Readable/Writable| Type | Mandatory| Description |
+| Name| Readable/Writable | Type | Mandatory | Description |
| ---- | -------- | ------ | ---- | ------ |
-| pid | Read-only | number | No | Process ID.|
-| uid | Read-only | number | No | User ID.|
+| pid | Read-only | number | No | Process ID. |
+| uid | Read-only | number | No | User ID. |
## PermissionRequestResult7+
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Readable/Writable| Type | Mandatory| Description |
+| Name | Readable/Writable | Type | Mandatory | Description |
| ----------- | -------- | -------------- | ---- | ------------------ |
-| requestCode | Read-only | number | Yes | Request code passed.|
-| permissions | Read-only | Array\ | Yes | Permissions requested. |
-| authResults | Read-only | Array\ | Yes | Permission request result. |
+| requestCode | Read-only | number | Yes | Request code passed. |
+| permissions | Read-only | Array\ | Yes | Permissions requested. |
+| authResults | Read-only | Array\ | Yes | Permission request result. |
## HapModuleInfo7+
Describes the HAP module information.
-| Name | Type| Readable| Writable| Description|
+| Name | Type| Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ |
-| name | string | Yes | No | Module name. |
-| description | string | Yes | No | Module description. |
-| descriptionId | number | Yes | No | Module description ID. |
-| icon | string | Yes | No | Module icon. |
-| label | string | Yes | No | Module label. |
-| labelId | number | Yes | No | Module label ID. |
-| iconId | number | Yes | No | Module icon ID. |
-| backgroundImg | string | Yes | No | Module background image. |
-| supportedModes | number | Yes | No | Modes supported by the module. |
-| reqCapabilities | Array | Yes | No | Capabilities required for module running.|
-| deviceTypes | Array | Yes | No | An array of supported device types.|
-| abilityInfo | Array | Yes | No | Ability information. |
-| moduleName | string | Yes | No | Module name. |
-| mainAbilityName | string | Yes | No | Name of the entrance ability. |
-| installationFree | boolean | Yes | No | When installation-free is supported. |
-| mainElementName | string | Yes| No| Information about the entry ability.|
+| name | string | Yes | No | Module name. |
+| description | string | Yes | No | Module description. |
+| descriptionId | number | Yes | No | Module description ID. |
+| icon | string | Yes | No | Module icon. |
+| label | string | Yes | No | Module label. |
+| labelId | number | Yes | No | Module label ID. |
+| iconId | number | Yes | No | Module icon ID. |
+| backgroundImg | string | Yes | No | Module background image. |
+| supportedModes | number | Yes | No | Modes supported by the module. |
+| reqCapabilities | Array | Yes | No | Capabilities required for module running. |
+| deviceTypes | Array | Yes | No | An array of supported device types. |
+| abilityInfo | Array | Yes | No | Ability information. |
+| moduleName | string | Yes | No | Module name. |
+| mainAbilityName | string | Yes | No | Name of the entrance ability. |
+| installationFree | boolean | Yes | No | When installation-free is supported. |
+| mainElementName | string | Yes| No| Information about the entry ability. |
## AppVersionInfo7+
-| Name | Type| Readable | Writable | Description|
-| ------ | ------ | ------| ------ | ------ |
-| appName | string | Yes | No | Module name. |
-| versionCode | number | Yes | No | Module description. |
-| versionName | string | Yes | No | Module description ID. |
+| Name | Type| Readable | Writable | Description |
+| ------ | ------ | ------| ------ | ------ |
+| appName | string | Yes | No | Module name. |
+| versionCode | number | Yes | No | Module description. |
+| versionName | string | Yes | No | Module description ID. |
diff --git a/en/application-dev/reference/apis/js-apis-DataUriUtils.md b/en/application-dev/reference/apis/js-apis-DataUriUtils.md
index 267ba0d27b3fbf9e3b35a8dbb884da04286f5729..1434ebb8d645af7ae531374769b8534bd5de0910 100644
--- a/en/application-dev/reference/apis/js-apis-DataUriUtils.md
+++ b/en/application-dev/reference/apis/js-apis-DataUriUtils.md
@@ -1,6 +1,6 @@
# DataUriUtils Module
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -19,15 +19,15 @@ Obtains the ID attached to the end of a given URI.
**Parameters**
-| Name| Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | --------------------------- |
-| uri | string | Yes | URI object from which the ID is to be obtained.|
+| uri | string | Yes | URI object from which the ID is to be obtained. |
**Return value**
-| Type | Description |
+| Type | Description |
| ------ | ------------------------ |
-| number | ID obtained from the URI object.|
+| number | ID obtained from the URI object. |
**Example**
@@ -47,16 +47,16 @@ Attaches an ID to the end of a given URI.
**Parameters**
-| Name| Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | --------------------------- |
-| uri | string | Yes | URI object to which an ID is to be attached.|
-| id | number | Yes | ID to be attached. |
+| uri | string | Yes | URI object to which an ID is to be attached. |
+| id | number | Yes | ID to be attached. |
**Return value**
-| Type | Description |
+| Type | Description |
| ------ | --------------------- |
-| string | URI object with the ID attached.|
+| string | URI object with the ID attached. |
**Example**
@@ -80,15 +80,15 @@ Deletes the ID from the end of a given URI.
**Parameters**
-| Name| Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | --------------------------- |
-| uri | string | Yes | URI object from which the ID is to be deleted.|
+| uri | string | Yes | URI object from which the ID is to be deleted. |
**Return value**
-| Type | Description |
+| Type | Description |
| ------ | ------------------- |
-| string | URI object with the ID deleted.|
+| string | URI object with the ID deleted. |
**Example**
@@ -108,16 +108,16 @@ Updates the ID in a given URI.
**Parameters**
-| Name| Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------------------- |
-| uri | string | Yes | URI object to be updated.|
-| id | number | Yes | New ID. |
+| uri | string | Yes | URI object to be updated. |
+| id | number | Yes | New ID. |
**Return value**
-| Type | Description |
+| Type | Description |
| ------ | --------------- |
-| string | URI object with the new ID.|
+| string | URI object with the new ID. |
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md b/en/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md
index 9db4123736ac6f7a03605c931713076e13f7d2c6..59f2b5f535283e04d6f1b499ee4e9e733f204da8 100644
--- a/en/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md
+++ b/en/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md
@@ -1,6 +1,6 @@
# Work Scheduler Callbacks
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. API version 9 is a canary version for trial use. The APIs of this version may be unstable.
@@ -20,9 +20,9 @@ Triggered when the Work Scheduler task starts.
**Parameters**
-| Name | Type | Mandatory | Description |
+| Name | Type | Mandatory | Description |
| ---- | --------------------- | ---- | -------------- |
-| work | [workScheduler.WorkInfo](js-apis-workScheduler.md#workinfo) | Yes | Task to be added to the execution queue.|
+| work | [workScheduler.WorkInfo](js-apis-workScheduler.md#workinfo) | Yes | Task to be added to the execution queue.|
**Example**
@@ -44,9 +44,9 @@ Triggered when the Work Scheduler task stops.
**Parameters**
-| Name | Type | Mandatory | Description |
+| Name | Type | Mandatory | Description |
| ---- | --------------------- | ---- | -------------- |
-| work | [workScheduler.WorkInfo](js-apis-workScheduler.md#workinfo) | Yes | Task to be added to the execution queue.|
+| work | [workScheduler.WorkInfo](js-apis-workScheduler.md#workinfo) | Yes | Task to be added to the execution queue.|
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-ability-context.md b/en/application-dev/reference/apis/js-apis-ability-context.md
index efab6fdd1273d247e6b95c5c5f6bc422abfcef96..b938552925150af55ec98375d48af7d9c4a78e54 100644
--- a/en/application-dev/reference/apis/js-apis-ability-context.md
+++ b/en/application-dev/reference/apis/js-apis-ability-context.md
@@ -1,6 +1,6 @@
# AbilityContext
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -28,7 +28,7 @@ class MainAbility extends Ability {
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name| Type| Readable| Writable| Description|
+| Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- |
| abilityInfo | AbilityInfo | Yes| No| Ability information.|
| currentHapModuleInfo | HapModuleInfo | Yes| No| Information about the current HAP.|
@@ -44,7 +44,7 @@ Starts an ability. This API uses a callback to return the result.
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
@@ -73,7 +73,7 @@ Starts an ability. This API uses a callback to return the result.
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | Yes| Parameters used for starting the ability.|
@@ -106,14 +106,14 @@ Starts an ability. This API uses a promise to return the result.
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | No| Parameters used for starting the ability.|
**Return value**
- | Type| Description|
+ | Type | Description |
| -------- | -------- |
| Promise<void> | Promise used to return the result.|
@@ -147,7 +147,7 @@ Starts an ability. This API uses a callback to return the execution result when
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| want |[Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| callback | AsyncCallback<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | Yes| Callback used to return the result.|
@@ -175,7 +175,7 @@ Starts an ability. This API uses a callback to return the execution result when
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| want |[Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | Yes| Parameters used for starting the ability.|
@@ -208,7 +208,7 @@ Starts an ability. This API uses a promise to return the execution result when t
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | No| Parameters used for starting the ability.|
@@ -216,7 +216,7 @@ Starts an ability. This API uses a promise to return the execution result when t
**Return value**
- | Type| Description|
+ | Type | Description |
| -------- | -------- |
| Promise<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | Promise used to return the result.|
@@ -244,7 +244,7 @@ Terminates this ability. This API uses a callback to return the result.
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<void> | Yes| Callback used to return the result indicating whether the API is successfully called.|
@@ -267,7 +267,7 @@ Terminates this ability. This API uses a promise to return the result.
**Return value**
- | Type| Description|
+ | Type | Description |
| -------- | -------- |
| Promise<void> | Promise used to return the result indicating whether the API is successfully called.|
@@ -292,7 +292,7 @@ Terminates this ability. This API uses a callback to return the information to t
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | Yes| Information returned to the caller.|
| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
@@ -321,13 +321,13 @@ Terminates this ability. This API uses a promise to return information to the ca
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | Yes| Information returned to the caller.|
**Return value**
- | Type| Description|
+ | Type | Description |
| -------- | -------- |
| Promise<void> | Promise used to return the result.|
@@ -355,13 +355,13 @@ Obtains the caller interface of the specified ability, and if the specified abil
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the ability to start, including the ability name, bundle name, and device ID. If the device ID is left blank or the default value is used, the local ability will be started.|
**Return value**
- | Type| Description|
+ | Type | Description |
| -------- | -------- |
| Promise<Caller> | Promise used to return the caller object to communicate with.|
@@ -397,7 +397,7 @@ Requests permissions from the user by displaying a pop-up window. This API uses
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| permissions | Array<string> | Yes| Permissions to request.|
| callback | AsyncCallback<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | Yes| Callback used to return the result indicating whether the API is successfully called.|
@@ -421,13 +421,13 @@ Requests permissions from the user by displaying a pop-up window. This API uses
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| permissions | Array<string> | Yes| Permissions to request.|
**Return value**
- | Type| Description|
+ | Type | Description |
| -------- | -------- |
| Promise<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | Promise used to return the result indicating whether the API is successfully called.|
@@ -452,7 +452,7 @@ Sets the label of the ability displayed in the task. This API uses a callback to
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| label | string | Yes| Label of the ability to set.|
| callback | AsyncCallback<void> | Yes| Callback used to return the result indicating whether the API is successfully called.|
@@ -476,13 +476,13 @@ Sets the label of the ability displayed in the task. This API uses a promise to
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| label | string | Yes| Label of the ability to set.|
**Return value**
- | Type| Description|
+ | Type | Description |
| -------- | -------- |
| Promise<void> | Promise used to return the result indicating whether the API is successfully called.|
diff --git a/en/application-dev/reference/apis/js-apis-ability-errorCode.md b/en/application-dev/reference/apis/js-apis-ability-errorCode.md
index e81e9d60f6bcf0d1b5f0376057f577c2b467f45d..d882c9b5ce0870438d9372a8470efcf5c5dad5b8 100644
--- a/en/application-dev/reference/apis/js-apis-ability-errorCode.md
+++ b/en/application-dev/reference/apis/js-apis-ability-errorCode.md
@@ -1,7 +1,7 @@
# ErrorCode
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -17,9 +17,9 @@ Defines the error code used when the ability is started.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Value | Description |
+| Name | Value | Description |
| ------------------------------ | ---- | ---------------------------------------- |
-| NO_ERROR | 0 | No error occurs. |
-| INVALID_PARAMETER | -1 | Invalid parameter.|
-| ABILITY_NOT_FOUND | -2 | The ability is not found.|
-| PERMISSION_DENY | -3 | Permission denied. |
+| NO_ERROR | 0 | No error occurs. |
+| INVALID_PARAMETER | -1 | Invalid parameter. |
+| ABILITY_NOT_FOUND | -2 | The ability is not found. |
+| PERMISSION_DENY | -3 | Permission denied. |
diff --git a/en/application-dev/reference/apis/js-apis-ability-wantConstant.md b/en/application-dev/reference/apis/js-apis-ability-wantConstant.md
index ef6e3e60018a4124ef5d917217599b520d550fe1..1190acad72e203ec1d42e7f2c4979938156bad50 100644
--- a/en/application-dev/reference/apis/js-apis-ability-wantConstant.md
+++ b/en/application-dev/reference/apis/js-apis-ability-wantConstant.md
@@ -1,7 +1,7 @@
# wantConstant
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -20,32 +20,32 @@ Lists the permissions.
| Common Event Macro | Common Event Name | Subscriber Permission |
| ------------ | ------------------ | ---------------------- |
-| ACTION_HOME | ohos.want.action.home | None |
-| ACTION_DIAL | ohos.want.action.dial | None |
-| ACTION_SEARCH | ohos.want.action.search | None |
-| ACTION_WIRELESS_SETTINGS | ohos.settings.wireless | None |
-| ACTION_MANAGE_APPLICATIONS_SETTINGS | ohos.settings.manage.applications | None |
-| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | None |
-| ACTION_SET_ALARM | ohos.want.action.setAlarm | None |
-| ACTION_SHOW_ALARMS | ohos.want.action.showAlarms | None |
-| ACTION_SNOOZE_ALARM | ohos.want.action.snoozeAlarm | None |
-| ACTION_DISMISS_ALARM | ohos.want.action.dismissAlarm | None |
-| ACTION_DISMISS_TIMER | ohos.want.action.dismissTimer | None |
-| ACTION_SEND_SMS | ohos.want.action.sendSms | None |
-| ACTION_CHOOSE | ohos.want.action.choose | None |
-| ACTION_IMAGE_CAPTURE8+ | ohos.want.action.imageCapture | None |
-| ACTION_VIDEO_CAPTUR8+ | ohos.want.action.videoCapture | None |
-| ACTION_SELECT | ohos.want.action.select | None |
-| ACTION_SEND_DATA | ohos.want.action.sendData | None |
-| ACTION_SEND_MULTIPLE_DATA | ohos.want.action.sendMultipleData | None |
-| ACTION_SCAN_MEDIA_FILE | ohos.want.action.scanMediaFile | None |
-| ACTION_VIEW_DATA | ohos.want.action.viewData | None |
-| ACTION_EDIT_DATA | ohos.want.action.editData | None |
-| INTENT_PARAMS_INTENT | ability.want.params.INTENT | None |
-| INTENT_PARAMS_TITLE | ability.want.params.TITLE | None |
-| ACTION_FILE_SELECT7+ | ohos.action.fileSelect | None |
-| PARAMS_STREAM7+ | ability.params.stream | None |
-| ACTION_APP_ACCOUNT_OAUTH 8+ | ohos.account.appAccount.action.oauth | None |
+| ACTION_HOME | ohos.want.action.home | None |
+| ACTION_DIAL | ohos.want.action.dial | None |
+| ACTION_SEARCH | ohos.want.action.search | None |
+| ACTION_WIRELESS_SETTINGS | ohos.settings.wireless | None |
+| ACTION_MANAGE_APPLICATIONS_SETTINGS | ohos.settings.manage.applications | None |
+| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | None |
+| ACTION_SET_ALARM | ohos.want.action.setAlarm | None |
+| ACTION_SHOW_ALARMS | ohos.want.action.showAlarms | None |
+| ACTION_SNOOZE_ALARM | ohos.want.action.snoozeAlarm | None |
+| ACTION_DISMISS_ALARM | ohos.want.action.dismissAlarm | None |
+| ACTION_DISMISS_TIMER | ohos.want.action.dismissTimer | None |
+| ACTION_SEND_SMS | ohos.want.action.sendSms | None |
+| ACTION_CHOOSE | ohos.want.action.choose | None |
+| ACTION_IMAGE_CAPTURE8+ | ohos.want.action.imageCapture | None |
+| ACTION_VIDEO_CAPTUR8+ | ohos.want.action.videoCapture | None |
+| ACTION_SELECT | ohos.want.action.select | None |
+| ACTION_SEND_DATA | ohos.want.action.sendData | None |
+| ACTION_SEND_MULTIPLE_DATA | ohos.want.action.sendMultipleData | None |
+| ACTION_SCAN_MEDIA_FILE | ohos.want.action.scanMediaFile | None |
+| ACTION_VIEW_DATA | ohos.want.action.viewData | None |
+| ACTION_EDIT_DATA | ohos.want.action.editData | None |
+| INTENT_PARAMS_INTENT | ability.want.params.INTENT | None |
+| INTENT_PARAMS_TITLE | ability.want.params.TITLE | None |
+| ACTION_FILE_SELECT7+ | ohos.action.fileSelect | None |
+| PARAMS_STREAM7+ | ability.params.stream | None |
+| ACTION_APP_ACCOUNT_OAUTH 8+ | ohos.account.appAccount.action.oauth | None |
## wantConstant.Entity
@@ -56,12 +56,12 @@ Lists the permissions.
| Common Event Macro | Common Event Name | Subscriber Permission |
| ------------ | ------------------ | ---------------------- |
-| ENTITY_DEFAULT | entity.system.default | None |
-| ENTITY_HOME | entity.system.homel | None |
-| ENTITY_VOICE | ENTITY_VOICE | None |
-| ENTITY_BROWSABLE | entity.system.browsable | None |
-| ENTITY_VIDEO | entity.system.video | None |
-| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | None |
+| ENTITY_DEFAULT | entity.system.default | None |
+| ENTITY_HOME | entity.system.homel | None |
+| ENTITY_VOICE | ENTITY_VOICE | None |
+| ENTITY_BROWSABLE | entity.system.browsable | None |
+| ENTITY_VIDEO | entity.system.video | None |
+| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | None |
## flags
@@ -70,19 +70,19 @@ Lists the permissions.
| Name | Value | Description |
| ------------------------------------ | ---------- | ------------------------------------------------------------ |
-| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | Indicates the permission to read the URI. |
-| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | Indicates the permission to write the URI. |
-| FLAG_ABILITY_FORWARD_RESULT | 0x00000004 | Returns the result to the ability. |
-| FLAG_ABILITY_CONTINUATION | 0x00000008 | Indicates whether the ability on the local device can be continued on a remote device. |
-| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | Indicates that a component does not belong to OHOS. |
-| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | Indicates that an ability is enabled. |
-| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | Indicates the permission to make the URI persistent. |
-| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | Indicates the permission to verify URIs by prefix matching. |
-| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | Supports cross-device startup in a distributed scheduler. |
-| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | Indicates that the Service ability is started regardless of whether the host application has been started. |
-| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that ability continuation is reversible. |
-| FLAG_INSTALL_ON_DEMAND | 0x00000800 | Indicates that the specific ability will be installed if it has not been installed. |
-| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | Indicates that the specific ability will be installed in the background if it has not been installed. |
-| FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | Clears other operation missions. This flag can be set for the **Want** object in the **startAbility** API passed to [ohos.app.Context](js-apis-ability-context.md) and must be used together with **flag_ABILITY_NEW_MISSION**.|
-| FLAG_ABILITY_NEW_MISSION | 0x10000000 | Indicates the operation of creating a mission on the history mission stack. |
-| FLAG_ABILITY_MISSION_TOP | 0x20000000 | Starts the mission on the top of the existing mission stack; creates an ability instance if no mission exists.|
+| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | Indicates the permission to read the URI. |
+| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | Indicates the permission to write the URI. |
+| FLAG_ABILITY_FORWARD_RESULT | 0x00000004 | Returns the result to the ability. |
+| FLAG_ABILITY_CONTINUATION | 0x00000008 | Indicates whether the ability on the local device can be continued on a remote device. |
+| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | Indicates that a component does not belong to OHOS. |
+| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | Indicates that an ability is enabled. |
+| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | Indicates the permission to make the URI persistent. |
+| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | Indicates the permission to verify URIs by prefix matching. |
+| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | Supports cross-device startup in a distributed scheduler.|
+| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | Indicates that the Service ability is started regardless of whether the host application has been started. |
+| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that ability continuation is reversible. |
+| FLAG_INSTALL_ON_DEMAND | 0x00000800 | Indicates that the specific ability will be installed if it has not been installed. |
+| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | Indicates that the specific ability will be installed in the background if it has not been installed. |
+| FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | Clears other operation missions. This flag can be set for the **Want** object in the **startAbility** API passed to [ohos.app.Context](js-apis-ability-context.md) and must be used together with **flag_ABILITY_NEW_MISSION**. |
+| FLAG_ABILITY_NEW_MISSION | 0x10000000 | Indicates the operation of creating a mission on the history mission stack. |
+| FLAG_ABILITY_MISSION_TOP | 0x20000000 | Starts the mission on the top of the existing mission stack; creates an ability instance if no mission exists. |
diff --git a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
index 874341bd76311b8d5efeb676e256813dc926e58e..19a4ec0d9226f01e4a695bf5b9bb60369562a8ed 100644
--- a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
+++ b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
@@ -1,6 +1,6 @@
-# Ability Access Control
+# Ability Access Control
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -20,9 +20,9 @@ Creates an **AtManager** instance, which is used for ability access control.
**Return value**
-| Type| Description|
-| -------- | -------- |
-| [AtManager](#atmanager) | **AtManager** instance obtained.|
+ | Type | Description |
+ | -------- | -------- |
+ | [AtManager](#atmanager) | **AtManager** instance obtained. |
**Example**
@@ -44,16 +44,16 @@ Checks whether an application has been granted the specified permission. This AP
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------- | ---- | ------------------------------------------ |
-| tokenID | number | Yes | ID of the application. |
-| permissionName | string | Yes | Name of the permission to verify.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------------------- | ---- | ------------------------------------------ |
+ | tokenID | number | Yes | ID of the application. |
+ | permissionName | string | Yes | Name of the permission to verify. |
**Return value**
-| Type | Description |
-| :------------ | :---------------------------------- |
-| Promise<GrantStatus> | Promise instance used to return the result.|
+ | Type | Description |
+ | :------------ | :---------------------------------- |
+ | Promise<GrantStatus> | Promise used to return the result. |
**Example**
@@ -78,17 +78,17 @@ Grants a user granted permission to an application. This API uses a promise to r
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ------------------- | ---- | ------------------------------------------------------------ |
-| tokenID | number | Yes | ID of the application. |
-| permissionName | string | Yes | Name of the permission to grant.|
-| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
+ | Name | Type | Mandatory | Description |
+ | --------- | ------------------- | ---- | ------------------------------------------------------------ |
+ | tokenID | number | Yes | ID of the application. |
+ | permissionName | string | Yes | Name of the permission to grant. |
+ | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
**Return value**
-| Type | Description |
-| :------------ | :---------------------------------- |
-| Promise<number> | Promise instance used to return the result.|
+ | Type | Description |
+ | :------------ | :---------------------------------- |
+ | Promise<number> | Promise used to return the result. |
**Example**
@@ -115,12 +115,12 @@ Grants a user granted permission to an application. This API uses an asynchronou
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ------------------- | ---- | ------------------------------------------------------------ |
-| tokenID | number | Yes | ID of the application. |
-| permissionName | string | Yes | Name of the permission to grant.|
-| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
-| callback | AsyncCallback<number> | Yes| Callback used to return the result.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ------------------- | ---- | ------------------------------------------------------------ |
+ | tokenID | number | Yes | ID of the application. |
+ | permissionName | string | Yes | Name of the permission to grant. |
+ | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
+ | callback | AsyncCallback<number> | Yes | Callback used to return the result. |
**Example**
@@ -145,17 +145,17 @@ Revokes a user granted permission given to an application. This API uses a promi
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ------------------- | ---- | ------------------------------------------------------------ |
-| tokenID | number | Yes | ID of the application. |
-| permissionName | string | Yes | Name of the permission to revoke.|
-| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
+ | Name | Type | Mandatory | Description |
+ | --------- | ------------------- | ---- | ------------------------------------------------------------ |
+ | tokenID | number | Yes | ID of the application. |
+ | permissionName | string | Yes | Name of the permission to revoke. |
+ | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
**Return value**
-| Type | Description |
-| :------------ | :---------------------------------- |
-| Promise<number> | Promise instance used to return the result.|
+ | Type | Description |
+ | :------------ | :---------------------------------- |
+ | Promise<number> | Promise used to return the result. |
**Example**
@@ -181,12 +181,12 @@ Revokes a user granted permission given to an application. This API uses an asyn
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ------------------- | ---- | ------------------------------------------------------------ |
-| tokenID | number | Yes | ID of the application. |
-| permissionName | string | Yes | Name of the permission to revoke.|
-| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
-| callback | AsyncCallback<number> | Yes| Callback used to return the result.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ------------------- | ---- | ------------------------------------------------------------ |
+ | tokenID | number | Yes | ID of the application. |
+ | permissionName | string | Yes | Name of the permission to revoke. |
+ | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
+ | callback | AsyncCallback<number> | Yes | Callback used to return the result. |
**Example**
@@ -210,16 +210,16 @@ Obtains the flags of the specified permission of a given application. This API u
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ------------------- | ---- | ------------------------------------------------------------ |
-| tokenID | number | Yes | ID of the application. |
-| permissionName | string | Yes | Name of the permission to query.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ------------------- | ---- | ------------------------------------------------------------ |
+ | tokenID | number | Yes | ID of the application. |
+ | permissionName | string | Yes | Name of the permission to query. |
**Return value**
-| Type | Description |
-| :------------ | :---------------------------------- |
-| Promise<number> | Promise instance used to return the result.|
+ | Type | Description |
+ | :------------ | :---------------------------------- |
+ | Promise<number> | Promise used to return the result. |
**Example**
@@ -238,7 +238,7 @@ Enumerates the permission grant states.
**System capability**: SystemCapability.Security.AccessToken
-| Name | Default Value | Description |
-| ----------------------------- | ---------------------- | ----------------------- |
-| PERMISSION_DENIED | -1 | Permission denied. |
-| PERMISSION_GRANTED | 0 | Permission granted. |
+ | Name | Default Value | Description |
+ | ----------------------------- | ---------------------- | ----------------------- |
+ | PERMISSION_DENIED | -1 | Permission denied. |
+ | PERMISSION_GRANTED | 0 | Permission granted. |
diff --git a/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md b/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md
index 5f772d8706f2872fbea97c59e42f7dfd878575df..65769dc7a2fbe62443957c415ca5c095e9473d52 100644
--- a/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md
+++ b/en/application-dev/reference/apis/js-apis-abilityDelegatorRegistry.md
@@ -1,7 +1,6 @@
# AbilityDelegatorRegistry
-> **NOTE**
->
+> **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -18,13 +17,13 @@ Enumerates the ability lifecycle states.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Value | Description |
-| ------------- | ---- | --------------------------- |
-| UNINITIALIZED | 0 | The ability is in an invalid state. |
-| CREATE | 1 | The ability is created.|
-| FOREGROUND | 2 | The ability is running in the foreground. |
-| BACKGROUND | 3 | The ability is running in the background. |
-| DESTROY | 4 | The ability is destroyed.|
+ | Name | Value | Description |
+ | ------------- | ---- | --------------------------- |
+ | UNINITIALIZED | 0 | The ability is in an invalid state. |
+ | CREATE | 1 | The ability is created. |
+ | FOREGROUND | 2 | The ability is running in the foreground. |
+ | BACKGROUND | 3 | The ability is running in the background. |
+ | DESTROY | 4 | The ability is destroyed. |
@@ -38,9 +37,9 @@ Obtains the **AbilityDelegator** object of the application.
**Return value**
-| Type | Description |
-| ------------------------------------------------------------ | ------------------------------------------------------------ |
-| [AbilityDelegator](js-apis-application-abilityDelegator.md#AbilityDelegator) | [AbilityDelegator](js-apis-application-abilityDelegator.md#AbilityDelegator) object, which can be used to schedule functions related to the test framework.|
+ | Type | Description |
+ | ------------------------------------------------------------ | ------------------------------------------------------------ |
+ | [AbilityDelegator](js-apis-application-abilityDelegator.md#AbilityDelegator) | [AbilityDelegator](js-apis-application-abilityDelegator.md#AbilityDelegator) object, which can be used to schedule functions related to the test framework. |
**Example**
@@ -62,9 +61,9 @@ Obtains the **AbilityDelegatorArgs** object of the application.
**Return value**
-| Type | Description |
-| ------------------------------------------------------------ | ------------------------------------------------------------ |
-| [AbilityDelegatorArgs](js-apis-application-abilityDelegatorArgs.md#AbilityDelegatorArgs) | [AbilityDelegatorArgs](js-apis-application-abilityDelegatorArgs.md#AbilityDelegatorArgs) object, which can be used to obtain test parameters.|
+ | Type | Description |
+ | ------------------------------------------------------------ | ------------------------------------------------------------ |
+ | [AbilityDelegatorArgs](js-apis-application-abilityDelegatorArgs.md#AbilityDelegatorArgs) | [AbilityDelegatorArgs](js-apis-application-abilityDelegatorArgs.md#AbilityDelegatorArgs) object, which can be used to obtain test parameters. |
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md b/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md
index b4f137e8d3f3da19beb7a1b5a8bbbc8a4ab74ee3..b516987cb8fd30b49f1aa2152b1024feb3a81b15 100644
--- a/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md
+++ b/en/application-dev/reference/apis/js-apis-abilityrunninginfo.md
@@ -1,6 +1,6 @@
# AbilityRunningInfo
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -25,14 +25,14 @@ abilitymanager.getAbilityRunningInfos((err,data) => {
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| ability | ElementName | Yes| No| Information that matches an ability. |
-| pid | number | Yes| No| Process ID.|
-| uid | number | Yes| No| User ID. |
-| processName | string | Yes| No| Process name. |
-| startTime | number | Yes| No| Ability start time. |
-| abilityState | [abilityManager.AbilityState](#abilitymanagerabilitystate) | Yes| No| Ability state. |
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | ability | ElementName | Yes | No | Information that matches an ability. |
+ | pid | number | Yes | No | Process ID. |
+ | uid | number | Yes | No | User ID. |
+ | processName | string | Yes | No | Process name. |
+ | startTime | number | Yes | No | Ability start time. |
+ | abilityState | [abilityManager.AbilityState](#abilitymanagerabilitystate) | Yes | No | Ability state. |
## abilityManager.AbilityState
@@ -41,10 +41,10 @@ Enumerates the ability states.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name| Value| Description|
-| -------- | -------- | -------- |
-| INITIAL | 0 | The ability is in the initial state.|
-| FOREGROUND | 9 | The ability is in the foreground state. |
-| BACKGROUND | 10 | The ability is in the background state. |
-| FOREGROUNDING | 11 | The ability is in the foregrounding state. |
-| BACKGROUNDING | 12 | The ability is in the backgrounding state. |
+ | Name | Value | Description |
+ | -------- | -------- | -------- |
+ | INITIAL | 0 | The ability is in the initial state. |
+ | FOREGROUND | 9 | The ability is in the foreground state. |
+ | BACKGROUND | 10 | The ability is in the background state. |
+ | FOREGROUNDING | 11 | The ability is in the foregrounding state. |
+ | BACKGROUNDING | 12 | The ability is in the backgrounding state. |
diff --git a/en/application-dev/reference/apis/js-apis-abilitystagecontext.md b/en/application-dev/reference/apis/js-apis-abilitystagecontext.md
index f5d9e951461c0ff77ac85e75bd60c6d657074a66..b2d4b885de5f85efcda7f0f5d8f4b9031d027bbd 100644
--- a/en/application-dev/reference/apis/js-apis-abilitystagecontext.md
+++ b/en/application-dev/reference/apis/js-apis-abilitystagecontext.md
@@ -1,6 +1,6 @@
# AbilityStageContext
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -28,7 +28,7 @@ class MyAbilityStage extends AbilityStage {
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name| Type| Readable| Writable| Description|
+| Name| Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- |
-| currentHapModuleInfo | HapModuleInfo | Yes| No| **ModuleInfo** object corresponding to the **AbilityStage**.|
-| config | [Configuration](js-apis-configuration.md) | Yes| No| Configuration for the environment where the application is running.|
+| currentHapModuleInfo | HapModuleInfo | Yes | No | **ModuleInfo** object corresponding to the **AbilityStage**. |
+| config | [Configuration](js-apis-configuration.md) | Yes| No| Configuration for the environment where the application is running. |
diff --git a/en/application-dev/reference/apis/js-apis-accessibility.md b/en/application-dev/reference/apis/js-apis-accessibility.md
index c39e6e8f9437e64b3f05f59986ec08d35170eb71..17ef631d0f7207b676177a59d0903cc77dcd1045 100644
--- a/en/application-dev/reference/apis/js-apis-accessibility.md
+++ b/en/application-dev/reference/apis/js-apis-accessibility.md
@@ -1,6 +1,6 @@
# Accessibility
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -15,11 +15,11 @@ Enumerates the states of an accessibility application.
**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| enable | The accessibility application is enabled.|
-| disable | The accessibility application is disabled.|
-| install | The accessibility application has been installed.|
+ | Name | Description |
+ | -------- | -------- |
+ | enable | The accessibility application is enabled. |
+ | disable | The accessibility application is disabled. |
+ | install | The accessibility application has been installed. |
## AbilityType
@@ -27,13 +27,13 @@ Enumerates the types of accessibility applications.
**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| audible | The accessibility application provides audible feedback.|
-| generic | The accessibility application provides generic feedback.|
-| haptic | The accessibility application provides haptic feedback.|
-| spoken | The accessibility application provides spoken feedback.|
-| visual | The accessibility application provides visual feedback.|
+ | Name | Description |
+ | -------- | -------- |
+ | audible | The accessibility application provides audible feedback. |
+ | generic | The accessibility application provides generic feedback. |
+ | haptic | The accessibility application provides haptic feedback. |
+ | spoken | The accessibility application provides spoken feedback. |
+ | visual | The accessibility application provides visual feedback. |
## AccessibilityAbilityInfo
@@ -43,15 +43,15 @@ Provides information about an accessibility application.
### Attributes
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| id | number | Yes| No| Ability ID.|
-| name | string | Yes| No| Ability name.|
-| bundleName | string | Yes| No| Bundle name.|
-| abilityTypes | Array<[AbilityType](#abilitytype)> | Yes| No| Accessibility application type.|
-| capabilities | Array<[Capability](#capability)> | Yes| No| Capabilities list of the accessibility application.|
-| description | string | Yes| No| Description of the accessibility application.|
-| eventTypes | Array<[EventType](#eventtype)> | Yes| No| List of events that the accessibility application focuses on.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | id | number | Yes | No | Ability ID. |
+ | name | string | Yes | No | Ability name. |
+ | bundleName | string | Yes | No | Bundle name. |
+ | abilityTypes | Array<[AbilityType](#abilitytype)> | Yes | No | Accessibility application type. |
+ | capabilities | Array<[Capability](#capability)> | Yes | No | Capabilities list of the accessibility application. |
+ | description | string | Yes | No | Description of the accessibility application. |
+ | eventTypes | Array<[EventType](#eventtype)> | Yes | No | List of events that the accessibility application focuses on. |
## Action
@@ -59,24 +59,24 @@ Describes the target action supported by an accessibility application.
**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| click | Clicking.|
-| longClick | Long pressing.|
-| scrollForward | Scrolling forward.|
-| scrollBackward | Scrolling backward.|
-| focus | Obtaining focus.|
-| clearFocus | Clearing focus.|
-| clearSelection | Clearing selection.|
-| accessibilityFocus | Obtaining the accessibility focus.|
-| clearAccessibilityFocus | Clearing the accessibility focus.|
-| cut | Cut.|
-| copy | Copy.|
-| paste | Paste.|
-| select | Select.|
-| setText | Setting the text.|
-| delete | Delete.|
-| setSelection | Setting the selection.|
+ | Name | Description |
+ | -------- | -------- |
+ | click | Clicking. |
+ | longClick | Long pressing. |
+ | scrollForward | Scrolling forward. |
+ | scrollBackward | Scrolling backward. |
+ | focus | Obtaining focus. |
+ | clearFocus | Clearing focus. |
+ | clearSelection | Clearing selection. |
+ | accessibilityFocus | Obtaining the accessibility focus. |
+ | clearAccessibilityFocus | Clearing the accessibility focus. |
+ | cut | Cut. |
+ | copy | Copy. |
+ | paste | Paste. |
+ | select | Select. |
+ | setText | Setting the text. |
+ | delete | Delete. |
+ | setSelection | Setting the selection. |
## Capability
@@ -84,13 +84,13 @@ Enumerates the capabilities of an auxiliary application.
**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| retrieve | Capability to retrieve the window content.|
-| touchGuide | Capability of touch guide mode.|
-| keyEventObserver | Capability to filter key events.|
-| zoom | Capability to control the display zoom level.|
-| gesture | Capability to perform gesture actions.|
+ | Name | Description |
+ | -------- | -------- |
+ | retrieve | Capability to retrieve the window content. |
+ | touchGuide | Capability of touch guide mode. |
+ | keyEventObserver | Capability to filter key events. |
+ | zoom | Capability to control the display zoom level. |
+ | gesture | Capability to perform gesture actions. |
## CaptionsFontEdgeType8+
@@ -98,13 +98,13 @@ Enumerates the caption font edge type.
**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
-| Name| Description|
-| -------- | -------- |
-| none | No effect.|
-| raised | Raised effect.|
-| depressed | Depressed effect.|
-| uniform | Uniform effect.|
-| dropShadow | Drop shadow effect.|
+ | Name | Description |
+ | -------- | -------- |
+ | none | No effect. |
+ | raised | Raised effect. |
+ | depressed | Depressed effect. |
+ | uniform | Uniform effect. |
+ | dropShadow | Drop shadow effect. |
## CaptionsFontFamily8+
@@ -112,16 +112,16 @@ Enumerates the caption font families.
**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
-| Name| Description|
-| -------- | -------- |
-| default | Default font family.|
-| monospacedSerif | Monospaced Serif fonts, which use the same width for each character.|
-| serif | Serif fonts.|
-| monospacedSansSerif | Monospaced Sans Serif fonts, which use the same width for each character.|
-| sansSerif | Sans Serif fonts.|
-| casual | Casual fonts.|
-| cursive | Cursive fonts.|
-| smallCapitals | Small caps fonts.|
+ | Name | Description |
+ | -------- | -------- |
+ | default | Default font family. |
+ | monospacedSerif | Monospaced Serif fonts, which use the same width for each character. |
+ | serif | Serif fonts. |
+ | monospacedSansSerif | Monospaced Sans Serif fonts, which use the same width for each character. |
+ | sansSerif | Sans Serif fonts. |
+ | casual | Casual fonts. |
+ | cursive | Cursive fonts. |
+ | smallCapitals | Small caps fonts. |
## CaptionsStyle8+
@@ -129,14 +129,14 @@ Describes the caption style.
**System capability**: SystemCapability.Barrierfree.Accessibility.Hearing
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes| No| Font family of the captions.|
-| fontScale | number | Yes| No| Font scale of the captions.|
-| fontColor | number \| string | Yes| No| Font color of the captions.|
-| fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes| No| Font edge type of the captions.|
-| backgroundColor | number \| string | Yes| No| Background color of the captions.|
-| windowColor | number \| string | Yes| No| Window color of the captions.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes | No | Font family of the captions. |
+ | fontScale | number | Yes | No | Font scale of the captions. |
+ | fontColor | number \ | string | Yes | No | Font color of the captions. |
+ | fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes | No | Font edge type of the captions. |
+ | backgroundColor | number \ | string | Yes | No | Background color of the captions. |
+ | windowColor | number \ | string | Yes | No | Window color of the captions. |
## CaptionsManager8+
@@ -144,10 +144,10 @@ Implements caption configuration management.
### Attributes
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| enabled | boolean | Yes| No| Whether to enable caption configuration.|
-| style | [CaptionsStyle](#captionsstyle8) | Yes| No| Caption style.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | enabled | boolean | Yes | No | Whether to enable caption configuration. |
+ | style | [CaptionsStyle](#captionsstyle8) | Yes | No | Caption style. |
### Methods
@@ -163,10 +163,10 @@ Enables listening for enable status changes of caption configuration.
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Type of the event to listen for, which is set to **enableChange** in this API.|
- | callback | Callback<boolean> | Yes| Callback invoked when the enable status of caption configuration changes.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes | Type of the event to listen for, which is set to **enableChange** in this API. |
+ | callback | Callback<boolean> | Yes | Callback invoked when the enable status of caption configuration changes. |
- Example
@@ -186,10 +186,10 @@ Enables listening for caption style changes.
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Type of the event to listen for, which is set to **styleChange** in this API.|
- | callback | Callback<[CaptionsStyle](#captionsstyle8)> | Yes| Callback invoked when the caption style changes.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes | Type of the event to listen for, which is set to **styleChange** in this API. |
+ | callback | Callback<[CaptionsStyle](#captionsstyle8)> | Yes | Callback invoked when the caption style changes. |
- Example
@@ -209,10 +209,10 @@ Disables listening for enable status changes of caption configuration.
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Type of the event to listen for, which is set to **enableChange** in this API.|
- | callback | Callback<boolean> | No| Callback invoked when the enable status of caption configuration changes.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes | Type of the event to listen for, which is set to **enableChange** in this API. |
+ | callback | Callback<boolean> | No | Callback invoked when the enable status of caption configuration changes. |
- Example
@@ -230,10 +230,10 @@ Disables listening for caption style changes.s is removed.
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Type of the event to listen for, which is set to **styleChange** in this API.|
- | callback | Callback<[CaptionsStyle](#captionsstyle8)> | No| Callback invoked when the caption style changes.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes | Type of the event to listen for, which is set to **styleChange** in this API. |
+ | callback | Callback<[CaptionsStyle](#captionsstyle8)> | No | Callback invoked when the caption style changes. |
- Example
@@ -249,22 +249,22 @@ Describes a GUI change event.
### Attributes
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| type | [EventType](#eventtype) | Yes| Yes| Accessibility event type.|
-| windowUpdateType | [WindowUpdateType](#windowupdatetype) | Yes| Yes| Window update type.|
-| bundleName | string | Yes| Yes| Target application name.|
-| componentType | string | Yes| Yes| Type of the event source component, for example, button or chart.|
-| pageId | number | Yes| Yes| Page ID of the event source.|
-| description | string | Yes| Yes| Event description.|
-| triggerAction | [Action](#action) | Yes| Yes| Action that triggers the event.|
-| textMoveUnit | [TextMoveUnit](#textmoveunit) | Yes| Yes| Text movement unit.|
-| contents | Array<string> | Yes| Yes| Array of contents.|
-| lastContent | string | Yes| Yes| Latest content.|
-| beginIndex | number | Yes| Yes| Sequence number of the first item displayed on the page.|
-| currentIndex | number | Yes| Yes| Sequence number of the current item.|
-| endIndex | number | Yes| Yes| Sequence number of the last item displayed on the page.|
-| itemCount | number | Yes| Yes| Total number of items.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | type | [EventType](#eventtype) | Yes | Yes | Accessibility event type. |
+ | windowUpdateType | [WindowUpdateType](#windowupdatetype) | Yes | Yes | Window update type. |
+ | bundleName | string | Yes | Yes | Target application name. |
+ | componentType | string | Yes | Yes | Type of the event source component, for example, button or chart. |
+ | pageId | number | Yes | Yes | Page ID of the event source. |
+ | description | string | Yes | Yes | Event description. |
+ | triggerAction | [Action](#action) | Yes | Yes | Action that triggers the event. |
+ | textMoveUnit | [TextMoveUnit](#textmoveunit) | Yes | Yes | Text movement unit. |
+ | contents | Array<string> | Yes | Yes | Array of contents. |
+ | lastContent | string | Yes | Yes | Latest content. |
+ | beginIndex | number | Yes | Yes | Sequence number of the first item displayed on the page. |
+ | currentIndex | number | Yes | Yes | Sequence number of the current item. |
+ | endIndex | number | Yes | Yes | Sequence number of the last item displayed on the page. |
+ | itemCount | number | Yes | Yes | Total number of items. |
## EventType
@@ -272,19 +272,19 @@ Enumerates accessibility event types.
**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| click | Event of clicking a component.|
-| longClick | Event of long-pressing a component.|
-| select | Event of selecting a component.|
-| focus | Event indicating that the component obtains the focus.|
-| textUpdate | Event indicating that the component text has been updated.|
-| hoverEnter | Event indicating that the hover enters a component.|
-| hoverExit | Event indicating that the hover exits a component.|
-| scroll | Event of the scroll view.|
-| textSelectionUpdate | Event indicating that the selected text has been updated.|
-| accessibilityFocus | Event indicating that the accessibility focus has been obtained.|
-| accessibilityFocusClear | Event indicating that the accessibility focus has been cleared.|
+ | Name | Description |
+ | -------- | -------- |
+ | click | Event of clicking a component. |
+ | longClick | Event of long-pressing a component. |
+ | select | Event of selecting a component. |
+ | focus | Event indicating that the component obtains the focus. |
+ | textUpdate | Event indicating that the component text has been updated. |
+ | hoverEnter | Event indicating that the hover enters a component. |
+ | hoverExit | Event indicating that the hover exits a component. |
+ | scroll | Event of the scroll view. |
+ | textSelectionUpdate | Event indicating that the selected text has been updated. |
+ | accessibilityFocus | Event indicating that the accessibility focus has been obtained. |
+ | accessibilityFocusClear | Event indicating that the accessibility focus has been cleared. |
## TextMoveUnit
@@ -292,13 +292,13 @@ Enumerates the movement units for traversing the node text.
**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| char | The movement unit for traversing the node text is by character.|
-| word | The movement unit for traversing the node text is by word.|
-| line | The movement unit for traversing the node text is by line.|
-| page | The movement unit for traversing the node text is by page.|
-| paragraph | The movement unit for traversing the node text is by paragraph.|
+ | Name | Description |
+ | -------- | -------- |
+ | char | The movement unit for traversing the node text is by character. |
+ | word | The movement unit for traversing the node text is by word. |
+ | line | The movement unit for traversing the node text is by line. |
+ | page | The movement unit for traversing the node text is by page. |
+ | paragraph | The movement unit for traversing the node text is by paragraph. |
## WindowUpdateType
@@ -306,19 +306,19 @@ Enumerates window update types.
**System capability**: SystemCapability.Barrierfree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| add | Window adding.|
-| remove | Window deletion.|
-| title | Window title change.|
-| bounds | Window boundary change.|
-| layer | Window layer change.|
-| active | Window activity change.|
-| focus | Window focus change.|
-| accessibilityFocus | Window accessibility focus change.|
-| parent | Parent window change.|
-| children | Child window change.|
-| pip | Picture-in-picture (PIP) mode change.|
+ | Name | Description |
+ | -------- | -------- |
+ | add | Window adding. |
+ | remove | Window deletion. |
+ | title | Window title change. |
+ | bounds | Window boundary change. |
+ | layer | Window layer change. |
+ | active | Window activity change. |
+ | focus | Window focus change. |
+ | accessibilityFocus | Window accessibility focus change. |
+ | parent | Parent window change. |
+ | children | Child window change. |
+ | pip | Picture-in-picture (PIP) mode change. |
## accessibility.getAbilityLists
@@ -330,16 +330,16 @@ Obtains the accessibility application list. This API uses a promise to return th
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
- | stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type. |
+ | stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status. |
- Return value
- | Type| Description|
- | -------- | -------- |
- | Promise<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Promise used to return the accessibility application list.|
+ | Type | Description |
+ | -------- | -------- |
+ | Promise<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Promise used to return the accessibility application list. |
- Example
@@ -373,11 +373,11 @@ Obtains the accessibility application list. This API uses an asynchronous callba
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
- | stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
- | callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes| Callback used to return the accessibility application list.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type. |
+ | stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status. |
+ | callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes | Callback used to return the accessibility application list. |
- Example
@@ -412,9 +412,9 @@ Obtains the accessibility caption configuration.
- Return value
- | Type| Description|
- | -------- | -------- |
- | [CaptionsManager](#captionsmanager8) | Accessibility caption configuration.|
+ | Type | Description |
+ | -------- | -------- |
+ | [CaptionsManager](#captionsmanager8) | Accessibility caption configuration. |
- Example
@@ -430,10 +430,10 @@ Enables listening for the accessibility application or touch guide mode status c
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Type of the event to listen for. - **accessibilityStateChange** means to listen for enable status changes of the accessibility application. **System capability**: SystemCapability.Barrierfree.Accessibility.Core - **touchGuideStateChange** means to listen for enable status changes of the touch guide mode. **System capability**: SystemCapability.Barrierfree.Accessibility.Vision|
- | callback | Callback<boolean> | Yes| Callback invoked when the enable status changes.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes | Type of the event to listen for. - **accessibilityStateChange** means to listen for enable status changes of the accessibility application. **System capability**: SystemCapability.Barrierfree.Accessibility.Core - **touchGuideStateChange** means to listen for enable status changes of the touch guide mode. **System capability**: SystemCapability.Barrierfree.Accessibility.Vision |
+ | callback | Callback<boolean> | Yes | Callback invoked when the enable status changes. |
- Example
@@ -453,10 +453,10 @@ Disables listening for the accessibility application or touch guide mode status
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | type | string | No| Type of the event to listen for. - **accessibilityStateChange** means to listen for enable status changes of the accessibility application. **System capability**: SystemCapability.Barrierfree.Accessibility.Core - **touchGuideStateChange** means to listen for enable status changes of the touch guide mode. **System capability**: SystemCapability.Barrierfree.Accessibility.Vision|
- | callback | Callback<boolean> | No| Callback invoked when the enable status changes.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | type | string | No | Type of the event to listen for. - **accessibilityStateChange** means to listen for enable status changes of the accessibility application. **System capability**: SystemCapability.Barrierfree.Accessibility.Core - **touchGuideStateChange** means to listen for enable status changes of the touch guide mode. **System capability**: SystemCapability.Barrierfree.Accessibility.Vision |
+ | callback | Callback<boolean> | No | Callback invoked when the enable status changes. |
- Example
@@ -476,9 +476,9 @@ Checks whether accessibility is enabled. This API uses a promise to return the r
- Return value
- | Type| Description|
- | -------- | -------- |
- | Promise<boolean> | Returns **true** if accessibility is enabled; returns **false** otherwise.|
+ | Type | Description |
+ | -------- | -------- |
+ | Promise<boolean> | Returns **true** if accessibility is enabled; returns **false** otherwise. |
- Example
@@ -501,9 +501,9 @@ Checks whether accessibility is enabled. This API uses an asynchronous callback
- Parameters
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<boolean> | Yes| Callback used to return the result. Returns **true** if accessibility is enabled; returns **false** otherwise.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Returns **true** if accessibility is enabled; returns **false** otherwise. |
- Example
@@ -527,9 +527,9 @@ Checks whether touch guide mode is enabled. This API uses a promise to return th
- Return value
- | Type| Description|
- | -------- | -------- |
- | Promise<boolean> | Returns **true** if touch guide mode is enabled; returns **false** otherwise.|
+ | Type | Description |
+ | -------- | -------- |
+ | Promise<boolean> | Returns **true** if touch guide mode is enabled; returns **false** otherwise. |
- Example
@@ -552,9 +552,9 @@ Checks whether touch guide mode is enabled. This API uses an asynchronous callba
- Parameters
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<boolean> | Yes| Callback used to return the result. Returns **true** if touch guide mode is enabled; returns **false** otherwise.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Returns **true** if touch guide mode is enabled; returns **false** otherwise. |
- Example
@@ -578,15 +578,15 @@ Sends an accessibility event. This API uses a promise to return the result.
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | event | [EventInfo](#eventinfo) | Yes | Accessibility event. |
- Return value
- | Type| Description|
- | -------- | -------- |
- | Promise<void> | Promise used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise.|
+ | Type | Description |
+ | -------- | -------- |
+ | Promise<void> | Promise used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise. |
- Example
@@ -609,10 +609,10 @@ Sends an accessibility event. This API uses an asynchronous callback to return t
- **Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | event | [EventInfo](#eventinfo) | Yes | Accessibility event. |
+ | callback | AsyncCallback<void> | Yes | Callback used to return the result. Returns data if the accessibility event is sent successfully; returns an error otherwise. |
- Example
diff --git a/en/application-dev/reference/apis/js-apis-animator.md b/en/application-dev/reference/apis/js-apis-animator.md
index b259fe732e26348601c1d7a8e8a5002abe2a8a2b..d3fbcfa4e05459bfb3bad3964d5cb30eec215a56 100644
--- a/en/application-dev/reference/apis/js-apis-animator.md
+++ b/en/application-dev/reference/apis/js-apis-animator.md
@@ -1,7 +1,7 @@
# Animation
-> **NOTE:**
->The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+> **NOTE:**
+> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md
index 30d7ac0dd8a49df8f05cab425baa6d781d18371e..3577652546daea30400c7eadafd7e6771a55db77 100644
--- a/en/application-dev/reference/apis/js-apis-appAccount.md
+++ b/en/application-dev/reference/apis/js-apis-appAccount.md
@@ -1,6 +1,6 @@
-# App Account Management
+# App Account Management
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -20,9 +20,9 @@ Creates an **AppAccountManager** instance.
**System capability**: SystemCapability.Account.AppAccount
**Return Value**
-| Type | Description |
-| ----------------- | ------------ |
-| AppAccountManager | **AppAccountManager** instance created.|
+ | Type | Description |
+ | ----------------- | ------------ |
+ | AppAccountManager | **AppAccountManager** instance created. |
**Example**
```js
@@ -43,10 +43,10 @@ Adds an app account to the account management service. This method uses an async
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------- | ---- | --------------------- |
-| name | string | Yes | Name of the app account to add. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is added.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------------------------- | ---- | --------------------- |
+ | name | string | Yes | Name of the app account to add. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when the app account is added. |
**Example**
@@ -67,11 +67,11 @@ Adds an app account and its additional information to the account management ser
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------------------------- | ---- | ---------------------------------------- |
-| name | string | Yes | Name of the app account to add. |
-| extraInfo | string | Yes | Additional information (for example, token) of the app account to add. The additional information cannot contain sensitive information about the app account.|
-| callback | AsyncCallback<void> | Yes | Callback invoked when the app account and its additional information are added. |
+ | Name | Type | Mandatory | Description |
+ | --------- | ------------------------- | ---- | ---------------------------------------- |
+ | name | string | Yes | Name of the app account to add. |
+ | extraInfo | string | Yes | Additional information (for example, token) of the app account to add. The additional information cannot contain sensitive information about the app account. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when the app account and its additional information are added. |
**Example**
@@ -94,16 +94,16 @@ Adds an app account and its additional information to the account management ser
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------ | ---- | -------------------------------- |
-| name | string | Yes | Name of the app account to add. |
-| extraInfo | string | Yes | Additional information of the app account to add. The additional information cannot contain sensitive information about the app account.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ------ | ---- | -------------------------------- |
+ | name | string | Yes | Name of the app account to add. |
+ | extraInfo | string | Yes | Additional information of the app account to add. The additional information cannot contain sensitive information about the app account. |
**Return Value**
-| Type | Description |
-| ------------------- | --------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | ------------------- | --------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -126,12 +126,12 @@ Implicitly adds an app account based on the specified account owner, authenticat
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------- | ---- | --------------- |
-| owner | string | Yes | Bundle name of the app account to add.|
-| authType | string | Yes | Authentication type of the app account to add. |
-| options | {[key: string]: any} | Yes | Options for the authentication. |
-| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
+ | Name | Type | Mandatory | Description |
+ | -------- | --------------------- | ---- | --------------- |
+ | owner | string | Yes | Bundle name of the app account to add. |
+ | authType | string | Yes | Authentication type of the app account to add. |
+ | options | {[key: string]: any} | Yes | Options for the authentication. |
+ | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. |
**Example**
@@ -167,10 +167,10 @@ Deletes an app account from the account management service. This method uses an
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------- | ---- | ----------------- |
-| name | string | Yes | Name of the app account to delete. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is deleted.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------------------------- | ---- | ----------------- |
+ | name | string | Yes | Name of the app account to delete. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when the app account is deleted. |
**Example**
@@ -191,15 +191,15 @@ Deletes an app account from the account management service. This method uses a p
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---- | ------ | ---- | ------------ |
-| name | string | Yes | Name of the app account to delete.|
+ | Name | Type | Mandatory | Description |
+ | ---- | ------ | ---- | ------------ |
+ | name | string | Yes | Name of the app account to delete. |
**Return Value**
-| Type | Description |
-| :------------------ | :-------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | :------------------ | :-------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -222,11 +222,11 @@ Disables an app account from accessing an application with the given bundle name
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ------------------------- | ---- | ------------------------------- |
-| name | string | Yes | App account name. |
-| bundleName | string | Yes | Bundle name of an app. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name.|
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------------------------- | ---- | ------------------------------- |
+ | name | string | Yes | App account name. |
+ | bundleName | string | Yes | Bundle name of an app. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name. |
**Example**
@@ -247,16 +247,16 @@ Disables an app account from accessing an application with the given bundle name
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ------ | ---- | ----------------- |
-| name | string | Yes | App account name.|
-| bundleName | string | Yes | Bundle name of an app. |
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------ | ---- | ----------------- |
+ | name | string | Yes | App account name. |
+ | bundleName | string | Yes | Bundle name of an app. |
**Return Value**
-| Type | Description |
-| :------------------ | :-------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | :------------------ | :-------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -279,11 +279,11 @@ Enables an app account to access an application with the given bundle name. This
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ------------------------- | ---- | ------------------------------- |
-| name | string | Yes | App account name. |
-| bundleName | string | Yes | Bundle name of an app. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is enabled to access the application with the given bundle name.|
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------------------------- | ---- | ------------------------------- |
+ | name | string | Yes | App account name. |
+ | bundleName | string | Yes | Bundle name of an app. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when the app account is enabled to access the application with the given bundle name. |
**Example**
@@ -304,16 +304,16 @@ Enables an app account to access an application with the given bundle name. This
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ------ | ---- | --------- |
-| name | string | Yes | App account name. |
-| bundleName | string | Yes | Bundle name of an app.|
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------ | ---- | --------- |
+ | name | string | Yes | App account name. |
+ | bundleName | string | Yes | Bundle name of an app. |
**Return Value**
-| Type | Description |
-| :------------------ | :-------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | :------------------ | :-------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -337,10 +337,10 @@ Checks whether an app account allows application data synchronization. This meth
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------------- | ---- | ---------------------- |
-| name | string | Yes | App account name. |
-| callback | AsyncCallback<boolean> | Yes | Callback used to return whether the app account allows application data synchronization.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ---------------------------- | ---- | ---------------------- |
+ | name | string | Yes | App account name. |
+ | callback | AsyncCallback<boolean> | Yes | Callback used to return whether the app account allows application data synchronization. |
**Example**
@@ -364,15 +364,15 @@ Checks whether an app account allows application data synchronization. This meth
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---- | ------ | ---- | ------- |
-| name | string | Yes | App account name.|
+ | Name | Type | Mandatory | Description |
+ | ---- | ------ | ---- | ------- |
+ | name | string | Yes | App account name. |
**Return Value**
-| Type | Description |
-| :--------------------- | :-------------------- |
-| Promise<boolean> | Promise used to return the result.|
+ | Type | Description |
+ | :--------------------- | :-------------------- |
+ | Promise<boolean> | Promise used to return the result. |
**Example**
@@ -395,12 +395,12 @@ Sets a credential for an app account. This method uses an asynchronous callback
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ------------------------- | ---- | -------------- |
-| name | string | Yes | App account name. |
-| credentialType | string | Yes | Type of the credential to set. |
-| credential | string | Yes | Credential to set. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when a credential is set for the specified app account.|
+ | Name | Type | Mandatory | Description |
+ | -------------- | ------------------------- | ---- | -------------- |
+ | name | string | Yes | App account name. |
+ | credentialType | string | Yes | Type of the credential to set. |
+ | credential | string | Yes | Credential to set. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when a credential is set for the specified app account. |
**Example**
@@ -421,17 +421,17 @@ Sets a credential for an app account. This method uses a promise to return the r
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ------ | ---- | ---------- |
-| name | string | Yes | App account name. |
-| credentialType | string | Yes | Type of the credential to set.|
-| credential | string | Yes | Credential to set. |
+ | Name | Type | Mandatory | Description |
+ | -------------- | ------ | ---- | ---------- |
+ | name | string | Yes | App account name. |
+ | credentialType | string | Yes | Type of the credential to set. |
+ | credential | string | Yes | Credential to set. |
**Return Value**
-| Type | Description |
-| :------------------ | :-------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | :------------------ | :-------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -454,11 +454,11 @@ Sets additional information for an app account. This method uses an asynchronous
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------------------------- | ---- | ---------------- |
-| name | string | Yes | App account name. |
-| extraInfo | string | Yes | Additional information to set. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when additional information is set for the specified app account.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ------------------------- | ---- | ---------------- |
+ | name | string | Yes | App account name. |
+ | extraInfo | string | Yes | Additional information to set. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when additional information is set for the specified app account. |
**Example**
@@ -479,16 +479,16 @@ Sets additional information for an app account. This method uses a promise to re
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------ | ---- | --------- |
-| name | string | Yes | App account name. |
-| extraInfo | string | Yes | Additional information to set.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ------ | ---- | --------- |
+ | name | string | Yes | App account name. |
+ | extraInfo | string | Yes | Additional information to set. |
**Return Value**
-| Type | Description |
-| :------------------ | :-------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | :------------------ | :-------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -513,11 +513,11 @@ Sets whether to enable application data synchronization for an app account. This
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------- | ---- | ------------------------- |
-| name | string | Yes | App account name. |
-| isEnable | boolean | Yes | Whether to enable app data synchronization. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when application data synchronization is enabled or disabled for the app account.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------------------------- | ---- | ------------------------- |
+ | name | string | Yes | App account name. |
+ | isEnable | boolean | Yes | Whether to enable app data synchronization. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when application data synchronization is enabled or disabled for the app account. |
**Example**
@@ -540,16 +540,16 @@ Sets whether to enable application data synchronization for an app account. This
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------- | ---- | ----------- |
-| name | string | Yes | App account name. |
-| isEnable | boolean | Yes | Whether to enable app data synchronization.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------- | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | isEnable | boolean | Yes | Whether to enable app data synchronization. |
**Return Value**
-| Type | Description |
-| :------------------ | :-------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | :------------------ | :-------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -572,12 +572,12 @@ Sets data to be associated with an app account. This method uses an asynchronous
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------- | ---- | ----------------- |
-| name | string | Yes | App account name. |
-| key | string | Yes | Key of the data to set. The private key can be customized.|
-| value | string | Yes | Value of the data to be set. |
-| callback | AsyncCallback<void> | Yes | Callback invoked when the data associated with the specified app account is set.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------------------------- | ---- | ----------------- |
+ | name | string | Yes | App account name. |
+ | key | string | Yes | Key of the data to set. The private key can be customized. |
+ | value | string | Yes | Value of the data to be set. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked when the data associated with the specified app account is set. |
**Example**
@@ -597,17 +597,17 @@ Sets data to be associated with an app account. This method uses a promise to re
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----- | ------ | ---- | ----------------- |
-| name | string | Yes | App account name. |
-| key | string | Yes | Key of the data to set. The private key can be customized.|
-| value | string | Yes | Value of the data to be set. |
+ | Name | Type | Mandatory | Description |
+ | ----- | ------ | ---- | ----------------- |
+ | name | string | Yes | App account name. |
+ | key | string | Yes | Key of the data to set. The private key can be customized. |
+ | value | string | Yes | Value of the data to be set. |
**Return Value**
-| Type | Description |
-| :------------------ | :-------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | :------------------ | :-------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -630,11 +630,11 @@ Obtains the credential of an app account. This method uses an asynchronous callb
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | --------------------------- | ---- | -------------- |
-| name | string | Yes | App account name. |
-| credentialType | string | Yes | Type of the credential to obtain. |
-| callback | AsyncCallback<string> | Yes | Callback invoked to return the credential of the specified app account.|
+ | Name | Type | Mandatory | Description |
+ | -------------- | --------------------------- | ---- | -------------- |
+ | name | string | Yes | App account name. |
+ | credentialType | string | Yes | Type of the credential to obtain. |
+ | callback | AsyncCallback<string> | Yes | Callback invoked to return the credential of the specified app account. |
**Example**
@@ -656,16 +656,16 @@ Obtains the credential of an app account. This method uses a promise to return t
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------- | ------ | ---- | ---------- |
-| name | string | Yes | App account name. |
-| credentialType | string | Yes | Type of the credential to obtain.|
+ | Name | Type | Mandatory | Description |
+ | -------------- | ------ | ---- | ---------- |
+ | name | string | Yes | App account name. |
+ | credentialType | string | Yes | Type of the credential to obtain. |
**Return Value**
-| Type | Description |
-| :-------------------- | :-------------------- |
-| Promise<string> | Promise used to return the result.|
+ | Type | Description |
+ | :-------------------- | :-------------------- |
+ | Promise<string> | Promise used to return the result. |
**Example**
@@ -688,10 +688,10 @@ Obtains additional information of an app account. This method uses an asynchrono
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------- | ---- | ---------------- |
-| name | string | Yes | App account name. |
-| callback | AsyncCallback<string> | Yes | Callback invoked to return the additional information of the specified app account.|
+ | Name | Type | Mandatory | Description |
+ | -------- | --------------------------- | ---- | ---------------- |
+ | name | string | Yes | App account name. |
+ | callback | AsyncCallback<string> | Yes | Callback invoked to return the additional information of the specified app account. |
**Example**
@@ -713,15 +713,15 @@ Obtains additional information of an app account. This method uses a promise to
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---- | ------ | ---- | ------- |
-| name | string | Yes | App account name.|
+ | Name | Type | Mandatory | Description |
+ | ---- | ------ | ---- | ------- |
+ | name | string | Yes | App account name. |
**Return Value**
-| Type | Description |
-| :-------------------- | :-------------------- |
-| Promise<string> | Promise used to return the result.|
+ | Type | Description |
+ | :-------------------- | :-------------------- |
+ | Promise<string> | Promise used to return the result. |
**Example**
@@ -744,11 +744,11 @@ Obtains data associated with an app account. This method uses an asynchronous ca
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------- | ---- | ----------------- |
-| name | string | Yes | App account name. |
-| key | string | Yes | Key of the data to obtain. |
-| callback | AsyncCallback<string> | Yes | Callback invoked to return the data associated with the specified app account.|
+ | Name | Type | Mandatory | Description |
+ | -------- | --------------------------- | ---- | ----------------- |
+ | name | string | Yes | App account name. |
+ | key | string | Yes | Key of the data to obtain. |
+ | callback | AsyncCallback<string> | Yes | Callback invoked to return the data associated with the specified app account. |
**Example**
@@ -770,16 +770,16 @@ Obtains data associated with an app account. This method uses a promise to retur
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---- | ------ | ---- | ----------- |
-| name | string | Yes | App account name. |
-| key | string | Yes | Key of the data to obtain.|
+ | Name | Type | Mandatory | Description |
+ | ---- | ------ | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | key | string | Yes | Key of the data to obtain. |
**Return Value**
-| Type | Description |
-| :-------------------- | :-------------------- |
-| Promise<string> | Promise used to return the result.|
+ | Type | Description |
+ | :-------------------- | :-------------------- |
+ | Promise<string> | Promise used to return the result. |
**Example**
@@ -804,9 +804,9 @@ Obtains information about all accessible app accounts. This method uses an async
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------------------------- | ---- | -------- |
-| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ---------------------------------------- | ---- | -------- |
+ | callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts. |
**Example**
@@ -830,9 +830,9 @@ Obtains information about all accessible app accounts. This method uses an async
**Parameters**
-| Type | Description |
-| ---------------------------------------- | --------------------- |
-| Promise<Array<AppAccountInfo>> | Promise used to return the result.|
+ | Type | Description |
+ | ---------------------------------------- | --------------------- |
+ | Promise<Array<AppAccountInfo>> | Promise used to return the result. |
**Example**
@@ -857,10 +857,10 @@ Obtains information about all app accounts of the specified app. This method use
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------------------------- | ---- | -------- |
-| owner | string | Yes | Bundle name of the app. |
-| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ---------------------------------------- | ---- | -------- |
+ | owner | string | Yes | Bundle name of the app. |
+ | callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts. |
**Example**
@@ -885,15 +885,15 @@ Obtains information about all app accounts of the specified app. This method use
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----- | ------ | ---- | ----- |
-| owner | string | Yes | Bundle name of the app.|
+ | Name | Type | Mandatory | Description |
+ | ----- | ------ | ---- | ----- |
+ | owner | string | Yes | Bundle name of the app. |
**Parameters**
-| Type | Description |
-| ---------------------------------------- | --------------------- |
-| Promise<Array<AppAccountInfo>> | Promise used to return the result.|
+ | Type | Description |
+ | ---------------------------------------- | --------------------- |
+ | Promise<Array<AppAccountInfo>> | Promise used to return the result. |
**Example**
@@ -917,11 +917,11 @@ Subscribes to the account change event of the specified account owners. This met
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------------------------- | ---- | ------------------------------ |
-| type | 'change' | Yes | Type of the event to subscribe to. The subscriber will receive a notification when the account owners update their accounts.|
-| owners | Array<string> | Yes | Owners of the accounts. |
-| callback | Callback<Array<AppAccountInfo>> | Yes | Callback invoked to return the account change. |
+ | Name | Type | Mandatory | Description |
+ | -------- | ---------------------------------------- | ---- | ------------------------------ |
+ | type | 'change' | Yes | Type of the event to subscribe to. The subscriber will receive a notification when the account owners update their accounts. |
+ | owners | Array<string> | Yes | Owners of the accounts. |
+ | callback | Callback<Array<AppAccountInfo>> | Yes | Callback invoked to return the account change. |
**Example**
@@ -948,10 +948,10 @@ Unsubscribes from the account change event. This method uses an asynchronous cal
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | -------------------------------- | ---- | ------------ |
-| type | 'change' | Yes | Account change event to unsubscribe from. |
-| callback | Callback> | No | Callback used to report the account change.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------------------------------- | ---- | ------------ |
+ | type | 'change' | Yes | Account change event to unsubscribe from. |
+ | callback | Callback> | No | Callback used to report the account change. |
**Example**
@@ -981,13 +981,13 @@ Authenticates an app account to obtain the Open Authorization (OAuth) access tok
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------- | ---- | --------------- |
-| name | string | Yes | Name of the app account to authenticate. |
-| owner | string | Yes | Bundle name of the app.|
-| authType | string | Yes | Authentication type. |
-| options | {[key: string]: any} | Yes | Options for the authentication. |
-| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
+ | Name | Type | Mandatory | Description |
+ | -------- | --------------------- | ---- | --------------- |
+ | name | string | Yes | Name of the app account to authenticate. |
+ | owner | string | Yes | Bundle name of the app. |
+ | authType | string | Yes | Authentication type. |
+ | options | {[key: string]: any} | Yes | Options for the authentication. |
+ | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. |
**Example**
@@ -1023,12 +1023,12 @@ Obtains the OAuth access token of an app account based on the specified authenti
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------- | ---- | ----------- |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app.|
-| authType | string | Yes | Authentication type. |
-| callback | AsyncCallback<string> | Yes | Callback invoked to return the result. |
+ | Name | Type | Mandatory | Description |
+ | -------- | --------------------------- | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
+ | authType | string | Yes | Authentication type. |
+ | callback | AsyncCallback<string> | Yes | Callback invoked to return the result. |
**Example**
@@ -1050,17 +1050,17 @@ Obtains the OAuth access token of an app account based on the specified authenti
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------ | ---- | ----------- |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app.|
-| authType | string | Yes | Authentication type. |
+ | Name | Type | Mandatory | Description |
+ | -------- | ------ | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
+ | authType | string | Yes | Authentication type. |
**Parameters**
-| Type | Description |
-| --------------------- | --------------------- |
-| Promise<string> | Promise used to return the result.|
+ | Type | Description |
+ | --------------------- | --------------------- |
+ | Promise<string> | Promise used to return the result. |
**Example**
@@ -1083,12 +1083,12 @@ Sets an OAuth access token for an app account. This method uses an asynchronous
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------- | ---- | -------- |
-| name | string | Yes | App account name.|
-| authType | string | Yes | Authentication type. |
-| token | string | Yes | OAuth access token to set.|
-| callback | AsyncCallback<void> | Yes | Callback invoked to return the result.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------------------------- | ---- | -------- |
+ | name | string | Yes | App account name. |
+ | authType | string | Yes | Authentication type. |
+ | token | string | Yes | OAuth access token to set. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
**Example**
@@ -1109,17 +1109,17 @@ Sets an OAuth access token for an app account. This method uses a promise to ret
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------ | ---- | -------- |
-| name | string | Yes | App account name.|
-| authType | string | Yes | Authentication type. |
-| token | string | Yes | OAuth access token to set.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------ | ---- | -------- |
+ | name | string | Yes | App account name. |
+ | authType | string | Yes | Authentication type. |
+ | token | string | Yes | OAuth access token to set. |
**Parameters**
-| Type | Description |
-| ------------------- | --------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | ------------------- | --------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -1142,13 +1142,13 @@ Deletes the specified OAuth access token for an app account. This method uses an
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------------------------- | ---- | ------------ |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app. |
-| authType | string | Yes | Authentication type. |
-| token | string | Yes | OAuth access token to delete.|
-| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+ | Name | Type | Mandatory | Description |
+ | -------- | ------------------------- | ---- | ------------ |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
+ | authType | string | Yes | Authentication type. |
+ | token | string | Yes | OAuth access token to delete. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
**Example**
@@ -1169,18 +1169,18 @@ Deletes the specified OAuth access token for an app account. This method uses a
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ------ | ---- | ------------ |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app. |
-| authType | string | Yes | Authentication type. |
-| token | string | Yes | OAuth access token to delete.|
+ | Name | Type | Mandatory | Description |
+ | -------- | ------ | ---- | ------------ |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
+ | authType | string | Yes | Authentication type. |
+ | token | string | Yes | OAuth access token to delete. |
**Parameters**
-| Type | Description |
-| ------------------- | --------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | ------------------- | --------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -1203,13 +1203,13 @@ Sets the visibility of an OAuth access token to the specified app. This method u
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ------------------------- | ---- | ------------ |
-| name | string | Yes | App account name. |
-| authType | string | Yes | Authentication type. |
-| bundleName | string | Yes | Bundle name of the app.|
-| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. |
-| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------------------------- | ---- | ------------ |
+ | name | string | Yes | App account name. |
+ | authType | string | Yes | Authentication type. |
+ | bundleName | string | Yes | Bundle name of the app. |
+ | isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. |
+ | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
**Example**
@@ -1230,18 +1230,18 @@ Sets the visibility of an OAuth access token to the specified app. This method u
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ------- | ---- | ------------ |
-| name | string | Yes | App account name. |
-| authType | string | Yes | Authentication type. |
-| bundleName | string | Yes | Bundle name of the app.|
-| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. |
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------- | ---- | ------------ |
+ | name | string | Yes | App account name. |
+ | authType | string | Yes | Authentication type. |
+ | bundleName | string | Yes | Bundle name of the app. |
+ | isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. |
**Parameters**
-| Type | Description |
-| ------------------- | --------------------- |
-| Promise<void> | Promise used to return the result.|
+ | Type | Description |
+ | ------------------- | --------------------- |
+ | Promise<void> | Promise used to return the result. |
**Example**
@@ -1264,12 +1264,12 @@ Checks whether an OAuth token is visible to the specified app. This method uses
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ---------------------------- | ---- | ------------- |
-| name | string | Yes | App account name. |
-| authType | string | Yes | Authentication type. |
-| bundleName | string | Yes | Bundle name of the app.|
-| callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. |
+ | Name | Type | Mandatory | Description |
+ | ---------- | ---------------------------- | ---- | ------------- |
+ | name | string | Yes | App account name. |
+ | authType | string | Yes | Authentication type. |
+ | bundleName | string | Yes | Bundle name of the app. |
+ | callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. |
**Example**
@@ -1291,17 +1291,17 @@ Checks whether an OAuth token is visible to the specified app. This method uses
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------- | ------ | ---- | ------------- |
-| name | string | Yes | App account name. |
-| authType | string | Yes | Authentication type. |
-| bundleName | string | Yes | Bundle name of the app.|
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------ | ---- | ------------- |
+ | name | string | Yes | App account name. |
+ | authType | string | Yes | Authentication type. |
+ | bundleName | string | Yes | Bundle name of the app. |
**Parameters**
-| Type | Description |
-| ---------------------- | --------------------- |
-| Promise<boolean> | Promise used to return the result.|
+ | Type | Description |
+ | ---------------------- | --------------------- |
+ | Promise<boolean> | Promise used to return the result. |
**Example**
@@ -1324,11 +1324,11 @@ Obtains information about all OAuth access tokens of an app account visible to t
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------------------------- | ---- | ----------- |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app.|
-| callback | AsyncCallback<Array<OAuthTokenInfo>> | Yes | Callback invoked to return the result. |
+ | Name | Type | Mandatory | Description |
+ | -------- | ---------------------------------------- | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
+ | callback | AsyncCallback<Array<OAuthTokenInfo>> | Yes | Callback invoked to return the result. |
**Example**
@@ -1350,16 +1350,16 @@ Obtains information about all OAuth access tokens of an app account visible to t
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----- | ------ | ---- | ----------- |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app.|
+ | Name | Type | Mandatory | Description |
+ | ----- | ------ | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
**Parameters**
-| Type | Description |
-| ---------------------------------------- | --------------------- |
-| Promise<Array<OAuthTokenInfo>> | Promise used to return the result.|
+ | Type | Description |
+ | ---------------------------------------- | --------------------- |
+ | Promise<Array<OAuthTokenInfo>> | Promise used to return the result. |
**Example**
@@ -1382,11 +1382,11 @@ Obtains the authorization list of OAuth access tokens of an app account. This me
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------------------------- | ---- | ----------- |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app.|
-| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. |
+ | Name | Type | Mandatory | Description |
+ | -------- | ---------------------------------------- | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
+ | callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. |
**Example**
@@ -1408,16 +1408,16 @@ Obtains the authorization list of OAuth access tokens of an app account. This me
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----- | ------ | ---- | ----------- |
-| name | string | Yes | App account name. |
-| owner | string | Yes | Bundle name of the app.|
+ | Name | Type | Mandatory | Description |
+ | ----- | ------ | ---- | ----------- |
+ | name | string | Yes | App account name. |
+ | owner | string | Yes | Bundle name of the app. |
**Parameters**
-| Type | Description |
-| ---------------------------------- | --------------------- |
-| Promise<Array<string>> | Promise used to return the result.|
+ | Type | Description |
+ | ---------------------------------- | --------------------- |
+ | Promise<Array<string>> | Promise used to return the result. |
**Example**
@@ -1440,10 +1440,10 @@ Obtains the authenticator callback for a session. This method uses an asynchrono
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ---------------------------------------- | ---- | -------- |
-| sessionId | string | Yes | ID of the session to authenticate.|
-| callback | AsyncCallback<AuthenticatorCallback> | Yes | Callback invoked to return the result.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ---------------------------------------- | ---- | -------- |
+ | sessionId | string | Yes | ID of the session to authenticate. |
+ | callback | AsyncCallback<AuthenticatorCallback> | Yes | Callback invoked to return the result. |
**Example**
@@ -1475,15 +1475,15 @@ Obtains the authenticator callback for a session. This method uses a promise to
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------ | ---- | -------- |
-| sessionId | string | Yes | ID of the session to authenticate.|
+ | Name | Type | Mandatory | Description |
+ | --------- | ------ | ---- | -------- |
+ | sessionId | string | Yes | ID of the session to authenticate. |
**Parameters**
-| Type | Description |
-| ------------------------------------ | --------------------- |
-| Promise<AuthenticatorCallback> | Promise used to return the result.|
+ | Type | Description |
+ | ------------------------------------ | --------------------- |
+ | Promise<AuthenticatorCallback> | Promise used to return the result. |
**Example**
@@ -1515,10 +1515,10 @@ Obtains authenticator information of an app account. This method uses an asynchr
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | -------------------------------------- | ---- | ----------- |
-| owner | string | Yes | Bundle name of the app.|
-| callback | AsyncCallback<AuthenticatorInfo> | Yes | Callback invoked to return the result. |
+ | Name | Type | Mandatory | Description |
+ | -------- | -------------------------------------- | ---- | ----------- |
+ | owner | string | Yes | Bundle name of the app. |
+ | callback | AsyncCallback<AuthenticatorInfo> | Yes | Callback invoked to return the result. |
**Example**
@@ -1540,15 +1540,15 @@ Obtains authenticator information of an app account. This method uses a promise
**Parameters**
-| Name | Type | Mandatory | Description |
-| ----- | ------ | ---- | ----------- |
-| owner | string | Yes | Bundle name of the app.|
+ | Name | Type | Mandatory | Description |
+ | ----- | ------ | ---- | ----------- |
+ | owner | string | Yes | Bundle name of the app. |
**Parameters**
-| Type | Description |
-| -------------------------------- | --------------------- |
-| Promise<AuthenticatorInfo> | Promise used to return the result.|
+ | Type | Description |
+ | -------------------------------- | --------------------- |
+ | Promise<AuthenticatorInfo> | Promise used to return the result. |
**Example**
@@ -1567,10 +1567,10 @@ Defines app account information.
**System capability**: SystemCapability.Account.AppAccount
-| Name | Type | Mandatory | Description |
-| ----- | ------ | ---- | ----------- |
-| owner | string | Yes | Bundle name of the app.|
-| name | string | Yes | App account name. |
+ | Name | Type | Mandatory | Description |
+ | ----- | ------ | ---- | ----------- |
+ | owner | string | Yes | Bundle name of the app. |
+ | name | string | Yes | App account name. |
## OAuthTokenInfo8+
@@ -1578,10 +1578,10 @@ Defines OAuth access token information.
**System capability**: SystemCapability.Account.AppAccount
-| Name | Type | Mandatory | Description |
-| -------- | ------ | ---- | -------- |
-| authType | string | Yes | Authentication type.|
-| token | string | Yes | Value of the access token. |
+ | Name | Type | Mandatory | Description |
+ | -------- | ------ | ---- | -------- |
+ | authType | string | Yes | Authentication type. |
+ | token | string | Yes | Value of the access token. |
## AuthenticatorInfo8+
@@ -1589,11 +1589,11 @@ Defines OAuth authenticator information.
**System capability**: SystemCapability.Account.AppAccount
-| Name | Type | Mandatory | Description |
-| ------- | ------ | ---- | ---------- |
-| owner | string | Yes | Bundle name of the authenticator owner.|
-| iconId | string | Yes | ID of the authenticator icon. |
-| labelId | string | Yes | ID of the authenticator label. |
+ | Name | Type | Mandatory | Description |
+ | ------- | ------ | ---- | ---------- |
+ | owner | string | Yes | Bundle name of the authenticator owner. |
+ | iconId | string | Yes | ID of the authenticator icon. |
+ | labelId | string | Yes | ID of the authenticator label. |
## Constants8+
@@ -1601,19 +1601,19 @@ Enumerates the constants.
**System capability**: SystemCapability.Account.AppAccount
-| Name | Default Value | Description |
-| ----------------------------- | ---------------------- | ------------- |
-| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. |
-| ACTION_AUTHENTICATE | "authenticate" | Authentication operation. |
-| KEY_NAME | "name" | App account name. |
-| KEY_OWNER | "owner" | App account owner.|
-| KEY_TOKEN | "token" | OAuth access token. |
-| KEY_ACTION | "action" | Action. |
-| KEY_AUTH_TYPE | "authType" | Authentication type. |
-| KEY_SESSION_ID | "sessionId" | Session ID. |
-| KEY_CALLER_PID | "callerPid" | Caller process ID (PID). |
-| KEY_CALLER_UID | "callerUid" | Caller user ID (UID). |
-| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. |
+ | Name | Default Value | Description |
+ | ----------------------------- | ---------------------- | ------------- |
+ | ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. |
+ | ACTION_AUTHENTICATE | "authenticate" | Authentication operation. |
+ | KEY_NAME | "name" | App account name. |
+ | KEY_OWNER | "owner" | App account owner. |
+ | KEY_TOKEN | "token" | OAuth access token. |
+ | KEY_ACTION | "action" | Action. |
+ | KEY_AUTH_TYPE | "authType" | Authentication type. |
+ | KEY_SESSION_ID | "sessionId" | Session ID. |
+ | KEY_CALLER_PID | "callerPid" | Caller process ID (PID). |
+ | KEY_CALLER_UID | "callerUid" | Caller user ID (UID). |
+ | KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. |
## ResultCode8+
@@ -1621,27 +1621,27 @@ Enumerates the result codes.
**System capability**: SystemCapability.Account.AppAccount
-| Name | Default Value | Description |
-| ----------------------------------- | ----- | ------------ |
-| SUCCESS | 0 | The operation is successful. |
-| ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. |
-| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. |
-| ERROR_INVALID_PASSWORD | 10003 | The password is invalid. |
-| ERROR_INVALID_REQUEST | 10004 | The request is invalid. |
-| ERROR_INVALID_RESPONSE | 10005 | The response is invalid. |
-| ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. |
-| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. |
-| ERROR_OAUTH_CANCELED | 10008 | The authentication is canceled. |
-| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | The size of the OAuth list exceeds the limit. |
-| ERROR_OAUTH_SERVICE_BUSY | 10010 | The OAuth service is busy. |
-| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | The OAuth service is abnormal. |
-| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | The session to be authenticated does not exist. |
-| ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. |
-| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | The OAuth access token does not exist.|
-| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | The number of OAuth access tokens reaches the limit. |
-| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | The authentication operation is not supported. |
-| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. |
-| ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. |
+ | Name | Default Value | Description |
+ | ----------------------------------- | ----- | ------------ |
+ | SUCCESS | 0 | The operation is successful. |
+ | ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. |
+ | ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. |
+ | ERROR_INVALID_PASSWORD | 10003 | The password is invalid. |
+ | ERROR_INVALID_REQUEST | 10004 | The request is invalid. |
+ | ERROR_INVALID_RESPONSE | 10005 | The response is invalid. |
+ | ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. |
+ | ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. |
+ | ERROR_OAUTH_CANCELED | 10008 | The authentication is canceled. |
+ | ERROR_OAUTH_LIST_TOO_LARGE | 10009 | The size of the OAuth list exceeds the limit. |
+ | ERROR_OAUTH_SERVICE_BUSY | 10010 | The OAuth service is busy. |
+ | ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | The OAuth service is abnormal. |
+ | ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | The session to be authenticated does not exist. |
+ | ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. |
+ | ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | The OAuth access token does not exist. |
+ | ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | The number of OAuth access tokens reaches the limit. |
+ | ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | The authentication operation is not supported. |
+ | ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. |
+ | ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. |
## AuthenticatorCallback8+
@@ -1656,10 +1656,10 @@ Called back to send the authentication result.
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------ | -------------------- | ---- | ------ |
-| code | number | Yes | Authentication result code.|
-| result | {[key: string]: any} | Yes | Authentication result. |
+ | Name | Type | Mandatory | Description |
+ | ------ | -------------------- | ---- | ------ |
+ | code | number | Yes | Authentication result code. |
+ | result | {[key: string]: any} | Yes | Authentication result. |
**Example**
@@ -1686,9 +1686,9 @@ Called back to redirect an authentication request.
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | ---- | ---- | ---------- |
-| request | Want | Yes | Request to be redirected.|
+ | Name | Type | Mandatory | Description |
+ | ------- | ---- | ---- | ---------- |
+ | request | Want | Yes | Request to be redirected. |
**Example**
@@ -1723,12 +1723,12 @@ Implicitly adds an app account based on the specified authentication type and op
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------------- | --------------------- | ---- | --------------- |
-| authType | string | Yes | Authentication type. |
-| callerBundleName | string | Yes | Bundle name of the authentication requester. |
-| options | {[key: string]: any} | Yes | Options for the authentication. |
-| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
+ | Name | Type | Mandatory | Description |
+ | ---------------- | --------------------- | ---- | --------------- |
+ | authType | string | Yes | Authentication type. |
+ | callerBundleName | string | Yes | Bundle name of the authentication requester. |
+ | options | {[key: string]: any} | Yes | Options for the authentication. |
+ | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. |
### authenticate8+
@@ -1739,13 +1739,13 @@ Authenticates an app account to obtain the OAuth access token. This method uses
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
-| Name | Type | Mandatory | Description |
-| ---------------- | --------------------- | ---- | --------------- |
-| name | string | Yes | App account name. |
-| authType | string | Yes | Authentication type. |
-| callerBundleName | string | Yes | Bundle name of the authentication requester. |
-| options | {[key: string]: any} | Yes | Options for the authentication. |
-| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
+ | Name | Type | Mandatory | Description |
+ | ---------------- | --------------------- | ---- | --------------- |
+ | name | string | Yes | App account name. |
+ | authType | string | Yes | Authentication type. |
+ | callerBundleName | string | Yes | Bundle name of the authentication requester. |
+ | options | {[key: string]: any} | Yes | Options for the authentication. |
+ | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. |
**Example**
@@ -1771,4 +1771,4 @@ Authenticates an app account to obtain the OAuth access token. This method uses
return new MyAuthenticator();
}
}
- ```
+ ```
\ No newline at end of file
diff --git a/en/application-dev/reference/apis/js-apis-application-MissionSnapshot.md b/en/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
index 39fa47376a819eeaa07fcb5e15caef9743cfc0e4..864fc6a90893ac05bb92089cfbd9c4f8e4cc0514 100644
--- a/en/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
+++ b/en/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
@@ -1,7 +1,7 @@
# MissionSnapshot
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -21,7 +21,7 @@ import { image } from '../@ohos.multimedia.image';
Describes the mission snapshot.
- | Name| Type| Readable| Writable| Description|
+| Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- |
-| ability | ElementName | Yes| Yes| Information that matches an ability.|
-| snapshot | [image.PixelMap](js-apis-image.md) | Yes| Yes| Snapshot of the mission.|
+| ability | ElementName | Yes | Yes | Information that matches an ability. |
+| snapshot | [image.PixelMap](js-apis-image.md) | Yes| Yes| Snapshot of the mission. |
diff --git a/en/application-dev/reference/apis/js-apis-application-StartOptions.md b/en/application-dev/reference/apis/js-apis-application-StartOptions.md
index 8ce70a8f8657b260f028df9f61ba01dd5d955427..b2a29f392acdac4b4e9bdfbdd1b31c7809671ce5 100644
--- a/en/application-dev/reference/apis/js-apis-application-StartOptions.md
+++ b/en/application-dev/reference/apis/js-apis-application-StartOptions.md
@@ -1,6 +1,6 @@
# StartOptions
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -9,7 +9,7 @@
## Modules to Import
-
+
```
import StartOptions from '@ohos.application.StartOptions';
```
@@ -18,8 +18,8 @@ import StartOptions from '@ohos.application.StartOptions';
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
-| Name| Readable| Writable| Type| Mandatory| Description|
+| Name | Readable | Writable | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | -------- | -------- |
-| windowMode | Yes| No| number | No| Window mode.|
-| displayId | Yes| No| number | No| Display ID.|
-
+| [windowMode](js-apis-window.md#windowmode) | Yes| No | number | No | Window mode. |
+| displayId | Yes| No | number | No | Display ID. |
+
diff --git a/en/application-dev/reference/apis/js-apis-application-Want.md b/en/application-dev/reference/apis/js-apis-application-Want.md
index 5eb470dbe514f6993ed16d3e98c018d32742b8d7..19509a5e771ce744b16a8f231faf6f75bccb772b 100644
--- a/en/application-dev/reference/apis/js-apis-application-Want.md
+++ b/en/application-dev/reference/apis/js-apis-application-Want.md
@@ -1,6 +1,6 @@
# Want
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**Want** is the basic communication component of the system.
@@ -17,14 +17,14 @@ import Want from '@ohos.application.Want';
**System capability**: SystemCapability.Ability.AbilityBase
-| Name | Readable/Writable| Type | Mandatory| Description |
-| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ |
-| deviceId | Read only | string | No | ID of the device running the ability. |
-| bundleName | Read only | string | No | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can directly match the specified ability.|
-| abilityName | Read only | string | No | Name of the ability. If both **package** and **AbilityName** are specified in this field in a **Want** object, the **Want** object can directly match the specified ability.|
-| uri | Read only | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
-| type | Read only | string | No | MIME type, for example, **text/plain** or **image/***. |
-| flags | Read only | number | No | How the **Want** object will be handled. By default, numbers are passed in. For details, see [flags](js-apis-featureAbility.md#flags).|
-| action | Read only | string | No | Action option. |
-| parameters | Read only | {[key: string]: any} | No | List of parameters in the **Want** object. |
-| entities | Read only | Array\ | No | List of entities. | |
+ | Name | Readable/Writable | Type | Mandatory | Description |
+ | ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ |
+ | deviceId | Read only | string | No | ID of the device running the ability. |
+ | bundleName | Read only | string | No | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can directly match the specified ability. |
+ | abilityName | Read only | string | No | Name of the ability. If both **package** and **AbilityName** are specified in this field in a **Want** object, the **Want** object can directly match the specified ability. |
+ | uri | Read only | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**. |
+ | type | Read only | string | No | MIME type, for example, **text/plain** or **image/***. |
+ | flags | Read only | number | No | How the **Want** object will be handled. By default, numbers are passed in. For details, see [flags](js-apis-featureAbility.md#flags). |
+ | action | Read only | string | No | Action option. |
+ | parameters | Read only | {[key: string]: any} | No | List of parameters in the **Want** object. |
+ | entities | Read only | Array\ | No | List of entities. |
diff --git a/en/application-dev/reference/apis/js-apis-application-ability.md b/en/application-dev/reference/apis/js-apis-application-ability.md
index 5fce08ac4bc72bb2e7b430c4aa450f7478d80907..bca94a28134524a76e3e2f77f9b832ab620a86af 100644
--- a/en/application-dev/reference/apis/js-apis-application-ability.md
+++ b/en/application-dev/reference/apis/js-apis-application-ability.md
@@ -1,6 +1,6 @@
# Ability
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -18,11 +18,11 @@ import Ability from '@ohos.application.Ability';
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| context | [AbilityContext](js-apis-ability-context.md) | Yes| No| Context of an ability.|
-| launchWant | [Want](js-apis-application-Want.md) | Yes| No| Parameters for starting the ability.|
-| lastRequestWant | [Want](js-apis-application-Want.md) | Yes| No| Parameters used when the ability was started last time.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | context | [AbilityContext](js-apis-ability-context.md) | Yes | No | Context of an ability. |
+ | launchWant | [Want](js-apis-application-Want.md) | Yes | No | Parameters for starting the ability. |
+ | lastRequestWant | [Want](js-apis-application-Want.md) | Yes | No | Parameters used when the ability was started last time. |
## Ability.onCreate
@@ -35,10 +35,10 @@ Called to initialize the service logic when an ability is created.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | want | [Want](js-apis-application-Want.md) | Yes| Information related to this ability, including the ability name and bundle name.|
- | param | AbilityConstant.LaunchParam | Yes| Parameters for starting the ability, and the reason for the last abnormal exit.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | want | [Want](js-apis-application-Want.md) | Yes | Information related to this ability, including the ability name and bundle name. |
+ | param | AbilityConstant.LaunchParam | Yes | Parameters for starting the ability, and the reason for the last abnormal exit. |
**Example**
@@ -61,9 +61,9 @@ Called when a **WindowStage** is created for this ability.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | windowStage | window.WindowStage | Yes| **WindowStage** information.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | windowStage | window.WindowStage | Yes | **WindowStage** information. |
**Example**
@@ -105,9 +105,9 @@ Called when the **WindowStage** is restored during the migration of this ability
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | windowStage | window.WindowStage | Yes| **WindowStage** information.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | windowStage | window.WindowStage | Yes | **WindowStage** information. |
**Example**
@@ -187,15 +187,15 @@ Called to save data during the ability migration preparation process.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | wantParam | {[key: string]: any} | Yes| **want** parameter.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | wantParam | {[key: string]: any} | Yes | **want** parameter. |
**Return value**
- | Type| Description|
- | -------- | -------- |
- | AbilityConstant.OnContinueResult | Continuation result.|
+ | Type | Description |
+ | -------- | -------- |
+ | AbilityConstant.OnContinueResult | Continuation result. |
**Example**
@@ -220,9 +220,9 @@ Called when the ability startup mode is set to singleton.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | want | [Want](js-apis-application-Want.md) | Yes| Want parameters, such as the ability name and bundle name.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | want | [Want](js-apis-application-Want.md) | Yes | Want parameters, such as the ability name and bundle name. |
**Example**
@@ -245,9 +245,9 @@ Called when the configuration of the environment where the ability is running is
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | config | [Configuration](js-apis-configuration.md) | Yes| New configuration.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | config | [Configuration](js-apis-configuration.md) | Yes | New configuration. |
**Example**
@@ -275,16 +275,16 @@ Sends sequenceable data to the target ability.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.|
- | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | method | string | Yes | Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data. |
+ | data | rpc.Sequenceable | Yes | Sequenceable data. You need to customize the data. |
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<void> | Promise used to return a response.|
+ | Type | Description |
+ | -------- | -------- |
+ | Promise<void> | Promise used to return a response. |
**Example**
@@ -345,16 +345,16 @@ Sends sequenceable data to the target ability and obtains the sequenceable data
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.|
- | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | method | string | Yes | Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data. |
+ | data | rpc.Sequenceable | Yes | Sequenceable data. You need to customize the data. |
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<rpc.MessageParcel> | Promise used to return the sequenceable data from the target ability.|
+ | Type | Description |
+ | -------- | -------- |
+ | Promise<rpc.MessageParcel> | Promise used to return the sequenceable data from the target ability. |
**Example**
@@ -451,9 +451,9 @@ Registers a callback that is invoked when the Stub on the target ability is disc
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | OnReleaseCallBack | Yes| Callback used for the **onRelease** API.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | callback | OnReleaseCallBack | Yes | Callback used for the **onRelease** API. |
**Example**
@@ -499,10 +499,10 @@ Registers a caller notification callback, which is invoked when the target abili
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | method | string | Yes| Notification message string negotiated between the two abilities.|
- | callback | CaleeCallBack | Yes| JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | method | string | Yes | Notification message string negotiated between the two abilities. |
+ | callback | CaleeCallBack | Yes | JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails. |
**Example**
@@ -552,9 +552,9 @@ Unregisters a caller notification callback, which is invoked when the target abi
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | method | string | Yes| Registered notification message string.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | method | string | Yes | Registered notification message string. |
**Example**
@@ -575,9 +575,9 @@ Unregisters a caller notification callback, which is invoked when the target abi
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| (msg: string) | function | Yes| No| Prototype of the listener function interface registered by the caller.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | (msg: string) | function | Yes | No | Prototype of the listener function interface registered by the caller. |
## CaleeCallBack
@@ -586,6 +586,6 @@ Unregisters a caller notification callback, which is invoked when the target abi
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes| No| Prototype of the message listener function interface registered by the callee.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes | No | Prototype of the message listener function interface registered by the callee. |
diff --git a/en/application-dev/reference/apis/js-apis-application-abilityConstant.md b/en/application-dev/reference/apis/js-apis-application-abilityConstant.md
index 226288e3cc52b09e3e110bc7b834bc134e23e6ba..1db280b4b8c111250cd1cb4230c5e665184cb0df 100644
--- a/en/application-dev/reference/apis/js-apis-application-abilityConstant.md
+++ b/en/application-dev/reference/apis/js-apis-application-abilityConstant.md
@@ -1,6 +1,6 @@
# AbilityConstant
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -19,10 +19,10 @@ import AbilityConstant from '@ohos.application.AbilityConstant';
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| launchReason | LaunchReason| Yes| Yes| Ability launch reason.|
-| lastExitReason | LastExitReason | Yes| Yes| Reason for the last exit.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | launchReason | LaunchReason | Yes | Yes | Ability launch reason. |
+ | lastExitReason | LastExitReason | Yes | Yes | Reason for the last exit. |
## AbilityConstant.LaunchReason
@@ -30,12 +30,12 @@ Enumerates ability launch reasons.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Value | Description |
-| ----------------------------- | ---- | ------------------------------------------------------------ |
-| UNKNOWN | 0 | Unknown reason.|
-| START_ABILITY | 1 | Ability startup.|
-| CALL | 2 | Call.|
-| CONTINUATION | 3 | Ability continuation.|
+ | Name | Value | Description |
+ | ----------------------------- | ---- | ------------------------------------------------------------ |
+ | UNKNOWN | 0 | Unknown reason. |
+ | START_ABILITY | 1 | Ability startup. |
+ | CALL | 2 | Call. |
+ | CONTINUATION | 3 | Ability continuation. |
## AbilityConstant.LastExitReason
@@ -44,11 +44,11 @@ Enumerates reasons for the last exit.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Value | Description |
-| ----------------------------- | ---- | ------------------------------------------------------------ |
-| UNKNOWN | 0 | Unknown reason.|
-| ABILITY_NOT_RESPONDING | 1 | The ability does not respond.|
-| NORMAL | 2 | Normal status.|
+ | Name | Value | Description |
+ | ----------------------------- | ---- | ------------------------------------------------------------ |
+ | UNKNOWN | 0 | Unknown reason. |
+ | ABILITY_NOT_RESPONDING | 1 | The ability does not respond. |
+ | NORMAL | 2 | Normal status. |
## AbilityConstant.OnContinueResult
@@ -57,8 +57,8 @@ Enumerates ability continuation results.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Value | Description |
-| ----------------------------- | ---- | ------------------------------------------------------------ |
-| AGREE | 0 | Continuation agreed.|
-| REJECT | 1 | Continuation denied.|
-| MISMATCH | 2 | Mismatch.|
+ | Name | Value | Description |
+ | ----------------------------- | ---- | ------------------------------------------------------------ |
+ | AGREE | 0 | Continuation agreed. |
+ | REJECT | 1 | Continuation denied. |
+ | MISMATCH | 2 | Mismatch. |
diff --git a/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md b/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md
index 13cfb0005a19959b23f14334296a9398a0308d0a..9e0d3e602e74c621b139bdc45857f2ce3d395490 100644
--- a/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md
+++ b/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md
@@ -1,6 +1,6 @@
# AbilityDelegator
-> **Note**
+> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -423,7 +423,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------ |
-| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability. |
+| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability. |
| callback | AsyncCallback\ | Yes | Callback used to return the result.|
**Example**
@@ -455,7 +455,7 @@ Starts an ability. This API uses a promise to return the result.
| Name| Type | Mandatory| Description |
| ------ | -------------------------------------- | ---- | --------------- |
-| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability.|
+| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability.|
**Return value**
diff --git a/en/application-dev/reference/apis/js-apis-application-abilitystage.md b/en/application-dev/reference/apis/js-apis-application-abilitystage.md
index 516698bbbc1ddf7b4a3d70a89ef372ad67b48e78..8e501a482e04e33a18a8040d0183257b7c3e90c4 100644
--- a/en/application-dev/reference/apis/js-apis-application-abilitystage.md
+++ b/en/application-dev/reference/apis/js-apis-application-abilitystage.md
@@ -1,6 +1,6 @@
# AbilityStage
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -45,15 +45,15 @@ Called when a specified ability is started.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | want | [Want](js-apis-application-Want.md) | Yes| Information about the ability to start, such as the ability name and bundle name.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | want | [Want](js-apis-application-Want.md) | Yes | Information about the ability to start, such as the ability name and bundle name. |
**Return value**
- | Type| Description|
- | -------- | -------- |
- | string | Returns an ability ID. If this ability has been started, no new instance is created and the ability is placed at the top of the stack. Otherwise, a new instance is created and started.|
+ | Type | Description |
+ | -------- | -------- |
+ | string | Returns an ability ID. If this ability has been started, no new instance is created and the ability is placed at the top of the stack. Otherwise, a new instance is created and started. |
**Example**
@@ -77,9 +77,9 @@ Called when the global configuration is updated.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | config | [Configuration](js-apis-configuration.md) | Yes| Callback invoked when the global configuration is updated. The global configuration indicates the configuration of the environment where the application is running and includes the language and color mode.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | config | [Configuration](js-apis-configuration.md) | Yes | Callback invoked when the global configuration is updated. The global configuration indicates the configuration of the environment where the application is running and includes the language and color mode. |
**Example**
@@ -96,6 +96,6 @@ Describes the configuration information about the context.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Type | Description |
-| ----------- | --------------------------- | ------------------------------------------------------------ |
-| context | [AbilityStageContext](js-apis-featureAbility.md) | Called when initialization is performed during ability startup.|
+ | Name | Type | Description |
+ | ----------- | --------------------------- | ------------------------------------------------------------ |
+ | context | [AbilityStageContext](js-apis-featureAbility.md) | Called when initialization is performed during ability startup. |
diff --git a/en/application-dev/reference/apis/js-apis-application-context.md b/en/application-dev/reference/apis/js-apis-application-context.md
index 4b58792502051c4046f3000d006a1228c1336704..1955bc22b4ae2cb4ec80c1c7e51e7aa616f47a26 100644
--- a/en/application-dev/reference/apis/js-apis-application-context.md
+++ b/en/application-dev/reference/apis/js-apis-application-context.md
@@ -1,6 +1,6 @@
# Context
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -17,18 +17,18 @@ You must extend **AbilityContext** to implement this module.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
- | Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| resourceManager | ResourceManager | Yes| No| **ResourceManager** object.|
-| applicationInfo | ApplicationInfo | Yes| No| Information about the application.|
-| cacheDir | string | Yes| No| Cache directory of the application on the internal storage.|
-| tempDir | string | Yes| No| Temporary file directory of the application.|
-| filesDir | string | Yes| No| File directory of the application on the internal storage.|
-| databaseDir | string | Yes| No| Storage directory of local data.|
-| storageDir | string | Yes| No| Storage directory of lightweight data.|
-| bundleCodeDir | string | Yes| No| Application installation path.|
-| distributedFilesDir | string | Yes| No| Storage directory of distributed application data files.|
-| eventHub | [EventHub](js-apis-eventhub.md) | Yes| No| Event hub information.|
+ | Name | Type | Readable | Writable | Description |
+ | -------- | -------- | -------- | -------- | -------- |
+ | resourceManager | ResourceManager | Yes | No | **ResourceManager** object. |
+ | applicationInfo | ApplicationInfo | Yes | No | Information about the application. |
+ | cacheDir | string | Yes | No | Cache directory of the application on the internal storage. |
+ | tempDir | string | Yes | No | Temporary file directory of the application. |
+ | filesDir | string | Yes | No | File directory of the application on the internal storage. |
+ | databaseDir | string | Yes | No | Storage directory of local data. |
+ | storageDir | string | Yes | No | Storage directory of lightweight data. |
+ | bundleCodeDir | string | Yes | No | Application installation path. |
+ | distributedFilesDir | string | Yes | No | Storage directory of distributed application data files. |
+ | eventHub | [EventHub](js-apis-eventhub.md) | Yes | No | Event hub information. |
## Context.createBundleContext
@@ -41,15 +41,15 @@ Creates an application context.
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | bundleName | string | Yes| Application bundle name.|
+ | Name | Type | Mandatory | Description |
+ | -------- | -------- | -------- | -------- |
+ | bundleName | string | Yes | Application bundle name. |
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Context | Context of the application created.|
+ | Type | Description |
+ | -------- | -------- |
+ | Context | Context of the application created. |
**Example**
@@ -69,9 +69,9 @@ Obtains the context of this application.
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Context | Context obtained.|
+ | Type | Description |
+ | -------- | -------- |
+ | Context | Context obtained. |
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md b/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
index 3f3a515587165c72d8fd46b495f6c68b1d9cae69..0a0a18ae37b50456db8c5e9d81ebceaaf675f18f 100644
--- a/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
+++ b/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
@@ -1,7 +1,7 @@
# StaticSubscriberExtensionAbility
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -20,9 +20,9 @@ Callback of the common event of a static subscriber.
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
- | event | CommonEventData | Yes| Callback of the common event of a static subscriber.|
+ | event | CommonEventData | Yes | Callback of the common event of a static subscriber. |
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-audio.md b/en/application-dev/reference/apis/js-apis-audio.md
index 71f5f2a90b50513c194c3dad027b86abcb296984..e03b03206e91eac28dab5d3efa8cf5feb3b95918 100644
--- a/en/application-dev/reference/apis/js-apis-audio.md
+++ b/en/application-dev/reference/apis/js-apis-audio.md
@@ -480,8 +480,6 @@ Describes audio stream information.
**System capability:** SystemCapability.Multimedia.Audio.Core
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :------------ | :---------------------------------------- | :-------- | :-------------------- |
| samplingRate | [AudioSamplingRate](#audiosamplingrate8) | Yes | Sampling rate. |
@@ -495,8 +493,6 @@ Describes audio renderer information.
**System capability:** SystemCapability.Multimedia.Audio.Core
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :------------ | :-------------------------- | :-------- | :-------------------- |
| contentType | [ContentType](#contenttype) | Yes | Content type. |
@@ -509,8 +505,6 @@ Describes audio renderer configuration options.
**System capability:** SystemCapability.Multimedia.Audio.Renderer
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :------------ | :-----------------------------------------| :-------- | :-------------------- |
| streamInfo | [AudioStreamInfo](#audiostreaminfo8) | Yes | Stream information. |
@@ -522,8 +516,6 @@ Describes audio capturer information.
**System capability:** SystemCapability.Multimedia.Audio.Core
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :---------------| :------------------------- | :-------- | :-------------------- |
| source | [SourceType](#sourcetype) | Yes | Audio source type. |
@@ -535,8 +527,6 @@ Describes audio capturer configuration options.
**System capability:** SystemCapability.Multimedia.Audio.Capturer
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :------------ | :-----------------------------------------| :-------- | :-------------------- |
| streamInfo | [AudioStreamInfo](#audiostreaminfo8) | Yes | Stream information. |
@@ -548,8 +538,6 @@ Describes the interrupt event received by the app when playback is interrupted.
**System capability:** SystemCapability.Multimedia.Audio.Renderer
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :-------- | :-------------------------------------------- | :-------- | :---------------------------------------------------------------- |
| eventType | [InterruptType](#interrupttype) | Yes | Whether the interruption has started or finished. |
@@ -592,8 +580,6 @@ This is a system API and cannot be called by third-party applications.
**System capability:** SystemCapability.Multimedia.Audio.Volume
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :--------- | :---------------------------------- | :-------- | :--------------------------------------- |
| volumeType | [AudioVolumeType](#audiovolumetype) | Yes | Volume type of the current stream. |
@@ -606,8 +592,6 @@ Describes the device change type and device information.
**System capability:** SystemCapability.Multimedia.Audio.Device
-**Parameters:**
-
| Name | Type | Mandatory | Description |
| :------------------ | :------------------------------------------------ | :-------- | :------------------ |
| type | [DeviceChangeType](#devicechangetype) | Yes | Device change type. |
diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md
index 4d2b6c07f8170d6f930fc6522095967c3f608f92..cda24e954d1a7e4d6417e0e295af077c01d1f3a3 100644
--- a/en/application-dev/reference/apis/js-apis-call.md
+++ b/en/application-dev/reference/apis/js-apis-call.md
@@ -7,7 +7,7 @@
## Modules to Import
-```
+```js
import call from '@ohos.telephony.call';
```
@@ -30,7 +30,7 @@ Initiates a call. This API uses an asynchronous callback to return the execution
**Example**
-```
+```js
call.dial("138xxxxxxxx", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
@@ -57,7 +57,7 @@ Initiates a call. You can set call options as needed. This API uses an asynchron
**Example**
-```
+```js
call.dial("138xxxxxxxx", {
extras: false
}, (err, data) => {
@@ -91,7 +91,7 @@ Initiates a call. You can set call options as needed. This API uses a promise to
**Example**
-```
+```js
let promise = call.dial("138xxxxxxxx", {
extras: false
});
@@ -121,7 +121,7 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**Example**
-```
+```js
call.makeCall("138xxxxxxxx", err => {
console.log(`makeCall callback: err->${JSON.stringify(err)}`);
});
@@ -152,7 +152,7 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**Example**
-```
+```js
let promise = call.makeCall("138xxxxxxxx");
promise.then(() => {
console.log(`makeCall success`);
@@ -177,7 +177,7 @@ Checks whether a call is in progress. This API uses an asynchronous callback to
**Example**
-```
+```js
call.hasCall((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
@@ -200,7 +200,7 @@ Checks whether a call is in progress. This API uses a promise to return the resu
**Example**
-```
+```js
let promise = call.hasCall();
promise.then(data => {
console.log(`hasCall success, promise: data->${JSON.stringify(data)}`);
@@ -226,7 +226,7 @@ Obtains the call status. This API uses an asynchronous callback to return the re
**Example**
-```
+```js
call.getCallState((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
@@ -249,7 +249,7 @@ Obtains the call status. This API uses a promise to return the result.
**Example**
-```
+```js
let promise = call.getCallState();
promise.then(data => {
console.log(`getCallState success, promise: data->${JSON.stringify(data)}`);
@@ -272,7 +272,7 @@ Checks whether a device supports voice calls. This API works in synchronous mode
| ------- | ------------------------------------------------------------ |
| boolean | - **true**: The device supports voice calls. - **false**: The device does not support voice calls.|
-```
+```js
let result = call.hasVoiceCapability();
console.log(`hasVoiceCapability: ${JSON.stringify(result)}`);
```
@@ -294,7 +294,7 @@ Checks whether the call number of the SIM card in the specified slot is an emerg
**Example**
-```
+```js
call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
@@ -319,7 +319,7 @@ Checks whether the call number of the SIM card in the specified slot is an emerg
**Example**
-```
+```js
call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, value) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
@@ -349,7 +349,7 @@ Checks whether the call number of the SIM card in the specified slot is an emerg
**Example**
-```
+```js
let promise = call.isEmergencyPhoneNumber("138xxxxxxxx", {slotId: 1});
promise.then(data => {
console.log(`isEmergencyPhoneNumber success, promise: data->${JSON.stringify(data)}`);
@@ -375,7 +375,7 @@ Formats a phone number based on the specified ISO country code. This API uses an
**Example**
-```
+```js
call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
@@ -400,7 +400,7 @@ Formats a phone number based on specified formatting options. This API uses an a
**Example**
-```
+```js
call.formatPhoneNumber("138xxxxxxxx",{
countryCode: "CN"
}, (err, data) => {
@@ -432,7 +432,7 @@ Formats a phone number based on specified formatting options. This API uses a pr
**Example**
-```
+```js
let promise = call.formatPhoneNumber("138xxxxxxxx", {
countryCode: "CN"
});
@@ -465,7 +465,7 @@ All country codes are supported.
**Example**
-```
+```js
call.formatPhoneNumberToE164("138xxxxxxxx",{
countryCode: "CN"
}, (err, data) => {
@@ -501,7 +501,7 @@ All country codes are supported.
**Example**
-```
+```js
let promise = call.formatPhoneNumberToE164("138xxxxxxxx", {
countryCode: "CN"
});
diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md
index 6a51a41b6fba50c1c4f7a061d313482e1df57ad9..7229bf0f4c6b812c6ec52d26c0d6f289858725e9 100644
--- a/en/application-dev/reference/apis/js-apis-camera.md
+++ b/en/application-dev/reference/apis/js-apis-camera.md
@@ -1,6 +1,6 @@
-# Camera
+# Camera Management
->  **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -11,25 +11,22 @@ import camera from '@ohos.multimedia.camera';
## Required Permissions
-```
ohos.permission.CAMERA
-```
-## getCameraManager(context: Context, callback: AsyncCallback): void;
-**System Capabilities:**
+## camera.getCameraManager
-SystemCapability.Multimedia.Camera.Core
+getCameraManager(context: Context, callback: AsyncCallback): void
-**Description**
+Obtains a **CameraManager** instance. This API uses an asynchronous callback to return the result.
-Gets a **CameraManager** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|-------------------------------|-----------|-----------------------------------------------------|
-| context | Context | Yes | Application context |
-| callback | AsyncCallback | Yes | Callback used to return the CameraManager instance |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------- | ---- | ---------------------------------- |
+| context | Context | Yes | Application context. |
+| callback | AsyncCallback<[CameraManager](#cameramanager)\> | Yes | Callback used to return the **CameraManager** instance.|
**Example**
@@ -43,116 +40,105 @@ camera.getCameraManager(context, (err, cameraManager) => {
});
```
-## getCameraManager(context: Context): Promise;
-
-**System Capabilities:**
+## camera.getCameraManager
-SystemCapability.Multimedia.Camera.Core
+getCameraManager(context: Context): Promise
-**Description**
+Obtains a **CameraManager** instance. This API uses a promise to return the result.
-Gets a **CameraManager** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|----------------------------|
-| context | Context | Yes | Application context |
+| Name | Type | Mandatory| Description |
+| ------- | ------- | ---- | ------------ |
+| context | Context | Yes | Application context.|
-**Return values**
+**Return value**
-| Type | Description |
-|-------------------------|--------------------------------------------------------|
-| Promise | Promise used to return the **CameraManager** instance |
+| Type | Description |
+| ----------------------------------------- | ----------------------------------------- |
+| Promise<[CameraManager](#cameramanager)\> | Promise used to return the **CameraManager** instance.|
**Example**
```
-camera.getCameraManager(context).then((cameraManger) => {
+camera.getCameraManager(context).then((cameraManager) => {
console.log('Promise returned with the CameraManager instance.');
})
```
-## CameraStatus
+## CameraStatus
-Enumerates camera status types.
+Enumerates the camera statuses.
-**System Capabilities:**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-SystemCapability.Multimedia.Camera.Core
+| Name | Default Value| Description |
+| ------------------------- | ------ | ------------ |
+| CAMERA_STATUS_APPEAR | 0 | The camera exists. |
+| CAMERA_STATUS_DISAPPEAR | 1 | The camera does not exist.|
+| CAMERA_STATUS_AVAILABLE | 2 | The camera is ready. |
+| CAMERA_STATUS_UNAVAILABLE | 3 | The camera is not ready.|
-| Name | Default Value | Description |
-|---------------------------|---------------|--------------------|
-| CAMERA_STATUS_APPEAR | 0 | Camera appear |
-| CAMERA_STATUS_DISAPPEAR | 1 | Camera disappear |
-| CAMERA_STATUS_AVAILABLE | 2 | Camera available |
-| CAMERA_STATUS_UNAVAILABLE | 3 | Camera unavailable |
-
-## CameraPosition
+## CameraPosition
Enumerates the camera positions.
-**System Capabilities:**
-
-SystemCapability.Multimedia.Camera.Core
+**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Default value | Description |
-|-----------------------------|---------------|-----------------------|
-| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position |
-| CAMERA_POSITION_BACK | 1 | Rear camera |
-| CAMERA_POSITION_FRONT | 2 | Front camera |
+| Name | Default Value| Description |
+| --------------------------- | ------ | ---------------- |
+| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position.|
+| CAMERA_POSITION_BACK | 1 | Rear camera. |
+| CAMERA_POSITION_FRONT | 2 | Front camera. |
-## CameraType
+## CameraType
Enumerates the camera types.
-**System Capabilities:**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-SystemCapability.Multimedia.Camera.Core
+| Name | Default Value| Description |
+| ----------------------- | ------ | ---------------- |
+| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type.|
+| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera. |
+| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera. |
+| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera. |
+| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera. |
-| Name | Default value | Description |
-|-------------------------|---------------|-------------------------|
-| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type |
-| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera |
-| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera |
-| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera |
-| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera |
+## ConnectionType
-## ConnectionType
+Enumerates the camera connection types.
-Enumerates camera connection types.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**System Capabilities:**
+| Name | Default Value| Description |
+| ---------------------------- | ------ | ------------- |
+| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera. |
+| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB.|
+| CAMERA_CONNECTION_REMOTE | 2 | Remote camera. |
-SystemCapability.Multimedia.Camera.Core
-| Name | Default value | Description |
-|------------------------------|---------------|----------------------------|
-| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera |
-| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB |
-| CAMERA_CONNECTION_REMOTE | 2 | Remote camera |
+## CameraManager
-## CameraManager
+Implements camera management. Before calling any API in **CameraManager**, you must use **getCameraManager** to obtain a **CameraManager** instance.
-Implements camera management, including getting supported cameras and creating **CameraInput** instances.
+### getCameras
-### getCameras(callback: AsyncCallback\>): void;
+getCameras(callback: AsyncCallback\>): void
-**System Capabilities:**
+Obtains all cameras supported by the device. This API uses an asynchronous callback to return the array of supported cameras.
-SystemCapability.Multimedia.Camera.Core
-
-**Description**
-
-Gets all cameras supported by the device. This method uses an asynchronous callback to return the array of supported cameras.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|--------------------------------|-----------|---------------------------------------------------------|
-| callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------- | ---- | ------------------------------------ |
+| callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras.|
**Example**
@@ -166,21 +152,19 @@ cameraManager.getCameras((err, cameras) => {
})
```
-### getCameras(): Promise\>;
+### getCameras
-**System Capabilities:**
+getCameras(): Promise\>
-SystemCapability.Multimedia.Camera.Core
+Obtains all cameras supported by the device. This API uses a promise to return the array of supported cameras.
-**Description**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-Gets all cameras supported by the device. This method uses a promise to return the array of supported cameras.
+**Return value**
-**Return values**
-
-| Type | Description |
-|------------------------|--------------------------------------------------------|
-| Promise\> | Promise used to return an array of supported cameras |
+| Type | Description |
+| ----------------------------------- | ----------------------------- |
+| Promise\> | Promise used to return the array of supported cameras.|
**Example**
@@ -191,22 +175,20 @@ cameraManager.getCameras().then((cameraArray) => {
})
```
-### createCameraInput(cameraId: string, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### createCameraInput
-SystemCapability.Multimedia.Camera.Core
+createCameraInput(cameraId: string, callback: AsyncCallback): void
-**Description**
+Creates a **CameraInput** instance with the specified camera ID. This API uses an asynchronous callback to return the instance.
-Creates a **CameraInput** instance with the specified camera ID. This method uses an asynchronous callback to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Default value | Mandatory | Description |
-|----------|------------------------------|-----------|--------------------------------------------------|
-| cameraId | string | Yes | Camera ID used to create the instance |
-| callback | AsyncCallback | Yes | Callback used to return the CameraInput instance |
+| Name | Default Value | Mandatory| Description |
+| -------- | ------------------------------------------- | ---- | ----------------------------------- |
+| cameraId | string | Yes | Camera ID used to create the instance. |
+| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance.|
**Example**
@@ -220,27 +202,25 @@ cameraManager.createCameraInput(cameraId, (err, cameraInput) => {
})
```
-### createCameraInput(cameraId: string): Promise;
+### createCameraInput
-**System Capabilities:**
+createCameraInput(cameraId: string): Promise
-SystemCapability.Multimedia.Camera.Core
+Creates a **CameraInput** instance with the specified camera ID. This API uses a promise to return the instance.
-**Description**
-
-Creates a **CameraInput** instance with the specified camera ID. This method uses a promise to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Default value | Mandatory | Description |
-|----------|-----------------------------|-----------|------------------------------------------|
-| cameraId | string | Yes | Camera ID used to create the instance |
+| Name | Default Value| Mandatory| Description |
+| -------- | ------ | ---- | ------------ |
+| cameraId | string | Yes | Camera ID used to create the instance.|
-**Return values**
+**Return value**
-| Type | Description |
-|-------------------------|-------------------------------------------------|
-| Promise | Promise used to return the CameraInput instance |
+| Type | Description |
+| ------------------------------------- | ---------------------------------------- |
+| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
**Example**
@@ -250,23 +230,21 @@ cameraManager.createCameraInput(cameraId).then((cameraInput) => {
})
```
-### createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### createCameraInput
-SystemCapability.Multimedia.Camera.Core
+createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void
-**Description**
+Creates a **CameraInput** instance with the specified camera position and camera type. This API uses an asynchronous callback to return the instance.
-Creates a **CameraInput** instance with the specified camera position and camera type. This method uses an asynchronous callback to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|-----------------------------|-----------|---------------------------------------------------|
-| position | CameraPosition | Yes | Camera position |
-| type | CameraType | Yes | Camera type |
-| callback | AsyncCallback | Yes | Callback used to return the CameraInput instance |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------- | ---- | ----------------------------------- |
+| position | [CameraPosition](#cameraposition) | Yes | Camera position. |
+| type | [CameraType](#cameratype) | Yes | Camera type. |
+| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance.|
**Example**
@@ -280,28 +258,26 @@ cameraManager.createCameraInput(cameraPosition, cameraType, (err, cameraInput) =
})
```
-### createCameraInput(position: CameraPosition, type: CameraType): Promise;
-
-**System Capabilities:**
+### createCameraInput
-SystemCapability.Multimedia.Camera.Core
+createCameraInput(position: CameraPosition, type: CameraType): Promise
-**Description**
+Creates a **CameraInput** instance with the specified camera position and camera type. This API uses a promise to return the instance.
-Creates a **CameraInput** instance with the specified camera position and camera type. This method uses a promise to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------------|-----------|----------------------------------------|
-| position | CameraPosition | Yes | Camera position |
-| type | CameraType | Yes | Camera type |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------- | ---- | ---------- |
+| position | [CameraPosition](#cameraposition) | Yes | Camera position.|
+| type | [CameraType](#cameratype) | Yes | Camera type.|
-**Return values**
+**Return value**
-| Type | Description |
-|-------------------------|-------------------------------------------------|
-| Promise | Promise used to return the CameraInput instance |
+| Type | Description |
+| ------------------------------------- | ---------------------------------------- |
+| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
**Example**
@@ -311,22 +287,20 @@ cameraManager.createCameraInput(cameraPosition, cameraType).then((cameraInput) =
})
```
-### on(type: 'cameraStatus', callback: Callback): void;
+### on('cameraStatus')
-**System Capabilities:**
+on(type: 'cameraStatus', callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Listens for camera status changes. This API uses a callback to return the camera status changes.
-**Description**
-
-Listens for camera status changes. This method uses a callback to get camera status changes.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| :------- | :--------------------- | :-------- | :--------------------------------------------------- |
-| type | string | Yes | Camera status event. |
-| callback | Callback | Yes | Callback used to get the camera status change. |
+| Name | Type | Mandatory| Description |
+| :------- | :---------------------------------------------------- | :--- | :--------------------------------------------------- |
+| type | string | Yes | Type of event to listen for. The value is fixed at **cameraStatus**, indicating the camera status change event.|
+| callback | AsyncCallback<[CameraStatusInfo](#camerastatusinfo)\> | Yes | Callback used to return the camera status change. |
**Example**
@@ -337,22 +311,20 @@ cameraManager.on('cameraStatus', (cameraStatusInfo) => {
})
```
-## Camera
-
-when we call *cameraManager.getCameras()* API, then it will return the **Camera** class which will have all camera-related metadata such as *cameraId, cameraPosition, cameraType & connectionType*.
+## Camera
-**System Capabilities:**
+After **[camera.getCameraManager](#cameragetcameramanager)** is called, a camera instance is returned, including camera-related metadata such as **cameraId**, **cameraPosition**, **cameraType**, and **connectionType**.
-SystemCapability.Multimedia.Camera.Core
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Fields**
+| Name | Type | Read only| Description |
+| -------------- | --------------------------------- | ---- | -------------- |
+| cameraId | string | Yes | Camera ID. |
+| cameraPosition | [CameraPosition](#cameraposition) | Yes | Camera position. |
+| cameraType | [CameraType](#cameratype) | Yes | Camera type. |
+| connectionType | [ConnectionType](#connectiontype) | Yes | Camera connection type.|
-| Name | Type | Access | Description |
-|----------------|----------------|----------|------------------------|
-| cameraId | string | readonly | Camera ID |
-| cameraPosition | cameraPosition | readonly | Camera position |
-| cameraType | cameraType | readonly | Camera type |
-| connectionType | connectionType | readonly | Camera connection type |
+**Example**
```
async function getCameraInfo() {
@@ -367,41 +339,37 @@ async function getCameraInfo() {
```
-## CameraStatusInfo
-
-This interface is a CameraManager callback API return. **CameraStatusInfo** will have *Camera* class & *CameraStatus* predefine constants.From *Camera* class, we can have all camera-related metadata & from *CameraStatus* constants, we will have information such as *APPEAR, DISAPPEAR, AVAILABLE & UNAVAILABLE*.
-
-**System Capabilities:**
-
-SystemCapability.Multimedia.Camera.Core
+## CameraStatusInfo
-**Fields**
+Describes the camera status information.
-| Name | Type | Description |
-|----------------|----------------|------------------|
-| camera | Camera | Camera object |
-| status | CameraStatus | Camera status |
+**System capability**: SystemCapability.Multimedia.Camera.Core
+| Name | Type | Description |
+| ------ | ----------------------------- | ---------- |
+| camera | [Camera](#camera) | Camera object.|
+| status | [CameraStatus](#camerastatus) | Camera status.|
-## CameraInput
-Implements a **CameraInput** instance.
+## CameraInput
-### getCameraId(callback: AsyncCallback\): void;
+Implements a **CameraInput** instance. Before calling any API in **CameraInput**, you must create a **CameraInput** instance.
-**System Capabilities:**
+### getCameraId
-SystemCapability.Multimedia.Camera.Core
+getCameraId(callback: AsyncCallback\): void
-**Description**
+Obtains the camera ID based on which this **CameraInput** instance is created. This API uses an asynchronous callback to return the camera ID.
-Gets the camera ID based on which this **CameraInput** instance is created. This method uses an asynchronous callback to return the camera ID.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|------------------------|-----------|---------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the camera ID |
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | -------------------------- |
+| callback | AsyncCallback | Yes | Callback used to return the camera ID.|
+
+**Example**
```
cameraInput.getCameraId((err, cameraId) => {
@@ -413,21 +381,19 @@ cameraInput.getCameraId((err, cameraId) => {
})
```
-### getCameraId(): Promise;
-
-**System Capabilities:**
+### getCameraId
-SystemCapability.Multimedia.Camera.Core
+getCameraId(): Promise
-**Description**
+Obtains the camera ID based on which this **CameraInput** instance is created. This API uses a promise to return the camera ID.
-Gets the camera ID based on which this **CameraInput** instance is created. This method uses a promise to return the camera ID.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|------------------------|--------------------------------------|
-| Promise | Promise used to return the camera ID |
+| Type | Description |
+| ---------------- | ----------------------------- |
+| Promise | Promise used to return the camera ID.|
**Example**
@@ -437,21 +403,20 @@ cameraInput.getCameraId().then((cameraId) => {
})
```
-### hasFlash(callback: AsyncCallback): void;
-**System Capabilities:**
+### hasFlash
-SystemCapability.Multimedia.Camera.Core
+hasFlash(callback: AsyncCallback): void
-**Description**
+Checks whether the device has flash light. This API uses an asynchronous callback to return the result.
-Checks whether the device has flash light. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|-------------------------|-----------|----------------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the flash light support status |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------- | ---- | -------------------------------------- |
+| callback | AsyncCallback | Yes | Callback used to return the flash light support status. The value **true** means that the device has flash light.|
**Example**
@@ -465,21 +430,19 @@ cameraInput.hasFlash((err, status) => {
})
```
-### hasFlash(): Promise;
+### hasFlash
-**System Capabilities:**
+hasFlash(): Promise
-SystemCapability.Multimedia.Camera.Core
+Checks whether the device has flash light. This API uses a promise to return the result.
-**Description**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-Checks whether the device has flash light. This method uses a promise to return the result.
+**Return value**
-**Return values**
-
-| Type | Description |
-|-----------------------|--------------------------------------------------------|
-| Promise | Promise used to return the flash light support status |
+| Type | Description |
+| ----------------- | ------------------------------------------------------- |
+| Promise | Promise used to return the flash light support status. The value **true** means that the device has flash light.|
**Example**
@@ -489,22 +452,20 @@ cameraInput.hasFlash().then((status) => {
})
```
-### isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### isFlashModeSupported
-SystemCapability.Multimedia.Camera.Core
+isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void
-**Description**
+Checks whether a specified flash mode is supported. This API uses an asynchronous callback to return the result.
-Checks whether a specified flash mode is supported. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| flashMode | FlashMode | Yes | Flash mode |
-| callback | AsyncCallback | Yes | Callback used to return the device flash support status |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------------------------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
+| callback | AsyncCallback | Yes | Callback used to return the flash mode support status. The value **true** means that the specified flash mode is supported.|
**Example**
@@ -518,27 +479,25 @@ cameraInput.isFlashModeSupported(flashMode, (err, status) => {
})
```
-### isFlashModeSupported(flashMode: FlashMode): Promise;
+### isFlashModeSupported
-**System Capabilities:**
+isFlashModeSupported(flashMode: FlashMode): Promise
-SystemCapability.Multimedia.Camera.Core
+Checks whether a specified flash mode is supported. This API uses a promise to return the result.
-**Description**
-
-Checks whether a specified flash mode is supported. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| flashMode | FlashMode | Yes | Flash mode |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode.|
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|---------------------------------------------------|
-| Promise | Promise used to return flash mode support status. |
+| Type | Description |
+| ----------------- | ------------------------------------------------------------ |
+| Promise | Promise used to return the flash mode support status. The value **true** means that the specified flash mode is supported.|
**Example**
@@ -548,24 +507,25 @@ cameraInput.isFlashModeSupported(flashMode).then((status) => {
})
```
-### setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
+### setFlashMode
-**System Capabilities:**
+setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Sets the flash mode. This API uses an asynchronous callback to return the result.
-**Description**
+Before setting the parameters, do the following checks:
-Sets flash mode. This method uses an asynchronous callback to return the result.
+1. Use [hasFlash](#hasflash) to check whether the device has flash light.
+2. Use [isFlashModeSupported](#isflashmodesupported) to check whether the device supports a specified flash mode.
-Note: Before setting the flash mode, check the support for the flash light (hasFlash method) and flash mode support (isFlashModeSupported method);
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| flashMode | FlashMode | Yes | Flash mode |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ------------------------ |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -579,29 +539,30 @@ cameraInput.setFlashMode(flashMode, (err) => {
})
```
-### setFlashMode(flashMode: FlashMode): Promise |
---|