From 89b754cd6f94028b4a307589bae1ef3ac07f8cf9 Mon Sep 17 00:00:00 2001 From: esterzhou Date: Tue, 27 Dec 2022 13:44:01 +0800 Subject: [PATCH] update doc (11895) Signed-off-by: esterzhou --- en/application-dev/reference/Readme-EN.md | 5 +- .../figures/20220329-103626.gif | Bin .../figures/image-20220326064841782.png | Bin .../figures/image-20220326064913834.png | Bin .../figures/image-20220326064955505.png | Bin .../figures/image-20220326065043006.png | Bin .../figures/image-20220326065124911.png | Bin .../figures/image-20220326065201867.png | Bin .../figures/image-20220326072448840.png | Bin .../{quick-start => reference}/syscap.md | 66 ++++++------------ 10 files changed, 27 insertions(+), 44 deletions(-) rename en/application-dev/{quick-start => reference}/figures/20220329-103626.gif (100%) rename en/application-dev/{quick-start => reference}/figures/image-20220326064841782.png (100%) rename en/application-dev/{quick-start => reference}/figures/image-20220326064913834.png (100%) rename en/application-dev/{quick-start => reference}/figures/image-20220326064955505.png (100%) rename en/application-dev/{quick-start => reference}/figures/image-20220326065043006.png (100%) rename en/application-dev/{quick-start => reference}/figures/image-20220326065124911.png (100%) rename en/application-dev/{quick-start => reference}/figures/image-20220326065201867.png (100%) rename en/application-dev/{quick-start => reference}/figures/image-20220326072448840.png (100%) rename en/application-dev/{quick-start => reference}/syscap.md (84%) diff --git a/en/application-dev/reference/Readme-EN.md b/en/application-dev/reference/Readme-EN.md index e5e4ee0ea6..80356f76fa 100644 --- a/en/application-dev/reference/Readme-EN.md +++ b/en/application-dev/reference/Readme-EN.md @@ -1,8 +1,11 @@ # Development References +- [SystemCapability](syscap.md) - [SysCap List](syscap-list.md) - [Component Reference (ArkTS-based Declarative Development Paradigm)](arkui-ts/Readme-EN.md) - [Component Reference (JavaScript-compatible Web-like Development Paradigm)](arkui-js/Readme-EN.md) -- [API Reference (JS and TS APIs)](apis/Readme-EN.md) +- [JS Service Widget UI Component Reference](js-service-widget-ui/Readme-EN.md) +- [API Reference (ArkTS and JS APIs)](apis/Readme-EN.md) +- [Error Codes](errorcodes/Readme-EN.md) - API Reference (Native APIs) - [Standard Libraries Supported by Native APIs](native-lib/Readme-EN.md) diff --git a/en/application-dev/quick-start/figures/20220329-103626.gif b/en/application-dev/reference/figures/20220329-103626.gif similarity index 100% rename from en/application-dev/quick-start/figures/20220329-103626.gif rename to en/application-dev/reference/figures/20220329-103626.gif diff --git a/en/application-dev/quick-start/figures/image-20220326064841782.png b/en/application-dev/reference/figures/image-20220326064841782.png similarity index 100% rename from en/application-dev/quick-start/figures/image-20220326064841782.png rename to en/application-dev/reference/figures/image-20220326064841782.png diff --git a/en/application-dev/quick-start/figures/image-20220326064913834.png b/en/application-dev/reference/figures/image-20220326064913834.png similarity index 100% rename from en/application-dev/quick-start/figures/image-20220326064913834.png rename to en/application-dev/reference/figures/image-20220326064913834.png diff --git a/en/application-dev/quick-start/figures/image-20220326064955505.png b/en/application-dev/reference/figures/image-20220326064955505.png similarity index 100% rename from en/application-dev/quick-start/figures/image-20220326064955505.png rename to en/application-dev/reference/figures/image-20220326064955505.png diff --git a/en/application-dev/quick-start/figures/image-20220326065043006.png b/en/application-dev/reference/figures/image-20220326065043006.png similarity index 100% rename from en/application-dev/quick-start/figures/image-20220326065043006.png rename to en/application-dev/reference/figures/image-20220326065043006.png diff --git a/en/application-dev/quick-start/figures/image-20220326065124911.png b/en/application-dev/reference/figures/image-20220326065124911.png similarity index 100% rename from en/application-dev/quick-start/figures/image-20220326065124911.png rename to en/application-dev/reference/figures/image-20220326065124911.png diff --git a/en/application-dev/quick-start/figures/image-20220326065201867.png b/en/application-dev/reference/figures/image-20220326065201867.png similarity index 100% rename from en/application-dev/quick-start/figures/image-20220326065201867.png rename to en/application-dev/reference/figures/image-20220326065201867.png diff --git a/en/application-dev/quick-start/figures/image-20220326072448840.png b/en/application-dev/reference/figures/image-20220326072448840.png similarity index 100% rename from en/application-dev/quick-start/figures/image-20220326072448840.png rename to en/application-dev/reference/figures/image-20220326072448840.png diff --git a/en/application-dev/quick-start/syscap.md b/en/application-dev/reference/syscap.md similarity index 84% rename from en/application-dev/quick-start/syscap.md rename to en/application-dev/reference/syscap.md index 07570f1359..295ec50046 100644 --- a/en/application-dev/quick-start/syscap.md +++ b/en/application-dev/reference/syscap.md @@ -1,17 +1,15 @@ -# SysCap +# SystemCapability ## Overview ### System Capabilities and APIs -SysCap is short for System Capability. It refers to a standalone feature in the operating system, for example, Bluetooth, Wi-Fi, NFC, or camera. Each SysCap corresponds to a set of bound APIs, whose availability depends on the support of the target device. Such a set of APIs can be provided in DevEco Studio for association. +SysCap is short for SystemCapability. It refers to a standalone feature in the operating system, for example, Bluetooth, Wi-Fi, NFC, or camera. Each SysCap corresponds to a set of APIs, whose availability depends on the support of the target device. Such a set of APIs can be provided in DevEco Studio for association. ![image-20220326064841782](figures/image-20220326064841782.png) For details about the SysCap sets in OpenHarmony, see [SysCap List](../reference/syscap-list.md). - - ### Supported SysCap Set, Associated SysCap Set, and Required SysCap Set The supported SysCap set, associated SysCap set, and required SysCap set are collections of SysCaps. @@ -20,8 +18,6 @@ The associated SysCap set covers the system capabilities of associated APIs that ![image-20220326064913834](figures/image-20220326064913834.png) - - ### Devices and Supported SysCap Sets Each device provides a SysCap set that matches its hardware capability. @@ -29,24 +25,18 @@ The SDK classifies devices into general devices and custom devices. The general ![image-20220326064955505](figures/image-20220326064955505.png) - - ### Mapping Between Devices and SDK Capabilities -The SDK provides a full set of APIs for DevEco Studio. DevEco Studio identifies the supported SysCap set based on the devices supported by the project, filters the APIs contained in the SysCap set, and provides the supported APIs for association (to autocomplete input). +The SDK provides a full set of APIs for DevEco Studio. DevEco Studio identifies the supported SysCap set based on the devices selected for the project, filters the APIs contained in the SysCap set, and provides the supported APIs for association (to autocomplete input). ![image-20220326065043006](figures/image-20220326065043006.png) - - ## How to Develop ### Obtaining the PCID The Product Compatibility ID (PCID) contains the SysCap information supported by the current device. For the moment, you can obtain the PCID of a device from the device vendor. In the future, you'll be able to obtain the PCIDs of all devices from the authentication center, which is in development. - - ### Importing the PCID DevEco Studio allows Product Compatibility ID (PCID) imports for projects. After the imported PCID file is decoded, the SysCap is output and written into the **syscap.json** file. @@ -55,8 +45,6 @@ Right-click the project directory and choose **Import Product Compatibility ID** ![20220329-103626](figures/20220329-103626.gif) - - ### Configuring the Associated SysCap Set and Required SysCap Set DevEco Studio automatically configures the associated SysCap set and required SysCap set based on the settings supported by the created project. You can modify these SysCap sets when necessary. @@ -91,51 +79,44 @@ Exercise caution when modifying the required SysCap set. Incorrect modifications } ``` - - ### Single-Device Application Development By default, the associated SysCap set and required SysCap set of the application are the same as the supported SysCap set of the device. Exercise caution when modifying the required SysCap set. ![image-20220326065124911](figures/image-20220326065124911.png) - - ### Cross-Device Application Development By default, the associated SysCap set of an application is the union of multiple devices' supported SysCap sets, while the required SysCap set is the intersection of the devices' supported SysCap sets. ![image-20220326065201867](figures/image-20220326065201867.png) - - ### Checking Whether an API Is Available -Use **canIUse** if you want to check whether a project supports a specific SysCap. +- Method 1: Use the **canIUse** API predefined in OpenHarmony. -``` -if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) { - console.log("This application supports SystemCapability.ArkUI.ArkUI.Full."); -} else { - console.log("This application does not support SystemCapability.ArkUI.ArkUI.Full".); -} -``` - -You can import a module using the **import** API. If the current device does not support the module, the import result is **undefined**. Before using an API, you must make sure the API is available. + ``` + if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) { + console.log("This application supports SystemCapability.ArkUI.ArkUI.Full."); + } else { + console.log("This application does not support SystemCapability.ArkUI.ArkUI.Full".); + } + ``` -``` -import geolocation from '@ohos.geolocation'; - -if (geolocation) { - geolocation.getCurrentLocation((location) => { - console.log(location.latitude, location.longitude); - }); -} else { - console.log('This device does not support location information.'); -} -``` +- Method 2: Import a module using the **import** API. If the current device does not support the module, the import result is **undefined**. Before using an API, you must make sure the API is available. + ``` + import geolocation from '@ohos.geolocation'; + if (geolocation) { + geolocation.getCurrentLocation((location) => { + console.log(location.latitude, location.longitude); + }); + } else { + console.log('This device does not support location information.'); + } + ``` +You can also find out the SysCap to which an API belongs by referring to the API reference document. ### Checking the Differences Between Devices with a Specific SysCap @@ -159,7 +140,6 @@ authenticator.execute('FACE_ONLY', 'S1', (err, result) => { }) ``` - ### How Do SysCap Differences Arise Between Devices The device SysCaps in product solutions vary according to the component combination defined by the product solution vendor. The following figure shows the overall process. -- GitLab