未验证 提交 e8d56790 编写于 作者: O openharmony_ci 提交者: Gitee

!3922 修复断链问题

Merge pull request !3922 from ester.zhou/TR-0511
......@@ -4,40 +4,40 @@
When developing an application in the FA model, you need to declare the package structure of the application in the **config.json** file. Similarly, when developing an application in the stage model, you need to declare the package structure of the application in the **module.json** file.
## Internal Structure of the config.json File
## Internal Structure of the module.json File
The **module.json** file consists of two parts: **app** and **module**. See Table 1 for details.
The **module.json** file consists of two tags: **app** and **module**. See Table 1 for details.
Table 1 Internal structure of the module.json file
| Attribute| Description | Data Type| Default|
| Tag| Description | Data Type| Initial Value Allowed|
| -------- | ------------------------------------------------------------ | -------- | ---------- |
| app | Global configuration of an application. Different HAP files of the same application must use the same **app** configuration. For details, see [Internal Structure of the app Tag](#internal-structure-of-the-app-tag).| Object | No |
| module | Configuration of a HAP file. The ***module*** configuration is valid only for the current HAP file. For details, see [Internal Structure of the module Tag](#internal-structure-of-the-module-tag).| Object | No |
| app | Global configuration of an application. Different HAP files of an application must use the same **app** configuration. For details, see [Internal Structure of the app Tag](#internal-structure-of-the-app-tag).| Object | No |
| module | Configuration of a HAP file. The **module** configuration is valid only for the current HAP file. For details, see [Internal Structure of the module Tag](#internal-structure-of-the-module-tag).| Object | No |
Example of the module.json file:
Example of the **module.json** file:
```json
{
    "app": {
"bundleName": "com.application.music",
        "vendor": "application",
        "versionCode": 1,
        "versionName": "1.0",
        "minCompatibleVersionCode": 1,
        "apiCompatibleVersion": 7,
        "apiTargetVersion": 8,
        "apiReleaseType": "Release",
        "debug": false,
        "icon" : "$media:app_icon",
        "label": "$string:app_name",
        "description": "$string:description_application",
        "distributedNotificationEnabled": true,
        "entityType": "game",
        "car": {
            "apiCompatibleVersion": 8
         }
    },
"app": {
"bundleName": "com.application.music",
"vendor": "application",
"versionCode": 1,
"versionName": "1.0",
"minCompatibleVersionCode": 1,
"apiCompatibleVersion": 7,
"apiTargetVersion": 8,
"apiReleaseType": "Release",
"debug": false,
"icon": "$media:app_icon",
"label": "$string:app_name",
"description": "$string:description_application",
"distributedNotificationEnabled": true,
"entityType": "game",
"car": {
"apiCompatibleVersion": 8
}
},
"module": {
"name": "myHapName",
"type": "entry|feature|har",
......@@ -48,15 +48,8 @@ Example of the module.json file:
"deviceTypes": [
"tablet",
"tv",
"wearable",
"liteWearable",
"ar",
"vr",
"car",
"earphones",
"speaker",
"smartVision",
"linkIoT",
"wearable",
"car",
"router",
],
"deliveryWithInstall": true,
......@@ -168,76 +161,69 @@ Example of the module.json file:
### Internal Structure of the app Tag
This tag is an attribute of the entire application. It affects the left and right hap and components in the application and will not be replaced by hap or components. For an internal structure of the label, refer to Table 2.
This tag is an application-level attribute that affects all the HAP files and components in the application. For the internal structure of the tag, see Table 2.
Table 2 Internal structure of the app tag
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------------------------ | ------------------------------------------------------------ | -------- | ------------------------------------------- |
| bundleName | Bundle name of the application. It uniquely identifies the application. This attribute cannot be left empty. The value must meet the following rules:<br> 1) Consists of letters, digits, underscores (_), and periods (.).<br> (2) Starts with a letter.<br> (3) Contains 7 to 127 bytes.<br> You are advised to use the reverse domain name format, for example, com.example.xxx. The first level is the domain name suffix com, the second level is the vendor/individual name, and the third level is the application name. Multiple levels are supported.<br> The application compiled with the system source code must be named in the format of com.ohos.xxx, where ohos indicates the OpenHarmony system application.| String | No |
| debug | Indicates whether an application can be debugged. | Boolean | No (initial value: **false**) |
| icon | Icon of the application. The value is the index to the resource file. | String | No |
| bundleName | Bundle name that uniquely identifies the application. This attribute cannot be left empty. The value must comply with the following rules:<br> (1) Consists of letters, digits, underscores (_), and periods (.).<br> (2) Starts with a letter.<br> (3) Contains 7 to 127 bytes.<br> You are advised to use the reverse domain name notion, for example, *com.example.xxx*. The first part is the domain suffix **com**, the second part is the vendor/individual name, and the third part is the application name, which can be of multiple levels.<br> The application compiled with the system source code must be named in the format of **com.ohos.*xxx***, where **ohos** signifies OpenHarmony.| String | No |
| debug | Whether the application can be debugged. | Boolean | Yes (initial value: **false**) |
| icon | Icon of the application. The value is the index to the resource file. | String | No |
| label | Name of the application. The value is a resource index to descriptions in multiple languages.| String | No |
| description | Description of the application. The value can be a string or a resource index to descriptions in multiple languages.| String | Yes (initial value: left empty) |
| vendor | Application vendor. The value is a string of 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. The value is used only to determine whether a version is later than another version. A larger value indicates a later version. You can set the value to any positive integer. However, you must ensure that the new version of the application uses a value greater than any earlier version. The value must be less than 2 to the power of 31.| Number | |
| versionName | Text description of the version number, which is displayed to users.<br>The value consists of only digits and dots. The A.B.C.D four-segment format is recommended. The meaning of the four-segment format is as follows:<br>Segment 1: major version number. The value ranges from 0 to 99. This segment indicates the version that is modified greatly, for example, the version that implements a new major function or has a major change.<br>Segment 2: minor version number. The value ranges from 0 to 99. This segment indicates outstanding features, such as new function addition and major issue rectification.<br>Segment 3: feature version number. The value ranges from 0 to 99. This segment indicates the planned new version features.<br>Segment 4: revision version number or patch. The value ranges from 0 to 999. This segment indicates a maintenance version for fixing bugs.| String | No |
| 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.<br>The value consists of only digits and dots. The four-segment format *A.B.C.D* is recommended, wherein:<br>Segment 1: major version number, which ranges from 0 to 99. A major version consists of major new features or large changes.<br>Segment 2: minor version number, which ranges from 0 to 99. A minor version consists of some new features and large bug fixes.<br>Segment 3: feature version number, which ranges from 0 to 99. A feature version consists of scheduled new features.<br>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 |
| 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 is a string. The value can be **CanaryN**, **BetaN**, or **Release**, where **N** represents a positive integer.<br>Canary: indicates a restricted release.<br>Beta: indicates a publicly released beta version.<br>Release: indicates a publicly released official version.| String | Yes (initial value: **Release**) |
| 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.<br>**Canary**: indicates a restricted release.<br>**Beta**: indicates a publicly released beta version.<br>**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 | Category 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
This tag specifies the HAP configuration, which only applies to the current HAP file.
This tag stores the HAP configuration, which only applies to the current HAP file.
Table 3 Internal structure of the module tag
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| ------------------- | ------------------------------------------------------------ | ---------- | ------------------------------------- |
| name | Name of the current module. After the module is packed into the HAP, this attribute indicates the name of the HAP. The value is a string containing a maximum of 31 bytes and must be unique in the entire application.| String | No |
| type | Type of the current HAP file. There are three types: entry, feature, and har.| String | No |
| srcEntrance | Path of the entry JS code corresponding to the HAP. The value is a string containing a maximum of 127 bytes.| String | Yes |
| name | Name of the current module. After the module is packed into a HAP file, this attribute indicates the name of the HAP file. The value is a string with a maximum of 31 bytes and must be unique in the entire application.| String | No |
| type | Type of the current HAP file. There are three types: **entry**, **feature**, and **har**.| String | No |
| srcEntrance | Path of the entry JS code corresponding to the HAP file. The value is a string with a maximum of 127 bytes.| String | Yes |
| description | Description of the HAP file. The value can be a string or a resource index to descriptions in multiple languages.| String | Yes (initial value: left empty) |
| process | Process of the HAP file. The value is a string with a maximum of 31 bytes. If a process is configured in the **hap** tag, all abilities of the application run in this process.| String | Yes (initial value: name of the HAP) |
| mainElement | Entrance ability name or extension name of the HAP. Only the ability or extension whose value is **mainElement** can be displayed in the Service Center. This attribute cannot be left empty for an OpenHarmony atomic service.| String | Yes for an OpenHarmony application |
| deviceTypes | Types of the devices on which the HAP can run. The value is a string array. Table 4 lists the device types predefined by the system.<br>Different from **syscap**, which is based on the device capability (such as Bluetooth and Wi-Fi), **deviceTypes** is based on the device type.| String array| No (can be left empty) |
| deliveryWithInstall | Whether this HAP will be installed when the user installs the application. The value **true** indicates that the HAP file will be automatically installed when the user installs the application. Value "false" indicates the opposite.| Boolean | No |
| installationFree | Whether the HAP file supports the installation-free feature. No default value is allowed for the HAP file.<br>**true**: The HAP file supports the installation-free feature and meets installation-free constraints.<br>**false**: The HAP file does not support the installation-free feature.<br><br>When **entry.hap** is set to **true**, all **feature.hap** fields related to **entry.hap** must be **true**.<br>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 |
| virtualMachine | Type of the target VM where the current HAP is running. It is used for cloud distribution, such as the application market and distribution center.<br>The value is a string. If the target VM type is Ark, the value is **ark**. Otherwise, the value is **default**. This attribute is automatically inserted when the IDE builds the HAP. When the decompression tool parses the HAP file, if the HAP file does not contain this attribute, the value is set to **default**.| String | Yes (initial value: **default**) |
| uiSyntax | **syntax**: defines the syntax type of the JS component.<br>**hml**: indicates that the JS component is developed using HML, CSS, or JS.<br>**ets**: indicates that the JS component is developed using the eTS declarative syntax.| String | Yes (initial value: **hml**) |
| pages | Profile resource used to list information about each page in the JS component. For details about how to use pages, see the pages example.| Object | No in the ability scenario|
| metadata | Custom metadata of the HAP. The configuration is valid only for the current module, ability, or extensionAbility. For details about metadata, see [Internal Structure of the metadata Attribute](#internal-structure-of-the-metadata-attribute).| Array | Yes (initial value: left empty) |
| abilities | Metadata capability configuration. The configuration under this tag is valid only for the current ability. For details about the capabilities, see [Internal Structure of the abilities Attribute](#internal-structure-of-the-abilities-attribute).| Object | Yes (initial value: left empty) |
| extensionAbilities | Configuration information of extensionAbilities. The configuration under this tag is valid only for the current extensionAbility. For details about extensionAbilities, see [Internal structure of the extensionAbility attribute](#internal-structure-of-the-extensionAbility-attribute).| Object | Yes (initial value: left empty) |
| requestPermissions | A set of permissions that the application needs to apply for from the system when the application is running. For details about requestPermissions, see [Internal structure of the requestPermissions attribute](#internal-structure-of-the-requestPermissions-attribute).| Object | Yes (initial value: left empty) |
| process | Process of the HAP file. The value is a string with a maximum of 31 bytes. If a process is configured under **hap**, all abilities of the application run in this process.| String | Yes (initial value: name of the HAP file) |
| mainElement | Entrance ability name or extension name of the HAP file. Only the ability or extension whose value is **mainElement** can be displayed in the Service Center. This attribute cannot be left at the initial value for an OpenHarmony atomic service.| String | Yes for an OpenHarmony application |
| deviceTypes | Types of the devices on which the HAP file can run. Table 4 lists the device types predefined by the system.<br>Different from **syscap**, which is based on the device capability (such as Bluetooth and Wi-Fi), **deviceTypes** is based on the device type.| String array| No (can be left empty) |
| deliveryWithInstall | Whether the current HAP file will be installed when the user installs the application. The value **true** means that the HAP file will be automatically installed when the user installs the application, and **false** means the opposite.| Boolean | No |
| installationFree | Whether the HAP file supports the installation-free feature. <br>**true**: The HAP file supports the installation-free feature and meets installation-free constraints.<br>**false**: The HAP file does not support the installation-free feature.<br><br>When **entry.hap** is set to **true**, all **feature.hap** fields related to **entry.hap** must be **true**.<br>When **entry.hap** is set to **false**, **feature.hap** fields related to **entry.hap** can be set to **true** or **false** based on service requirements. | Boolean | No |
| virtualMachine | Type of the target virtual machine (VM) where the current HAP file is running. It is used for cloud distribution, such as the application market and distribution center.<br>If the target VM type is Ark, the value is **ark**. Otherwise, the value is **default**. This attribute is automatically inserted when the IDE builds the HAP file. When the decompression tool parses the HAP file, if the HAP file does not contain this attribute, the value is set to **default**. | String | Yes (initial value: **default**) |
| uiSyntax | Syntax type of the JS component.<br>**hml**: indicates that the JS component is developed using HML, CSS, or JS.<br>**ets**: indicates that the JS component is developed using the eTS declarative syntax.| String | Yes (initial value: **hml**) |
| pages | Profile resource used to list information about each page in the JS component. For details about how to use **pages**, see the **pages** example.| Object | No in the ability scenario|
| metadata | Custom metadata of the HAP file. The configuration is valid only for the current module, ability, or extensionAbility. For details about **metadata**, see [Internal Structure of the metadata Attribute](#internal-structure-of-the-metadata-attribute).| Array | Yes (initial value: left empty) |
| abilities | Metadata capability configuration, which is valid only for the current ability. For details about **abilities**, see [Internal Structure of the abilities Attribute](#internal-structure-of-the-abilities-attribute).| Object | Yes (initial value: left empty) |
| extensionAbilities | Configuration of extensionAbilities, which is valid only for the current extensionAbility. For details about **extensionAbilities**, see [Internal structure of the extensionAbility attribute](#internal-structure-of-the-extensionability-attribute).| Object | Yes (initial value: left empty) |
| requestPermissions | A set of permissions that the application needs to apply for from the system when the application is running. For details about **requestPermissions**, see [Internal structure of the requestPermissions attribute](#internal-structure-of-the-requestpermissions-attribute).| Object | Yes (initial value: left empty) |
Table 4 System-defined deviceTypes values
| Value | Device Type |
| ------------ | -------------------------------------------------------- |
| tablet | Tablet, speaker with a screen |
| tv | |
| wearable | Smart watch, kids watch, especially a watch that packs a wide array of resources |
| liteWearable | Basic functions watch, sports watch |
| ar | |
| vr | |
| car | |
| earphones | |
| speaker | Speaker without a screen, speaker with a screen |
| smartVision | Devices with cameras |
| linkIoT | Wi-Fi module, Bluetooth module |
| router | Router |
Example of deviceTypes:
| Device Type | Value | Description |
| ------------ | ------------ | -------------------------------------------------------- |
| tablet | tablet | Tablet, speaker with a screen |
| smart TV | tv | |
| smart watch | wearable | Smart watch, kids' watch, especially a watch that provides call features|
| head unit | car | |
| router | router | Router |
Example of the **deviceTypes** attribute structure:
```json
{
"module": {
"name": "myHapName",
        "type": "har",
"name": "myHapName",
"type": "har",
"deviceTypes" : [
"wearable"
]
......@@ -245,31 +231,31 @@ Example of deviceTypes:
}
```
Example of pages:
Example of the **pages** attribute structure::
```json
{
"module": {
       "name": "myHapName",
        "type": "har",
"module": {
"name": "myHapName",
"type": "har",
"deviceTypes" : [
"wearable"
],
        "pages": "$profile:pages_config"
    }
"pages": "$profile:pages_config"
}
}
```
pages_config configuration file
Example of the **pages_config** configuration file:
```json
{
    "src": [
        "pages/index/index",
        "pages/second/second",
        "pages/third/third",
        "pages/four/four"
    ]
"src": [
"pages/index/index",
"pages/second/second",
"pages/third/third",
"pages/four/four"
]
}
```
......@@ -277,34 +263,34 @@ pages_config configuration file
#### Internal Structure of the metadata Attribute
Configuration information about the module, ability, and extensionAbility. The value is of the array type. The configuration is valid only for the current module, ability, or extensionAbility.
The **metadata** attribute provides the configuration about the module, ability, and extensionAbility. The value is of the array type. The configuration is valid only for the current module, ability, or extensionAbility.
Table 5 Internal structure of the metadata attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------------- |
| name | Key of a data element. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty) |
| value | This tag indicates the value of a data item. The tag value is a character string containing a maximum of 255 bytes. | String | Yes (initial value: left empty) |
| name | Name of a data item. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty)|
| value | Value of a data item. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty) |
| resource | Custom data format. The value is an index to the resource that identifies the data.| String | Yes (initial value: left empty) |
Example of metadata:
Example of the **metadata** attribute structure:
```json
{ 
    "module": {
        "metadata": [
            {
                "name": "string",
                "value": "string",
                "resource": "$profile:config_file"
            },
            {
                "name": "string",
                "value": "string",
                "resource": "$profile:config_file"
            }
        ]
    }
{
"module": {
"metadata": [
{
"name": "string",
"value": "string",
"resource": "$profile:config_file"
},
{
"name": "string",
"value": "string",
"resource": "$profile:config_file"
}
]
}
}
```
......@@ -314,52 +300,54 @@ The **abilities** attribute describes the ability configuration information. The
Table 6 Internal structure of the abilities attribute
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| --------------- | ------------------------------------------------------------ | ---------- | ------------------------------------------------------------ |
| name | Logical name of the ability, which must be unique in the entire application. The value is a string containing a maximum of 127 bytes.| String | No |
| srcEntrance | JS code path corresponding to the ability. The tag value is a string containing a maximum of 127 bytes.| String | No |
| launchType | Ability startup mode. The value can be **standard**, **singleton**, or **specified**. The default value is **standard**. The value **standard** indicates common multi-instance, the value **specified** indicates that multiple instances are configured for the ability based on the service, and the value **singleton** indicates a singleton.| String | Yes (initial value: **standard**) |
| name | Logical name of the ability, which must be unique in the entire application. The value is a string with a maximum of 127 bytes.| String | No |
| srcEntrance | JS code path corresponding to the ability. The value is a string with a maximum of 127 bytes.| String | No |
| launchType | Ability startup mode. The value can be **standard**, **singleton**, or **specified**. The default value is **singleton**. The value **standard** indicates common multi-instance, the value **singleton** indicates a singleton, and the value **specified** indicates one or more specified instances, depending on the internal service of the ability.| String | Yes (initial value: **singleton**) |
| description | Ability description. The value can be a string or a resource index to descriptions in multiple languages.| String | Yes (initial value: left empty) |
| 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.<br>If **ability** is set to **MainElement**, this attribute is mandatory.| String | Yes (initial value: left empty)<br>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 character 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. This attribute can be left empty, and the default value is an empty array.| 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 is a boolean value. Value "true" means that the Ability can be invoked by other applications, and "false" means the opposite.| Boolean | Yes (initial value: **false**) |
| continuable | Indicates whether the ability can be migrated. The value is a Boolean value. The value true indicates that the ability can be migrated, and the value false indicates that the ability cannot be migrated.| Boolean | Yes (initial value: **false**) |
| skills | Feature set of wants that can be received by the ability. The tag is in array format.<br>Configuration rule: In an entry package, you can configure the ability of multiple **skill** attributes (**action.system.home** and **entity.system.home** are configured) that have the entry capability. The label and icon in the first **skill** attribute that is configured are used as the label and icon of the OpenHarmony service or application.<br>The skills tag with the entry capability cannot be configured for the feature package of the OpenHarmony service.<br>The **skill** attribute with the entry capability can be configured for the feature package of the OpenHarmony application.<br>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.<br>Continuous tasks are classified into the following types:<br>**dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices<br>**audioPlayback**: audio playback service<br>**audioRecording**: audio recording service<br>**location**: location and navigation services<br>**bluetoothInteraction**: Bluetooth scanning, connection, and transmission services (wearables)<br>**multiDeviceConnection**: multi-device interconnection service<br>**wifiInteraction**: Wi-Fi scanning, connection, and transmission services (multi-screen cloning)<br>**voip**: voice/video call and VoIP services<br>**taskKeeping**: computing service.<br> | String | Yes (initial value: left empty) |
| 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**) |
| 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.<br>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.<br>The **skills** attribute with the entry capability can be configured for the feature package of an OpenHarmony application,<br>but not for an OpenHarmony service.<br>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.<br>Continuous tasks are classified into the following types:<br>**dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices<br>**audioPlayback**: audio playback service<br>**audioRecording**: audio recording service<br>**location**: location and navigation services<br>**bluetoothInteraction**: Bluetooth scanning, connection, and transmission services (wearables)<br>**multiDeviceConnection**: multi-device interconnection service<br>**wifiInteraction**: Wi-Fi scanning, connection, and transmission services (multi-screen cloning)<br>**voip**: voice/video call and VoIP services<br>**taskKeeping**: computing service<br>| String | Yes (initial value: left empty) |
| startWindowIcon | Index to the icon file of the ability startup page. Example value: **$media:icon**. | String | No |
| startWindowBackground | Index to the background color resource file of the ability startup page. Example value: **$color:red**. | String | No |
Example of the abilities attribute structure:
Example of the **abilities** attribute structure:
```json
{
    "abilities": [{
        "name": "MainAbility",
        "srcEntrance": "./ets/login/MyLoginAbility.ts",
        "launchType":"standard"
        "description": "$string:description_main_ability",
        "icon": "$media:icon",
        "label": "Login",
        "permissions": [],
        "metadata": [],
        "visible": true,
        "continuable": true,
        "skills": [{
            "actions": ["action.system.home"],
            "entities": ["entity.system.home"],
            "uris": []
        }],
        "backgroundModes": [
            "dataTransfer",
            "audioPlayback",
            "audioRecording",
            "location",
            "bluetoothInteraction",
            "multiDeviceConnection",
            "wifiInteraction",
            "voip",
            "taskKeeping"
        ],
    }],
"abilities": [{
"name": "MainAbility",
"srcEntrance": "./ets/login/MyLoginAbility.ts",
"launchType":"standard"
"description": "$string:description_main_ability",
"icon": "$media:icon",
"label": "Login",
"permissions": [],
"metadata": [],
"visible": true,
"continuable": true,
"skills": [{
"actions": ["action.system.home"],
"entities": ["entity.system.home"],
"uris": []
}],
"backgroundModes": [
"dataTransfer",
"audioPlayback",
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
}],
}
```
......@@ -367,9 +355,9 @@ Example of the abilities attribute structure:
This attribute identifies a want feature that can be received by the ability or extension.
Table 7 Internal structure of skills
Table 7 Internal structure of the skills attribute
| Attribute| Description | Data Type | Default |
| Attribute| Description | Data Type | Initial Value Allowed |
| -------- | ------------------------------------------------------------ | ---------- | -------------------- |
| 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)|
......@@ -377,7 +365,7 @@ Table 7 Internal structure of skills
Table 8 Internal structure of the uris attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------- | -------- | -------------------- |
| scheme | Scheme in the URI.| String | No |
| host | Host in the URI. | String | Yes (initial value: left empty)|
......@@ -385,58 +373,58 @@ Table 8 Internal structure of the uris attribute
| path | Path in the URI. | String | Yes (initial value: left empty)|
| type | Type of the URI. | String | Yes (initial value: left empty)|
Example of the skills attribute structure:
Example of the **skills** attribute structure:
```json
{
    "abilities": [
        {
            "skills": [
                {
                    "actions": [
                        "action.system.home"
                    ],
                    "entities": [
                        "entity.system.home"
                    ],
                    "uris": [
                        {
                            "scheme":"uri2",
                            "host":"host2",
                            "port":"port2",
                            "pathStartWith":"path2",
                            "pathRegex":"/query/.*",
                            "path":"path",
                            "type": "text/*"
                        },
                    ]
                }
            ],
        }
    ],
    "extensionAbilities": [
        {
            "skills": [
                {
                    "actions": [
                    ],
                    "entities": [
                    ],
                    "uris": [
                        {
                            "scheme":"uri2",
                            "host":"host2",
                            "port":"port2",
                            "pathStartWith":"path2",
                            "pathRegex":"/query/.*",
                            "path":"path",
                            "type": "text/*"
                        },
                    ]
                }
            ],
        }
    ],
"abilities": [
{
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
],
"uris": [
{
"scheme":"uri2",
"host":"host2",
"port":"port2",
"pathStartWith":"path2",
"pathRegex":"/query/.*",
"path":"path",
"type": "text/*"
},
]
}
],
}
],
"extensionAbilities": [
{
"skills": [
{
"actions": [
],
"entities": [
],
"uris": [
{
"scheme":"uri2",
"host":"host2",
"port":"port2",
"pathStartWith":"path2",
"pathRegex":"/query/.*",
"path":"path",
"type": "text/*"
},
]
}
],
}
],
}
```
......@@ -446,50 +434,50 @@ The **extensionAbility** attribute describes the configuration information of **
Table 9 Internal structure of the extensionAbility attribute
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| ----------- | ------------------------------------------------------------ | ---------- | ----------------------------- |
| name | Logical name of the current extensionAbility. The value is a string containing a maximum of 127 bytes. The name must be unique in the entire application.| String | No |
| srcEntrance | JS code path corresponding to extensionAbility. The value is a character string containing a maximum of 127 bytes.| String | No |
| name | Logical name of the current extensionAbility. The value is a string with a maximum of 127 bytes. The name must be unique in the entire application.| String | No |
| srcEntrance | JS code path corresponding to extensionAbility. The value is a string with a maximum of 127 bytes.| String | No |
| description | Description of the extensionAbility. The value can be a string or a resource index to descriptions in multiple languages.| String | Yes (initial value: left empty) |
| icon | Icon of the extensionAbility. The value is the index to the resource file. If **extensionAbility** is set to **MainElement**, this attribute is mandatory.| String | Yes (initial value: left empty) |
| label | Name of the extensionAbility displayed to users. The value is a resource index to names in multiple languages.<br>If **extensionAbility** is set to **MainElement**, this attribute is mandatory and the value must be unique in the application.| String | No |
| type | Type of the extension capability. The value can be form, workScheduler, inputMethod, service, accessibility, dataShare, fileShare, staticSubscriber or wallpaper.| String | No |
| permissions | A set of permissions that need to be applied for when the capability of another application is invoked. The value is a character 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) |
| type | Type of the extension capability. The value can be form, workScheduler, inputMethod, service, accessibility, dataShare, fileShare, staticSubscriber, wallpaper, or backup. | String | No |
| 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) |
| uri | Data URI provided by the ability. The value is an array containing a maximum of 255 characters and is in the format of a reverse domain name. This attribute is mandatory when **type** is set to **extensionAbility** of the dataShare type.| String | Yes (initial value: left empty) |
| skills | Feature set of wants that can be received by the ability.<br>Configuration rule: In an entry package, you can configure the ability of multiple **skill** attributes (**action.system.home** and **entity.system.home** are configured) that have the entry capability. The **label** and **icon** in the first ability that has **skills** configured are used as the **label** and **icon** of the OpenHarmony service or application.<br>The **skills** attribute with the entry capability cannot be configured for the feature package of the OpenHarmony service.<br>The **skills** attribute with the entry capability can be configured for the feature package of the OpenHarmony application.<br>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) |
| skills | Feature set of wants that can be received by the ability.<br>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.<br>The **skills** attribute with the entry capability can be configured for the feature package of an OpenHarmony application,<br>but not for an OpenHarmony service.<br>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) |
| metadata | Metadata of extensionAbility. For details about metadata, see [Internal Structure of the metadata Attribute](#internal-structure-of-the-metadata-attribute).| Object | Yes (initial value: left empty) |
| visible | Whether extensionAbility can be invoked by other applications. The value is of the Boolean type. The value **true** means that it can be invoked by other applications, and the value **false** means the opposite.| | Yes (initial value: **false**)|
Example of extensionAbility:
Example of the **extensionAbility** attribute structure:
```json
{
    "extensionAbilities": [
        {
            "name": "FormName",
            "srcEntrance": "./form/MyForm.ts",
            "icon": "$media:icon",
            "label" : "$string:extension_name",
            "description": "$string:form_description",
            "type": "form", 
            "permissions": ["ohos.abilitydemo.permission.PROVIDER"],
            "readPermission": "",
            "writePermission": "",
            "visible": true,
            "uri":"scheme://authority/path/query"
            "skills": [{
                "actions": [],
                "entities": [],
                "uris": []
            }],
            "metadata": [
                {
                    "name": "ohos.extability.form",
                    "resource": "$profile:form_config", 
                }
            ],
        }
    ]
"extensionAbilities": [
{
"name": "FormName",
"srcEntrance": "./form/MyForm.ts",
"icon": "$media:icon",
"label" : "$string:extension_name",
"description": "$string:form_description",
"type": "form",
"permissions": ["ohos.abilitydemo.permission.PROVIDER"],
"readPermission": "",
"writePermission": "",
"visible": true,
"uri":"scheme://authority/path/query"
"skills": [{
"actions": [],
"entities": [],
"uris": []
}],
"metadata": [
{
"name": "ohos.extability.form",
"resource": "$profile:form_config",
}
],
}
]
}
```
......@@ -498,49 +486,48 @@ Example of extensionAbility:
This attribute identifies a set of permissions that the application needs to apply for from the system when the application is running.
Table 10 requestPermissions fields
Table 10 requestPermissions attributes
| Attribute | Description | Type | **Value Range** | **Default Value** | **Restrictions** |
| Attribute | Description | **Type** | **Value Range** | **Default Value** | **Restrictions** |
| --------- | ------------------------------------------------------------ | ------------------------------- | ----------------------------------------------------------- | ---------------------- | ------------------------------------------------------------ |
| name | Permission name, which is mandatory. | String | Custom | None | Parsing will fail if this field is not set. |
| reason | Optional. This field is mandatory when the requested permission is **user_grant**. Reason for requesting the permission.| String | The displayed text cannot exceed 256 bytes. | Empty | This attribute is mandatory for the **user_grant** permission. If it is left empty, application release will be rejected. Multi-language adaptation is required. |
| usedScene | Optional. This field is mandatory when the requested permission is **user_grant**. Describes the application scenario and timing for using the permission. This attribute consists of the **ability** and **when** sub-attributes. Multiple abilities can be configured.| **ability**: string array; **when**: string| **ability**: ability name; **when**: **inuse** or **always**| **ability**: left empty; **when**: **inuse**| The **ability** sub-attribute is mandatory for the **user_grant** permission, and the **when** field is optional. |
| name | Permission name. This attribute is mandatory. | String | Custom | None | Parsing will fail if this field is not set. |
| reason | Reason for requesting the permission. This attribute is mandatory when the requested permission is **user_grant**. | String | The maximum length is 256 bytes. | Empty | If the requested permission is **user_grant**, this attribute is required for the application to be released to AppGallery. Multi-language adaptation is required. |
| usedScene | Application scenario and timing for using the permission, which is mandatory when the requested permission is **user_grant**. This attribute consists of the **ability** and **when** sub-attributes. Multiple abilities can be configured. | **ability**: string array; **when**: string | **ability**: ability name; **when**: **inuse** or **always** | **ability**: left empty; **when**: **inuse** | If the requested permission is **user_grant**, the **ability** sub-attribute is mandatory and **when** is optional. |
Example of requestPermissions:
Example of the **requestPermissions** attribute structure:
```json
{
    "usedScene": {
        "abilities": [
            "AudioAbility",
            "VedioAbility",
        ],
        "when": "inuse"
    }
"usedScene": {
"abilities": [
"AudioAbility",
"VedioAbility",
],
"when": "inuse"
}
}
```
#### Internal Structure of the form Attribute
The **forms** attribute indicates the service widget configuration. The service widget is a brief application view that can be embedded on the home screen and periodically updated. The **form** attribute can be contained in the following scenarios:
The **forms** attribute indicates the service widget configuration. The service widget is an application brief view that can be displayed on the home screen and periodically updated. You can include the **forms** attribute in any of the following modes:
1. Set **type** to **form** in **extensions**.
2. Specify the **form** information in metadata,
where **name** indicates the name of the service widget,**ohos.extability.form** indicates the identifier of the service widget,
and **resource** indicates the resource location of the service widget.
2. Specify the **form** information in **metadata**, where:
- **name** indicates the name of the service widget, for example, **ohos.extability.form**.
- **resource** indicates where the resources of the service widget are stored.
Table 11 Internal structure of the forms attribute
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| ----------------- | ------------------------------------------------------------ | ---------- | ----------------------------- |
| name | Class name of the widget. The value is a string with a maximum of 127 bytes. | String | No |
| description | Description of the widget. The value can be a string or a resource index to descriptions in multiple languages. The value is a string with a maximum of 255 bytes.| String | Yes (initial value: left empty) |
| src | UI code of a JS service widget. It is recommended that you use the adaptive layout to display a service widget of different specifications. If the layout of a service widget of different specifications differs greatly, you are advised to use different service widgets.| String | Yes (initial value: left empty) |
| window | Adaptive capability of a JS service widget. For details about the window structure, see Table 12. | Object | Yes (initial value: left empty) |
| isDefault | Whether the widget is a default one. Each ability has only one default widget. **true**: The widget is the default one. **false**: The widget is not the default one.| Boolean | No |
| colorMode | Theme style of a service widget. The options are as follows: **auto**; **dark**: The widget adopts the dark color mode; **light**: The widget adopts the light color mode.| String | Yes (initial value: **auto**) |
| supportDimensions | Appearance specifications supported by the widget. The options are as follows: 1 * 2: indicates a grid with one row and two columns. 2 * 2: indicates a grid with two rows and two columns. 2 * 4: indicates a grid with two rows and four columns. 4 * 4: indicates a grid with four rows and four columns.| String array| No |
| isDefault | Whether the service widget is the default one. Each ability has only one default service widget. **true**: The service widget is the default one. **false**: The service widget is not the default one.| Boolean | No |
| colorMode | Theme style of the service widget. The value can be **auto**, **dark**, or **light**.| String | Yes (initial value: **auto**) |
| supportDimensions | Dimensions supported by the service widget. The value can be **1 * 2**, **2 * 2**, **2 * 4**, or **4 * 4**, where the number before the asterisk (*) indicates the number of rows, and the number after the asterisk (*) indicates the number of columns.| String array| No |
| defaultDimension | Default grid style of the widget. The value must be available in the **supportDimensions** array of the widget.| String | No |
| updateDuration | Update frequency of a widget. The unit is 30 minutes. The value is a multiple of 30. The highest frequency of refreshing a widget is once every 30 minutes. You can also use scheduled refresh to refresh a widget at a fixed time or once every 30 minutes. If both of them are configured, the scheduled refresh takes precedence.| Number | Yes (initial value: left empty) |
| metadata | Custom information about a widget. For details about the internal structure of metadata, see Table 5. | Object | Yes (initial value: left empty) |
......@@ -549,46 +536,46 @@ Table 11 Internal structure of the forms attribute
Table 12 Internal structure of window
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| --------------- | ------------------------------------------------------------ | -------- | -------------------- |
| designWidth | Baseline width of the page design, in pixels. The element size is scaled by the actual device width. The value is an integer.| Number | Yes (initial value: left empty)|
| autoDesignWidth | Whether to automatically calculate the baseline width of the page design. If this parameter is set to **true**, the **designWidth** attribute is invalid. The baseline width is calculated based on the device width and screen density.| Boolean | Yes (initial value: left empty)|
Example of the form attribute structure:
Example of the **forms** attribute structure:
Define the **form_config.json** file in **resources/base/profile** of the development view. (The file name can be defined by developers.)
Define the **form_config.json** file (this file name is customizable) in **resources/base/profile** of the development view.
```json
{
    "forms": [
        {
            "name": "Form_Js",
            "description": "$string:form_description",
            "src": "./js/pages/card/index",
            "window": {
                "designWidth": 720,
                "autoDesignWidth": true
            },
            "colorMode": "auto",
            "formConfigAbility": "ability://xxxxx",
            "formVisibleNotify": false,
            "isDefault": true,
            "updateEnabled": true,
            "scheduledUpdateTime": "10:30",
            "updateDuration": 1,
            "defaultDimension": "2*2",
            "supportDimensions": [
                "2*2"
            ],
           "metadata": [
             {
                "name": "string",
                "value": "string",
                "resource": "$profile:config_file"
             }
           ] 
        }
    ]
"forms": [
{
"name": "Form_Js",
"description": "$string:form_description",
"src": "./js/pages/card/index",
"window": {
"designWidth": 720,
"autoDesignWidth": true
},
"colorMode": "auto",
"formConfigAbility": "ability://xxxxx",
"formVisibleNotify": false,
"isDefault": true,
"updateEnabled": true,
"scheduledUpdateTime": "10:30",
"updateDuration": 1,
"defaultDimension": "2*2",
"supportDimensions": [
"2*2"
],
"metadata": [
{
"name": "string",
"value": "string",
"resource": "$profile:config_file"
}
]
}
]
}
```
......@@ -596,14 +583,14 @@ Define metadata information in the **extension** component of the **module.json*
```json
{
"extensionAbilities": [
"extensionAbilities": [
{
"name": "MyForm",
"type": "form", 
"metadata": [
"name": "MyForm",
"type": "form",
"metadata": [
{
"name": "ohos.extability.form",
"resource": "$profile:form_config",
"name": "ohos.extability.form",
"resource": "$profile:form_config",
}
],
}
......@@ -613,80 +600,83 @@ Define metadata information in the **extension** component of the **module.json*
#### Internal Structure of the shortcuts Attribute
This attribute identifies the shortcut information of an application. The value is an array. A maximum of four shortcuts can be configured. It contains four sub-attributes: **shortcutId**, **label**, **icon**, and **intents**.
This attribute identifies the shortcut information of an application. The value is an array. A maximum of four shortcuts can be configured. It contains four sub-attributes: **shortcutId**, **label**, **icon**, and **wants**.
Specify the **shortcut** information in **metadata**, where:
The shortcut information is identified in metadata, where:
(1) **name**: name of a shortcut.**ohos.ability.shortcut** is used as the identifier of the shortcut.
(2) **resource**: resource location of the shortcut.
- **name** indicates the name of the shortcut, for example, **ohos.ability.shortcut**.
- **resource** indicates where the resources of the shortcut are stored.
Table 13 Internal structure of the shortcuts attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ---------- | ------------------------------------------------------------ | -------- | -------------------------- |
| shortcutId | Shortcut ID. 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.<br>**bundleName**: target bundle name of the shortcut, which is a string.<br>**abilityName**: target component name of the shortcut, which is a string.| Object | Yes (initial value: left empty) |
| wants | Wants to which the shortcut points. The attribute consists of the **bundleName** and **abilityName** sub-attributes.<br>**bundleName**: target bundle name of the shortcut; string type.<br>**abilityName**: target component name of the shortcut; string type.| Object | Yes (initial value: left empty) |
Define the **shortcut_config.json** file in **resources/base/profile** of the development view. (The file name can be defined by developers.)
Define the **shortcut_config.json** file (this file name is customizable) in **resources/base/profile** of the development view.
```json
{
        "shortcuts": [
            {
                "shortcutId": "id_test1",
                "label": "$string:shortcut",
                "icon": "$media:aa_icon",
                "wants": [
                    {
                       "bundleName": "com.ohos.hello"
                       "abilityName": "MainAbility"
                    }
                ]
            }
        ]
"shortcuts": [
{
"shortcutId": "id_test1",
"label": "$string:shortcut",
"icon": "$media:aa_icon",
"wants": [
{
"bundleName": "com.ohos.hello"
"abilityName": "MainAbility"
}
]
}
]
}
```
Define the metadata information under **module** in the **config.json** file as follows:
Define the **metadata** information under **module** in the **config.json** file as follows:
```json
{
    "module": {
        "name": "MyAbilityStage",
        "abilities" : [
            {
                "name" : "MyAbility",
                "srcEntrance": "./abilities/MyAbility.ts",
                "skills": [{
                            "actions": ["action.system.home"],
                            "entities": ["entity.system.home"],
                            "uris": []
                }],
                "metadata": [
                    {
                        "name": "ohos.ability.shortcut",
                        "resource": "$profile:shortcuts_config", 
                    }
                ],
            }
        ]
    }
"module": {
"name": "MyAbilityStage",
"abilities" : [
{
"name" : "MyAbility",
"srcEntrance": "./abilities/MyAbility.ts",
"skills": [{
"actions": ["action.system.home"],
"entities": ["entity.system.home"],
"uris": []
}],
"metadata": [
{
"name": "ohos.ability.shortcut",
"resource": "$profile:shortcuts_config",
}
],
}
]
}
}
```
#### Internal Structure of the commonEvents Attribute
The **commonEvents** attribute identifies the registered static common event information. The value is an array.
The **commonEvent** information is defined in the metadata, where:
1. **name**: name of a common event.**ohos.extability.staticSubscriber** is used as the common event ID.
Specify the **commonEvent** information in the **metadata**, where:
2. **resource**: resource location of the **commonEvent** information.
- **name** indicates the name of the common event, for example, **ohos.extability.staticSubscriber**.
- **resource** indicates where the resources of the common event are stored.
Table 14 Internal structure of the commonEvents attribute
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| ---------- | ------------------------------------------------------------ | ---------- | -------------------------- |
| name | Ability name corresponding to the current static common event. The class must be marked in the ability.| String | No |
| permission | Permission required for implementing the static common event. The value is a string with a maximum of 255 bytes, in the reverse domain name notation.| String | Yes (initial value: left empty) |
......@@ -697,38 +687,38 @@ Define the **common_event_config.json** file in **resources/base/profile** in th
```json
{
    "commonEvents": [
            {
                "name": "abilityName",
                "permission": "string",
                "types": [
                    "string",
                    "string"
                ],
                "events": [
                    "string",
                    "string"
                ]
            }
    ]
"commonEvents": [
{
"name": "abilityName",
"permission": "string",
"types": [
"string",
"string"
],
"events": [
"string",
"string"
]
}
]
}
```
Define metadata information in the **extension** component of the **module.json** file as follows:
Define the **metadata** information under **extension** in the **module.json** file as follows:
```json
"extensionAbilities": [
    {
        "name": "mySubscriber",
        "srcEntrance": "./extension/my_subscriber.js",
        "type": "staticSubscriber",
        "metadata": [
            {
                "name": "ohos.extability.staticSubscriber",
                "resource": "$profile:common_event_config", 
            }
        ],
    }
"extensionAbilities": [
{
"name": "mySubscriber",
"srcEntrance": "./extension/my_subscriber.js",
"type": "staticSubscriber",
"metadata": [
{
"name": "ohos.extability.staticSubscriber",
"resource": "$profile:common_event_config",
}
],
}
]
```
......@@ -740,50 +730,50 @@ This attribute defines the rules for distributing HAP files based on different d
Table 15 Internal structure of the distroFilter attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------- | ------------------------------------------------------------ | -------- | -------------------------- |
| apiVersion | Supported API versions. For details, see Table 16. | Object array| Yes (initial value: left empty)|
| screenShape | Supported screen shapes. | Object array| Yes (initial value: left empty)|
| screenWindow | Supported window resolutions when the application is running. This attribute applies only to the lite wearables.| Object array| Yes (initial value: left empty)|
| screenDensity | It indicates the dot per inch (DPI) of the screen. This attribute is optional. If this attribute is set, the value must be valid. The value is a string array. The range is as follows:<br>**sdpi**: screen density with small-scale dots per inch (SDPI). This value is applicable for devices with a DPI range of (0, 120].<br>**mdpi**: screen density with medium-scale dots per inch (MDPI). This value is applicable for devices with a DPI range of (120, 160].<br>**ldpi**: screen density with large-scale dots per inch (LDPI). This value is applicable for devices with a DPI range of (160, 240].<br> **xldpi**: screen density with extra-large-scale dots per inch (XLDPI). This value is applicable for devices with a DPI range of (240, 320].<br>**xxldpi**: screen density with extra-extra-large-scale dots per inch (XXLDPI). This value is applicable for devices with a DPI range of (320, 480].<br>**xxxldpi**: screen density with extra-extra-extra-large-scale dots per inch (XXXLDPI). This value is applicable for devices with a DPI range of (480, 640].| Object array| Yes (initial value: left empty)|
| countryCode | Code of the country or region to which an application is distributed. For details, see ISO-3166-1. Enumerated definitions of multiple countries and regions are supported. This attribute is optional. If this attribute is set, the value must be valid. The substring of the value indicates the supported countries or regions and consists of two uppercase letters.| Object array| Yes (initial value: left empty)|
| screenDensity | Dots per inch (DPI) of the screen. This attribute is optional. The value options are as follows:<br>**sdpi**: small-scale dots per inch. This value is applicable for devices with a DPI range of (0, 120].<br>**mdpi**: medium-scale dots per inch. This value is applicable for devices with a DPI range of (120, 160].<br>**ldpi**: large-scale dots per inch. This value is applicable for devices with a DPI in the (160, 240] range.<br> **xldpi**: extra-large-scale dots per inch. This value is applicable for devices with a DPI in the (240, 320] range.<br>**xxldpi**: extra-extra-large-scale dots per inch (XXLDPI). This value is applicable for devices with a DPI in the (320, 480] range.<br>**xxxldpi**: extra-extra-extra-large-scale dots per inch. This value is applicable for devices with a DPI in the (480, 640] range.| Object array| Yes (initial value: left empty)|
| countryCode | Code of the country or region to which an application is to be distributed. For details, see ISO-3166-1. Enumerated definitions of multiple countries and regions are supported. This attribute is optional. The substring of the value consists of two uppercase letters and indicates the supported countries or regions.| Object array| Yes (initial value: left empty)|
Table 16 Internal structure of the apiVersion attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | An integer of the existing API version, for example, 4, 5, or 6. Example: If an application uses two software versions developed using API 5 and API 6 for the same device model, two installation packages of the entry type can be released.| Array | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | An integer of the existing API version, for example, 4, 5, or 6. If an application uses two software versions developed using API 5 and API 6 for the same device model, two installation packages of the entry type can be released. | Array | Yes (initial value: left empty)|
Table 17 Internal structure of the screenShape attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | The value can be **circle** or **rect**. Example: Different HAPs can be provided for a smart watch with a circular face and that with a rectangular face.| Array | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | The value can be **circle** or **rect**. Example: Different HAPs can be provided for a smart watch with a circular face and a smart watch with a rectangular face.| Array | Yes (initial value: left empty)|
Table 18 Internal structure of the screenWindow attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | Width and height of the screen. The value of a single string is in the format of Width x Height in pixels, for example, **454*454**.| Array | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | Width and height of the screen. The value is in the "width * height" format, in pixels, for example, **454*454**.| Array | Yes (initial value: left empty)|
Table 19 Internal structure of the screenDensity attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | It indicates the dot per inch (DPI) of the screen. | Array | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | Dots per inch (DPI) of the screen. | Array | Yes (initial value: left empty)|
Table 20 Internal structure of the countryCode attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | Code of the country or region to which an application is to be distributed. | Array | Yes (initial value: left empty)|
Example of the distroFilter attribute structure:
Example of the **distroFilter** attribute structure:
Define the **distroFilter_config.json** file in **resources/base/profile** of the development view. (The file name can be defined by developers.)
......@@ -806,21 +796,21 @@ Define the **distroFilter_config.json** file in **resources/base/profile** of th
]
```
Define metadata information in the **extensionAbilities** component of the **module.json** file as follows:
Define the **metadata** information under **extensionAbilities** in the **module.json** file as follows:
```json
"extensionAbilities": [
    {
        "name": "mySubscriber",
        "srcEntrance": "./extension/my_subscriber.js",
        "type": "staticSubscriber", 
        "metadata": [
            {
                "name": "ohos.extability.staticSubscriber",
                "resource": "$profile:distroFilter_config", 
            }
        ],
    }
"extensionAbilities": [
{
"name": "mySubscriber",
"srcEntrance": "./extension/my_subscriber.js",
"type": "staticSubscriber",
"metadata": [
{
"name": "ohos.extability.staticSubscriber",
"resource": "$profile:distroFilter_config",
}
],
}
]
```
......@@ -6,17 +6,17 @@ In an application development project, you need to declare the package structure
## Internal Structure of the config.json File
The **config.json** file consists of three mandatory tags, namely, **app**, **deviceConfig**, and ***module***. See Table 1 for details.
The **config.json** file consists of three mandatory tags, namely, **app**, **deviceConfig**, and **module**. See Table 1 for details.
Table 1 Internal structure of the config.json file
| Tag | Description | Data Type| Default|
| Tag | Description | Data Type| Initial Value Allowed|
| ------------ | ------------------------------------------------------------ | -------- | ---------- |
| app | Global configuration of an application. Different HAP files of the same application must use the same **app** configuration. For details, see [Internal Structure of the app Tag](#Internal-structure-of-the-app-tag).| Object | No |
| deviceConfig | Application configuration applied to a specific type of device. For details, see [Internal Structure of the deviceconfig Tag](#Internal-structure-of-the-deviceconfig-tag).| Object | No |
| module | Configuration of a HAP file. The ***module*** configuration is valid only for the current HAP file. For details, see [Internal Structure of the module Tag](#Internal-structure-of-the-module-tag).| Object | No |
| app | Global configuration of an application. Different HAP files of the same application must use the same **app** configuration. For details, see [Internal Structure of the app Tag](#internal-structure-of-the-app-tag).| Object | No |
| deviceConfig | Application configuration applied to a specific type of device. For details, see [Internal Structure of the deviceconfig Tag](#internal-structure-of-the-deviceconfig-tag).| Object | No |
| module | Configuration of a HAP file. The **module** configuration is valid only for the current HAP file. For details, see [Internal Structure of the module Tag](#internal-structure-of-the-module-tag).| Object | No |
Example of config.json:
Example of the **config.json** file:
```json
{
......@@ -86,16 +86,16 @@ The **app** tag contains the global configuration information of the application
Table 2 Internal structure of the app tag
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ---------- | ------------------------------------------------------------ | -------- | ------------------ |
| bundleName | Bundle name of the application. It uniquely identifies the application. The bundle name can contain only letters, digits, underscores (_), and periods (.). It must start with a letter. The value is a string with 7 to 127 bytes of a reverse domain name, for example, **com.example.myapplication**. It is recommended that the first level be the domain name suffix "com" and the second level be the vendor/individual name. More levels are also accepted.| String | No |
| bundleName | Bundle name of the application. It uniquely identifies the application. The bundle name can contain only letters, digits, underscores (_), and periods (.). It must start with a letter. The value is a string with 7 to 127 bytes of a reverse domain name, for example, **com.example.myapplication**. It is recommended that the first level be the domain suffix "com" and the second level be the vendor/individual name. More levels are also accepted.| String | No |
| vendor | Description of the application vendor. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty)|
| version | Version information of the application. For details, see Table 3. | Object | No |
| apiVersion | OpenHarmony API version on which the application depends. For details, see Table 4. | Object | Yes (initial value: left empty)|
Table 3 Internal structure of version
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------------------ | ------------------------------------------------------------ | -------- | -------------------------- |
| name | Application version number visible to users. The value can be customized and cannot exceed 127 bytes. The customization rules are as follows:<br>API 5 and earlier versions: A three-segment version number is recommended, for example, A.B.C (also compatible with A.B). In the version number, A, B, and C are integers ranging from 0 to 999. Other formats are not supported.<br> A indicates the major version number. <br> B indicates the minor version number.<br> C indicates the patch version number.<br>API 6 and later versions: A four-segment version number is recommended, for example, A.B.C.D. In the version number, A, B, and C are integers ranging from 0 to 99, and D is an integer ranging from 0 to 999.<br> A indicates the major version number. <br> B indicates the minor version number.<br> C indicates the feature version number.<br> D indicates the patch version number.| Number | No |
| code | Application version number used only for application management by OpenHarmony. This version number is not visible to users of the application. The value rules are as follows:<br>API 5 and earlier versions: It is a non-negative integer less than 32 bits in binary mode, converted from the value of version.name as follows: The conversion rules are as follows:<br> Value of **code** = A * 1,000,000 + B * 1,000 + C. For example, if the value of **version.name** is 2.2.1, the value of **code** is 2002001.<br> API 6 and later versions: The value of **code** is not associated with the value of **version.name** and can be customized. The value is a non-negative integer ranging from 2 to 31. Note that the value must be updated each time the application version is updated. The value for a later version must be greater than that for an earlier version.| Number | No |
......@@ -103,7 +103,7 @@ Table 3 Internal structure of version
Table 4 Internal structure of apiVersion
| Attribute | Description | Data Type| Default|
| Attribute | Description | Data Type| Initial Value Allowed|
| ----------- | ----------------------------------------------------------- | -------- | ---------- |
| compatible | Minimum API version required for running the application. The value ranges from 0 to 2147483647. | Integer | Yes |
| target | Target API version required for running the application. The value ranges from 0 to 2147483647.| Integer | Yes |
......@@ -129,56 +129,55 @@ Example of the app tag structure:
### Internal Structure of the deviceConfig Tag
The **deviceConfig** tag contains the application configuration information on the device, including attributes such as **default**, **tv**, **car**, **wearable**, and **liteWearable**. The **default** configuration applies to all types of devices. You need to declare the peculiar configuration of a specific device type in the associated sub-tag of this type. For details about the internal structure, see Table 5.
The **deviceConfig** tag contains the application configuration information on the device, including attributes such as **default**, **tv**, **car**, and **wearable**. The **default** configuration applies to all types of devices. You need to declare the peculiar configuration of a specific device type in the associated sub-tag of this type. For details about the internal structure, see Table 5.
Table 5 Internal structure of the deviceConfig tag
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------ | ----------------------------------------------- | -------- | ------------------ |
| default | Application configuration applied to all types of devices. See Table 6. | Object | No |
| tablet | Application configuration specific to tablets. See Table 6. | Object | Yes (initial value: left empty)|
| tv | Application configuration specific to smart TVs. See Table 6. | Object | Yes (initial value: left empty)|
| car | Application configuration specific to head units. See Table 6. | Object | Yes (initial value: left empty)|
| wearable | Application configuration specific to wearables. See Table 6. | Object | Yes (initial value: left empty)|
| liteWearable | Application configuration specific to lite wearables. See Table 6.| Object | Yes (initial value: left empty)|
For details about the internal structures of device attributes, see Table 6.
Table 6 Internal structure of device attributes
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------------ | ------------------------------------------------------------ | -------- | ----------------------- |
| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types. The value can contain a maximum of 31 characters. | String | Yes |
| supportBackup | Whether the application supports backup and restoration. If this attribute is set to **false**, backup or restoration will not be performed for the application.<br> This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | Boolean | Yes (initial value: **false**)|
| compressNativeLibs | Whether the **libs** libraries are packaged in the HAP file after being compressed. If this attribute is set to **false**, the **libs** libraries are stored without being compressed and will be directly loaded during the installation of the HAP file.<br>This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | Boolean | Yes (initial value: **true**) |
| directLaunch | Whether the application can be started when the device is locked. If you want to start the application without unlocking the device, set this attribute to **true**. Devices running OpenHarmony do not support this attribute.| Boolean | Yes (initial value: **false**)|
| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types. The value can contain a maximum of 31 characters.| String | Yes |
| supportBackup | Whether the application supports backup and restoration. The value **false** means that the application does not support backup or restoration.<br> This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| Boolean | Yes (initial value: **false**)|
| compressNativeLibs | Whether the **libs** libraries are packaged in the HAP file after being compressed. The value **false** means that the **libs** libraries are stored without being compressed and will be directly loaded during the installation of the HAP file.<br> This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| Boolean | Yes (initial value: **true**) |
| directLaunch | Whether the application can be started when the device is locked. The value **true** means that the application can be started when the device is locked. Devices running OpenHarmony do not support this attribute.| Boolean | Yes (initial value: **false**)|
| ark | Maple configuration. See Table 7. | Object | Yes (initial value: left empty) |
| network | Network security configuration. You can customize the network security settings of the application in the security statement of the configuration file without modifying the application code. See Table 9.| Object | Yes (initial value: left empty) |
Table 7 Internal structure of the **ark** attribute
Table 7 Internal structure of the ark attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ---------- | -------------------------------- | -------- | ------------------------------ |
| reqVersion | Maple version required for the application. For details, see Table 8.| Object | No |
| flag | Type of the Maple application. | String | No (available options: **m**, **mo**, **z**).|
Table 8 Internal structure of the reqVersion attribute
| Attribute | Description | Data Type| Default|
| Attribute | Description | Data Type| Initial Value Allowed|
| ---------- | --------------------------------------------------------- | -------- | ---------- |
| compatible | Minimum Maple version required for the application. The value is a 32-bit unsigned integer.| Integer | No |
| target | Type of the Maple application. The value is a 32-bit unsigned integer. | Integer | No |
Table 9 Internal structure of the network attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ---------------- | ------------------------------------------------------------ | -------- | ----------------------- |
| cleartextTraffic | Whether to allow the application to use plaintext traffic, for example, plaintext HTTP traffic.<br> **true**: The application is allowed to use plaintext traffic.<br> **false**: The application is not allowed to use plaintext traffic.| Boolean | Yes (initial value: **false**)|
| securityConfig | Network security configuration of the application. For details, see Table 10. | Object | Yes (initial value: left empty) |
Table 10 Internal structure of the securityConfig attribute
| Attribute | Sub-attribute | Description | Data Type| Default |
| Attribute | Sub-attribute | Description | Data Type| Initial Value Allowed |
| -------------- | ------------------ | ------------------------------------------------------------ | -------- | ---------------- |
| domainSettings | - | Security settings of the custom network domain. This attribute allows nested domains. To be more specific, the **domainSettings** object of a large domain can be nested with the **domainSettings** objects of small network domains.| Object| Yes (initial value: left empty)|
| | cleartextPermitted | Whether plaintext traffic can be transmitted in the custom network domain. If both **cleartextTraffic** and **security** are declared, whether plaintext traffic can be transmitted in the custom network domain is determined by the **cleartextPermitted** attribute.<br>**true**: Plaintext traffic can be transmitted.<br>**false**: Plaintext traffic cannot be transmitted.| Boolean| No |
......@@ -215,28 +214,28 @@ The **module** tag contains the configuration information of the HAP file. For d
Table 11 Internal structure of the module tag
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| --------------- | ------------------------------------------------------------ | ---------- | ------------------------------------------------------------ |
| mainAbility | Ability displayed on the Service Center icon. When the resident process is started, the **mainAbility** is started.| String | No if any ability using the Page template exists |
| package | Structure name of the HAP file. The value must be unique in the application. The value is a string with a maximum of 127 bytes, in the reverse domain name notation. It is recommended that the value be the same as the project directory of the HAP file. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | No |
| name | Class name of the HAP file. The value is in the reverse domain name notation. The prefix must be the same as the package name specified by the **package** label at the same level. The value can also start with a period (.). The value is a string with a maximum of 255 bytes.<br>This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | No |
| description | Description of the HAP file. The value is a string with a maximum of 255 bytes. If the value exceeds the limit or needs to support multiple languages, you can use a resource index to the description. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | Yes (initial value: left empty) |
| package | Structure name of the HAP file, which must be unique in the application. The value is a string with a maximum of 127 bytes, in the reverse domain name notation. It is recommended that the value be the same as the project directory of the HAP file. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | No |
| name | Class name of the HAP file. The value is in the reverse domain name notation. The prefix must be the same as the package name specified by the **package** label at the same level. The value can also start with a period (.). The value is a string with a maximum of 255 bytes.<br> This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | No |
| description | Description of the HAP file. The value is a string with a maximum of 255 bytes. If the value exceeds the limit or needs to support multiple languages, you can use a resource index to the description. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | Yes (initial value: left empty) |
| supportedModes | Mode supported by the application. Currently, only the **drive** mode is defined. This attribute applies only to head units.| String array| Yes (initial value: left empty) |
| deviceType | Type of device on which the abilities can run. The device types predefined in the system include **tablet**, **tv**, **car**, **wearable**, and **liteWearable**. | String array| No |
| distro | Distribution description of the current HAP file. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. For details, see Table 12. | Object | No |
| deviceType | Type of device on which the abilities can run. The device types predefined in the system include **tablet**, **tv**, **car**, and **wearable**.| String array| No |
| distro | Distribution description of the current HAP file. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types. For details, see Table 12.| Object | No |
| metaData | Metadata of the HAP file. For details, see Table 13. | Object | Yes (initial value: left empty) |
| abilities | All abilities in the current module. The value is an array of objects, each of which represents a shortcut object. For details, see Table 17.| Object array | Yes (initial value: left empty) |
| js | A set of JS modules developed using the ArkUI framework. Each element in the set represents the information about a JS module. For details, see Table 22.| Object array | Yes (initial value: left empty) |
| shortcuts | Shortcut information of the application. The value is an array of objects, each of which represents a shortcut object. For details, see Table 25.| Object array | Yes (initial value: left empty) |
| reqPermissions | Permissions that the application applies for from the system before its running. For details, see Table 21. | Object array | Yes (initial value: left empty) |
| colorMode | Color mode of the application.<br>**dark**: Resources applicable for the dark mode are selected.<br>**light**: Resources applicable for the light mode are selected.<br>**auto**: Resources are selected based on the color mode of the system.<br>This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | Yes (initial value: **auto**) |
| distroFilter | Application distribution rules.<br> This attribute defines the rules for distributing HAP files based on different device specifications, so that precise matching can be performed when AppGallery distributes applications. Applications can be distributed by API version, screen shape, or screen resolution. During distribution, a unique HAP is determined based on the mapping between **deviceType** and these three factors. For details, see Table 29. | Object | Yes (initial value: left empty) Configure this attribute when an application has multiple entry modules.|
| colorMode | Color mode of the application.<br>**dark**: Resources applicable for the dark mode are selected.<br>**light**: Resources applicable for the light mode are selected.<br>**auto**: Resources are selected based on the color mode of the system.<br>This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types. | String | Yes (initial value: **auto**) |
| distroFilter | Application distribution rules.<br>AppGallery uses these rules to distribute HAP files to the matching devices. Distribution rules cover three factors: API version, screen shape, and screen resolution. AppGallery distributes a HAP file to the device whose on the mapping between **deviceType** and these three factors. For details, see Table 29. | Object | Yes (initial value: left empty)<br/>Set this attribute when an application has multiple entry modules. |
| reqCapabilities | Device capabilities required for running the application. | String array| Yes (initial value: left empty) |
| commonEvents | Static broadcast. For details, see Table 35. | Object array | Yes (initial value: left empty) |
| allowClassMap | Metadata of the HAP file. The value can be **true** or **false**. If the value is **true**, the HAP file uses the Java object proxy mechanism provided by the OpenHarmony framework. | Boolean | No (initial value: **false**) |
| entryTheme | Keyword of an OpenHarmony internal topic. Set it to the resource index of the name.| String | Yes (initial value: left empty) |
| entryTheme | Keyword of an OpenHarmony internal theme. Set it to the resource index of the name.| String | Yes (initial value: left empty) |
Example of the module tag structure:
Example of the **module** tag structure:
```json
"module": {
......@@ -272,13 +271,13 @@ Example of the module tag structure:
Table 12 Internal structure of the distro attribute
| Attribute | Description | Data Type| Default|
| 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.<br> **true**: The HAP file supports the installation-free feature and meets installation-free constraints.<br> **false**: The HAP file does not support the installation-free feature.<br> Pay attention to the following:<br> When **entry.hap** is set to **true**, all **feature.hap** fields related to **entry.hap **must be **true**.<br> 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 |
Example of the distro attribute structure:
Example of the **distro** attribute structure:
```json
"distro": {
......@@ -290,7 +289,7 @@ Example of the distro attribute structure:
Table 13 Internal structure of the metaData attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------- | ------------------------------------------------------------ | -------- | -------------------- |
| parameters | Metadata of the parameters to be passed for calling the ability. The metadata of each parameter consists of the **description**, **name**, and **type** sub-attributes. For details, see Table 14.| Object array| Yes (initial value: left empty) |
| results | Metadata of the ability return value. The metadata of each return value consists of the **description**, **name**, and **type** sub-attributes. For details, see Table 15.| Object array| Yes (initial value: left empty)|
......@@ -298,7 +297,7 @@ Table 13 Internal structure of the metaData attribute
Table 14 Internal structure of the parameters attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ----------- | ------------------------------------------------------------ | -------- | ------------------ |
| description | Description of the parameter. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String | Yes (initial value: left empty)|
| name | Name of the parameter. The value can contain a maximum of 255 characters. | String | Yes (initial value: left empty)|
......@@ -306,7 +305,7 @@ Table 14 Internal structure of the parameters attribute
Table 15 Internal structure of the results attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ----------- | ------------------------------------------------------------ | -------- | -------------------- |
| description | Description of the return value. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String | Yes (initial value: left empty)|
| name | Name of the return value. The value can contain a maximum of 255 characters. | String | Yes (initial value: left empty)|
......@@ -314,13 +313,13 @@ Table 15 Internal structure of the results attribute
Table 16 Internal structure of the customizeData attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ---------------------------------------------------------- | -------- | -------------------- |
| name | Key of a data element. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty)|
| value | Value of a data element. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty)|
| extra | Custom format of the data element. The value is an index to the resource that identifies the data.| String | Yes (initial value: left empty)|
Example of the metaData attribute structure:
Example of the **metaData** attribute structure:
```json
"metaData": {
......@@ -344,45 +343,47 @@ Example of the metaData attribute structure:
Table 17 Internal structure of the abilities attribute
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| ---------------- | ------------------------------------------------------------ | ---------- | -------------------------------------------------------- |
| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. If this attribute is set to the name of the process running other applications, all these applications can run in the same process, provided they have the same unified user ID and the same signature. Devices running OpenHarmony do not support this attribute.| String | Yes (initial value: left empty) |
| name | Name of the ability. The value is a reverse domain name, in the format of "*Bundle name*.*Class name*", for example, **"com.example.myapplication.MainAbility"**. Alternatively, the value can start with a period (.) followed by the class name, for example, **".MainAbility"**.<br>The ability name must be unique in an application. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types.<br>Note: When you use DevEco Studio to create a project, the configuration of the first ability is generated by default, including the **MainAbility.java** file and the class name **MainAbility** defaulted in the **name** string for the **abilities** attribute in **config.json**. The value of this attribute can be customized if you use other IDE tools. The value can contain a maximum of 127 characters. | String | No |
| name | Name of the ability. The value is a reverse domain name, in the format of "*Bundle name*.*Class name*", for example, **"com.example.myapplication.MainAbility"**. Alternatively, the value can start with a period (.) followed by the class name, for example, **".MainAbility"**.<br> The ability name must be unique in an application. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.<br> Note: When you use DevEco Studio to create a project, the configuration of the first ability is generated by default, including the **MainAbility.java** file and the class name **MainAbility** defaulted in the **name** string for the **abilities** attribute in **config.json**. The value of this attribute can be customized if you use other IDE tools. The value can contain a maximum of 127 characters.| String | No |
| description | Description of the ability. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String | Yes (initial value: left empty) |
| icon | Index to the ability icon file. Example value: **$media:ability_icon**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the icon of the ability is also used as the icon of the application. If multiple abilities address this condition, the icon of the first candidate ability is used as the application icon.<br> Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels.| String | Yes (initial value: left empty) |
| label | Ability name visible to users. The value can be a name string or a resource index to names in multiple languages. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the label of the ability is also used as the label of the application. If multiple abilities address this condition, the label of the first candidate ability is used as the application label.<br> Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels. The value can be a reference to a string defined in a resource file or a string enclosed in brackets ({}). The value can contain a maximum of 255 characters.| String | Yes (initial value: left empty) |
| uri | Uniform Resource Identifier (URI) of the ability. The value can contain a maximum of 255 characters. | String | Yes (No for abilities using the Data template) |
| launchType | Startup type of the ability. The value can be **standard**, **singleMission**, or **singleton**.<br>**standard**: Multiple **Ability** instances can be created during startup.<br>Most abilities can use this type.<br>**singleMission**: Only a single **Ability** instance can be created in each task stack during startup.<br>**singleton**: Only a single **Ability** instance can be created across all task stacks during startup. For example, a globally unique incoming call screen uses the singleton startup type. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | Yes (initial value: **standard**) |
| launchType | Startup type of the ability. The value can be **standard** or **singleton**.<br>**standard**: Multiple **Ability** instances can be created during startup. Most abilities can use this type.<br>**singleton**: Only a single **Ability** instance can be created across all task stacks during startup. For example, a globally unique incoming call screen uses the singleton startup type. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | Yes (initial value: **"singleton"**) |
| visible | Whether the ability can be called by other applications.<br>**true**: The ability can be called by other applications.<br>**false**: The ability cannot be called by other applications.| Boolean | Yes (initial value: **false**) |
| permissions | Permissions required for abilities of another application to call the current ability, generally in the format of a reverse domain name. The value can be either the permissions predefined in the OS or your custom permissions.| String array| Yes (initial value: left empty) |
| skills | Types of the **want** that can be accepted by the ability. | Object array | Yes (initial value: left empty) |
| deviceCapability | Device capabilities required to run the ability.| String array| Yes (initial value: left empty) |
| metaData | Metadata. For details, see Table 13. | Object | Yes (initial value: left empty) |
| type | Type of the ability. Available values are as follows:<br>**page**: FA developed using the Page template to provide the capability of interacting with users.<br>**service**: PA developed using the Service template to provide the capability of running tasks in the background.<br>**data**: PA developed using the Data template to provide unified data access for external systems.<br>**CA**: ability that can be started by other applications as a window.| String | No |
| orientation | Display orientation of the ability. This attribute applies only to the ability using the Page template. Available values are as follows:<br>unspecified: indicates that the system automatically determines the display orientation of the ability.<br>**landscape**: indicates the landscape orientation.<br>**portrait**: indicates the portrait orientation.<br>**followRecent**: indicates that the orientation follows the most recent application in the stack.| String | Yes (initial value: **unspecified**) |
| orientation | Display orientation of the ability. This attribute applies only to the ability using the Page template. Available values are as follows:<br>unspecified: indicates that the system automatically determines the display orientation of the ability.<br>**landscape**: indicates the landscape orientation.<br>**portrait**: indicates the portrait orientation.<br>**followRecent**: indicates that the orientation follows the most recent application in the stack.| String | Yes (initial value: **"unspecified"**) |
| backgroundModes | Background service type of the ability. You can assign multiple background service types to a specific ability. This attribute applies only to the ability using the Service template. Available values are as follows:<br>**dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices<br>**audioPlayback**: audio playback service<br>**audioRecording**: audio recording service<br>**pictureInPicture**: picture in picture (PiP) and small-window video playback services<br>**voip**: voice/video call and VoIP services<br>**location**: location and navigation services<br>**bluetoothInteraction**: Bluetooth scanning, connection, and transmission services<br>**wifiInteraction**: WLAN scanning, connection, and transmission services<br>**screenFetch**: screen recording and screenshot services<br>**multiDeviceConnection**: multi-device interconnection service| String array| Yes (initial value: left empty) |
| grantPermission | Whether permissions can be granted for any data in the ability. | Boolean | Yes (initial value: left empty) |
| readPermission | Permission required for reading data in the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | Yes (initial value: left empty) |
| writePermission | Permission required for writing data to the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | Yes (initial value: left empty) |
| readPermission | Permission required for reading data in the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | Yes (initial value: left empty) |
| writePermission | Permission required for writing data to the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | Yes (initial value: left empty) |
| configChanges | System configurations that the ability concerns. Upon any changes on the concerned configurations, the **onConfigurationUpdated** callback will be invoked to notify the ability. Available values are as follows:<br>**mcc**: indicates that the mobile country code (MCC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MCC is updated.<br>**mnc**: indicates that the mobile network code (MNC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MNC is updated.<br>**locale**: indicates that the locale is changed. Typical scenario: The user has selected a new language for the text display of the device.<br>**layout**: indicates that the screen layout is changed. Typical scenario: Currently, different display forms are all in the active state.<br>**fontSize**: indicates that font size is changed. Typical scenario: A new global font size is set.<br>**orientation**: indicates that the screen orientation is changed. Typical scenario: The user rotates the device.<br>**density**: indicates that the display density is changed. Typical scenario: The user may specify different display ratios, or different display forms are active at the same time.<br>**size**: indicates that the size of the display window is changed.<br>**smallestSize**: indicates that the length of the shorter side of the display window is changed.<br>**colorMode**: indicates that the color mode is changed.| String array| Yes (initial value: left empty) |
| mission | Task stack of the ability. This attribute applies only to the ability using the Page template. By default, all abilities in an application belong to the same task stack. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | Yes (initial value: bundle name of the application) |
| targetAbility | Target ability that this ability alias points to. This attribute applies only to the ability using the Page template. If the **targetAbility** attribute is set, only **name**, **icon**, **label**, **visible**, **permissions**, and **skills** take effect in the current ability (ability alias). Other attributes use the values of the **targetAbility** attribute. The target ability must belong to the same application as the alias and must be declared in **config.json** ahead of the alias. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | String | Yes (initial value: left empty, indicating that the current ability is not an alias)|
| multiUserShared | Whether the ability supports data sharing among multiple users. This attribute applies only to the ability using the Data template. If this attribute is set to **true**, only one copy of data is stored for multiple users. Note that this attribute will invalidate the **visible** attribute. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | Boolean | Yes (initial value: **false**) |
| supportPipMode | Whether the ability allows the user to enter the Picture in Picture (PiP) mode. The PiP mode enables the user to watch a video in a small window that hovers on top of a full screen window (main window). This attribute applies only to the ability using the Page template. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. | Boolean | Yes (initial value: **false**) |
| mission | Task stack of the ability. This attribute applies only to the ability using the Page template. By default, all abilities in an application belong to the same task stack. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | Yes (initial value: bundle name of the application) |
| targetAbility | Target ability that this ability alias points to. This attribute applies only to the ability using the Page template. If the **targetAbility** attribute is set, only **name**, **icon**, **label**, **visible**, **permissions**, and **skills** take effect in the current ability (ability alias). Other attributes use the values of the **targetAbility** attribute. The target ability must belong to the same application as the alias and must be declared in **config.json** ahead of the alias. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String | Yes (initial value: left empty, indicating that the current ability is not an alias)|
| multiUserShared | Whether the ability supports data sharing among multiple users. This attribute applies only to the ability using the Data template. If this attribute is set to **true**, only one copy of data is stored for multiple users. Note that this attribute will invalidate the **visible** attribute. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| Boolean | Yes (initial value: **false**) |
| supportPipMode | Whether the ability allows the user to enter the Picture in Picture (PiP) mode. The PiP mode enables the user to watch a video in a small window that hovers on top of a full screen window (main window). This attribute applies only to the ability using the Page template. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| Boolean | Yes (initial value: **false**) |
| formsEnabled | Whether the ability can provide forms. This attribute applies only to the ability using the Page template.<br>**true**: This ability can provide forms.<br>**false**: This ability cannot provide forms.| Boolean | Yes (initial value: **false**) |
| forms | Details about the forms used by the ability. This attribute is valid only when **formsEnabled** is set to **true**. For details, see Table 27.| Object array | Yes (initial value: left empty) |
| srcLanguage | Programming language used to develop the ability. | String | The value can be **java**, **js**, or **ets**. |
| srcPath | Path of the JS code and components corresponding to the ability. | String | Yes (initial value: left empty) |
| uriPermission | Application data that the ability can access. This attribute consists of the **mode** and **path** sub-attributes. This attribute is valid only for the capability of the type provider. Devices running OpenHarmony do not support this attribute. For details, see Table 18.| Object | Yes (initial value: left empty) |
| startWindowIcon | Index to the icon file of the ability startup page. Example value: **$media:icon**. | String | Yes (initial value: left empty) |
| startWindowBackground | Index to the background color resource file of the ability startup page. Example value: **$color:red**. | String | Yes (initial value: left empty) |
Table 18 Internal structure of the uriPermission attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ----------------------- | -------- | ------------------------- |
| path | Path identified by **uriPermission**.| String | No |
| mode | Mode matching the **uriPeimission**.| String | Yes (initial value: *default***)|
| mode | Mode matching the **uriPermission**.| String | Yes (initial value: *default***)|
Example of the abilities attribute structure:
Example of the **abilities** attribute structure:
```json
"abilities": [
......@@ -412,7 +413,9 @@ Example of the abilities attribute structure:
"fontSize",
"orientation"
],
"type": "page"
"type": "page",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:red"
},
{
"name": ".PlayService",
......@@ -449,7 +452,7 @@ Example of the abilities attribute structure:
Table 19 Internal structure of the skills attribute
| Attribute| Description | Data Type | Default |
| Attribute| Description | Data Type | Initial Value Allowed |
| -------- | ------------------------------------------------------------ | ---------- | -------------------- |
| actions | Actions of the **want** that can be accepted by the ability. Generally, the value is an **action** value predefined in the system.| String array| Yes (initial value: left empty)|
| entities | Entities of the **want** that can be accepted by the ability, such as video and Home application.| String array| Yes (initial value: left empty)|
......@@ -457,7 +460,7 @@ Table 19 Internal structure of the skills attribute
Table 20 Internal structure of the uris attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------- | -------------------------- | -------- | -------------------- |
| scheme | Scheme in the URI. | String | No |
| host | Host in the URI. | String | Yes (initial value: left empty)|
......@@ -467,7 +470,7 @@ Table 20 Internal structure of the uris attribute
| pathRegx | **pathRegx** value in the URI. | String | Yes (initial value: left empty)|
| type | Type of the URI. | String | Yes (initial value: left empty)|
Example of the skills attribute structure:
Example of the **skills** attribute structure:
```json
"skills": [
......@@ -496,34 +499,34 @@ Table 21 reqPermissions
| Attribute | Description | **Type**| **Value Range** | **Default Value** | **Restrictions** |
| --------- | ------------------------------------------------------------ | -------- | ----------------------------------------------------------- | ---------------------- | ------------------------------------------------------------ |
| name | Permission name, which is mandatory. | String | Custom | None | Parsing will fail if this field is not set. |
| reason | Reason for applying for the permission, which is mandatory only when applying for the **user_grant** permission.| String | The displayed text cannot exceed 256 bytes. | Empty | This field is mandatory for the **user_grant** permission. If it is left empty, application release will be rejected. Multi-language adaptation is required.|
| usedScene | Description of the application scenario and timing for using the permission, which is mandatory only when applying for the **user_grant** permission. This attribute consists of the **ability** and **when** sub-attributes. Multiple abilities can be configured.| Object | **ability**: ability name; **when**: **inuse** or **always**| **ability**: left empty; **when**: **inuse**| The **ability** sub-attribute is mandatory for the **user_grant** permission, and the **when** field is optional. |
| reason | Reason for applying for the permission, which is mandatory only when applying for the **user_grant** permission.| String | The displayed text cannot exceed 256 bytes. | Empty | If the requested permission is **user_grant**, this attribute is required for the application to be released to AppGallery. Multi-language adaptation is required.|
| usedScene | Application scenario and timing for using the permission, which is mandatory when the requested permission is **user_grant**. This attribute consists of the **ability** and **when** sub-attributes. Multiple abilities can be configured.| Object | **ability**: ability name; **when**: **inuse** or **always**| **ability**: left empty; **when**: **inuse**| If the requested permission is **user_grant**, the **ability** sub-attribute is mandatory and **when** is optional. |
Table 22 Internal structure of the js attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | ------------------------ |
| name | Name of a JavaScript component. The default value is **default**. | String | No |
| pages | Route information about all pages in the JavaScript component, including the page path and page name. The value is an array, in which each element represents a page. The first element in the array represents the home page of the JavaScript FA.| Array | No |
| window | Window-related configurations. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device type types. For details, see Table 23. | Object | Yes |
| window | Window-related configurations. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types. For details, see Table 23.| Object | Yes |
| type | Type of the JavaScript component. Available values are as follows:<br>**normal**: indicates that the JavaScript component is an application instance.<br>**form**: indicates that the JavaScript component is a widget instance.| String | Yes (initial value: **normal**)|
| mode | Development mode of the JavaScript component. For details, see Table 24. | Object | Yes (initial value: left empty) |
Table 23 Internal structure of the window attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| --------------- | ------------------------------------------------------------ | -------- | ----------------------- |
| designWidth | Baseline width for page design, in pixels. The size of an element is scaled by the actual device width.| Number | Yes (initial value: 720px) |
| autoDesignWidth | Whether to automatically calculate the baseline width for page design. If it is set to **true**, the **designWidth** attribute becomes invalid. The baseline width is calculated based on the device width and screen density.| Boolean| Yes (initial value: **false**)|
Table 24 Internal structure of the **mode** attribute
Table 24 Internal structure of the mode attribute
| Attribute| Description | Data Type | Default |
| Attribute| Description | Data Type | Initial Value Allowed |
| -------- | -------------------- | ----------------------------------- | --------------------------- |
| type | Type of the JavaScript component.| String. The value can be **pageAbility** or **form**.| Yes (initial value: **pageAbility**)|
| syntax | Syntax type of the JavaScript component.| String. The value can be **hml** or **ets**. | Yes (initial value: **hml**) |
Example of the js attribute structure:
Example of the **js** attribute structure:
```json
"js": [
......@@ -544,7 +547,7 @@ Example of the js attribute structure:
Table 25 Internal structure of the shortcuts attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ---------- | ------------------------------------------------------------ | -------- | ------------------ |
| shortcutId | Shortcut ID. 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)|
......@@ -553,12 +556,12 @@ Table 25 Internal structure of the shortcuts attribute
Table 26 Internal structure of the intents attribute
| Attribute | Description | Data Type| Default |
| Attribute | Description | Data Type| Initial Value Allowed |
| ------------ | --------------------------------------- | -------- | -------------------- |
| targetClass | Class name for the target ability of the shortcut. | String | Yes (initial value: left empty)|
| targetBundle | Application bundle name for the target ability of the shortcut.| String | Yes (initial value: left empty)|
Example of the shortcuts attribute structure:
Example of the **shortcuts** attribute structure:
```json
"shortcuts": [
......@@ -577,7 +580,7 @@ Example of the shortcuts attribute structure:
Table 27 Internal structure of the forms attribute
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| ------------------- | ------------------------------------------------------------ | ---------- | ------------------------ |
| name | Class name of the widget. The value is a string with a maximum of 127 bytes. | String | No |
| description | Description of the widget. The value can be a string or a resource index to descriptions in multiple languages. The value is a string with a maximum of 255 bytes.| String | Yes (initial value: left empty) |
......@@ -591,7 +594,7 @@ Table 27 Internal structure of the forms attribute
| updateEnabled | Whether the widget can be updated periodically. Available values are as follows:<br>**true**: The widget can be updated periodically, depending on the update way you select, either at a specified interval (**updateDuration**) or at the scheduled time (**scheduledUpdateTime**). **updateDuration** is preferentially recommended.<br>**false**: The widget cannot be updated periodically.| Boolean | No |
| scheduledUpdateTime | Scheduled time to update the widget. The value is in 24-hour format and accurate to minute. | String | Yes (initial value: **0:0**) |
| updateDuration | Interval to update the widget. The value is a natural number, in the unit of 30 minutes.<br>If the value is **0**, this field does not take effect.<br>If the value is a positive integer ***N***, the interval is calculated by multiplying ***N*** and 30 minutes.| Number | Yes (initial value: **0**) |
| formConfigAbility | Link to a specific page of the application. The value is a URI. | String | Yes (initial value: left empty) |
| formConfigAbility | Link to a specific page of the application. The value is a URI. | String | Yes (initial value: left empty) |
| formVisibleNotify | Whether the widget is allowed to use the widget visibility notification. | String | Yes (initial value: left empty) |
| jsComponentName | Component name of the widget. The value is a string with a maximum of 127 bytes. This attribute is required only by JavaScript-programmed widgets.| String | No |
| metaData | Metadata of the widget. This attribute contains the array of the **customizeData** attribute. For details, see Table 13. | Object | Yes (initial value: left empty) |
......@@ -599,13 +602,13 @@ Table 27 Internal structure of the forms attribute
Table 28 Internal structure of the customizeData attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | --------------------------------------------------- | -------- | -------------------- |
| name | Name in the custom name-value pair. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty)|
| value | Value in the custom name-value pair. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty)|
| extra | Format of the current custom data. The value is the resource value of **extra**.| String | Yes (initial value: left empty)|
Example of the forms attribute structure:
Example of the **forms** attribute structure:
```json
"forms": [
......@@ -660,7 +663,7 @@ Example of the forms attribute structure:
Table 29 Internal structure of the distroFilter attribute
| Attribute | Description | Data Type| Default|
| Attribute | Description | Data Type| Initial Value Allowed|
| ------------- | ------------------------------------------------------------ | -------- | ---------- |
| apiVersion | Supported API versions. For details, see Table 30. | Object | No |
| screenShape | Supported screen shapes. For details, see Table 31. | Object array| No |
......@@ -670,40 +673,40 @@ Table 29 Internal structure of the distroFilter attribute
Table 30 Internal structure of the apiVersion attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | An integer of the existing API version, for example, 4, 5, or 6. Example: If an application uses two software versions developed using API 5 and API 6 for the same device model, two installation packages of the entry type can be released.| Array | Yes (initial value: left empty)|
Table 31 Internal structure of the screenShape attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | The value can be **circle** or **rect**. Example: Different HAPs can be provided for a smart watch with a circular face and that with a rectangular face.| Array | Yes (initial value: left empty)|
Table 32 Internal structure of the screenWindow attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | Width and height of the screen. The value of a single string is in the format of Width x Height in pixels, for example, **454*454**.| Array | Yes (initial value: left empty)|
Table 33 Internal structure of the screenDensity attribute
| Attribute| Description | Data Type| Default |
| Attribute| Description | Data Type| Initial Value Allowed |
| -------- | ------------------------------------------------------------ | -------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | Available values are as follows:<br>**sdpi**: screen density with small-scale dots per inch (SDPI). This value is applicable for devices with a DPI range of (0, 120].<br>**mdpi**: screen density with medium-scale dots per inch (MDPI). This value is applicable for devices with a DPI range of (120, 160].<br>**ldpi**: screen density with large-scale dots per inch (LDPI). This value is applicable for devices with a DPI range of (160, 240].<br>**xldpi**: screen density with extra-large-scale dots per inch (XLDPI). This value is applicable for devices with a DPI range of (240, 320].<br>**xxldpi**: screen density with extra-extra-large-scale dots per inch (XXLDPI). This value is applicable for devices with a DPI range of (320, 480].<br>**xxxldpi**: screen density with extra-extra-extra-large-scale dots per inch (XXXLDPI). This value is applicable for devices with a DPI range of (480, 640].| Array | Yes (initial value: left empty)|
Table 34 Internal structure of the countryCode attribute
| Attribute| Description | Data Type | Default |
| Attribute| Description | Data Type | Initial Value Allowed |
| -------- | ------------------------------------------------------------ | ---------- | -------------------- |
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**.**include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| policy | Blocklist and trustlist rule of the sub-attribute value. Set this attribute to **exclude** or **include**. **include** indicates that the sub-attribute value is in the trustlist. If the value matches any of the **value** enums, it matches this attribute.| String | Yes (initial value: left empty)|
| value | Country code of the area to which the application is to be distributed. The value is a string array, of which each substring indicates a country or region. The substring consists of two uppercase letters.| String array| Yes (initial value: left empty)|
Example of the distroFilter attribute structure:
Example of the **distroFilter** attribute structure:
```json
"distroFilter": {
......@@ -732,15 +735,15 @@ Example of the distroFilter attribute structure:
Table 35 Internal structure of the commonEvents attribute
| Attribute | Description | Data Type | Default |
| Attribute | Description | Data Type | Initial Value Allowed |
| ---------- | ------------------------------------------------------------ | ---------- | ------------------ |
| name | Name of a static broadcast. | String | No |
| permission | Permission that needs to be applied for to implement the static common event. | String array| Yes (initial value: left empty)|
| permission | Permission needed to implement the static common event. | String array| Yes (initial value: left empty)|
| data | Additional data array to be carried by the current static common event. | String array| Yes (initial value: left empty)|
| type | Type array of the current static common event. | String array| Yes (initial value: left empty)|
| events | A set of events for the wants that can be received. The value can be system predefined or custom.| String array| No |
Example of the commonEvents attribute structure:
Example of the **commonEvents** attribute structure:
```json
"commonEvents": [
......
......@@ -76,7 +76,7 @@ Use the **type** parameter to set the button type to **Capsule**, **Circle**, or
.borderRadius(20)
```
![zh-cn_image_0000001190463780](figures/zh-cn_image_0000001190463780.png)
![en-us_image_0000001190463780](figures/en-us_image_0000001190463780.png)
- Set the text style:
......@@ -90,7 +90,7 @@ Use the **type** parameter to set the button type to **Capsule**, **Circle**, or
.fontWeight(800)
```
![zh-cn_image_0000001189744672](figures/zh-cn_image_0000001189744672.png)
![en-us_image_0000001189744672](figures/en-us_image_0000001189744672.png)
- Set the background color:
......
# FAQ<a name="EN-US_TOPIC_0000001153683024"></a>
# FAQs<a name="EN-US_TOPIC_0000001153683024"></a>
## How Do I Mount the Heap Memory to the Kernel?<a name="section965418378552"></a>
......
# OpenHarmony Device Development Documentation
- [Device Development Guide](device-dev-guide.md)
- Getting Started
- - Getting Started
- Getting Started with Mini and Small Systems (IDE Mode, Recommended)
- [Mini and Small System Overview](quick-start/quickstart-ide-lite-overview.md)
- Environment Preparation
......@@ -94,11 +95,16 @@
- [Introduction to the RK3568 Development Board](quick-start/quickstart-standard-board-introduction-rk3568.md)
- [Reference](quick-start/quickstart-standard-reference.md)
- [Obtaining Source Code](get-code/sourcecode-acquire.md)
- Compatibility and Security
- [Privacy Protection](security/security-privacy-protection.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- Porting
- Mini System SoC Porting Guide
- Porting Preparations
- [Before You Start](porting/porting-chip-prepare-knows.md)
- [Building Adaptation Process](porting/porting-chip-prepare-process.md)
......@@ -114,8 +120,10 @@
- [lwIP Module Adaptation](porting/porting-chip-board-lwip.md)
- [Third-party Module Adaptation](porting/porting-chip-board-bundle.md)
- [XTS](porting/porting-chip-board-xts.md)
- [FAQ](porting/porting-chip-faqs.md)
- [FAQs](porting/porting-chip-faqs.md)
- Small System SoC Porting Guide
- Porting Preparations
- [Before You Start](porting/porting-smallchip-prepare-needs.md)
- [Compilation and Building](porting/porting-smallchip-prepare-building.md)
......@@ -126,17 +134,23 @@
- [Overview](porting/porting-smallchip-driver-overview.md)
- [Platform Driver Porting](porting/porting-smallchip-driver-plat.md)
- [Device Driver Porting](porting/porting-smallchip-driver-oom.md)
- Standard System SoC Porting Guide
- [Standard System Porting Guide](porting/standard-system-porting-guide.md)
- [A Method for Rapidly Porting the OpenHarmony Linux Kernel](porting/porting-linux-kernel.md)
- Third-Party Library Porting Guide for Mini and Small Systems
- [Overview](porting/porting-thirdparty-overview.md)
- [Porting a Library Built Using CMake](porting/porting-thirdparty-cmake.md)
- [Porting a Library Built Using Makefile](porting/porting-thirdparty-makefile.md)
- Mini System SoC Porting Cases
- [Mini-System Devices with Screens — Bestechnic SoC Porting Case](porting-bes2600w-on-minisystem-display-demo.md)
- [Combo Solution – ASR Chip Porting Case](porting-asr582x-combo-demo.md)
- [Mini-System Devices with Screens — Bestechnic SoC Porting Case](porting/porting-bes2600w-on-minisystem-display-demo.md)
- [Combo Solution – ASR Chip Porting Case](porting/porting-asr582x-combo-demo.md)
- Subsystem Development
- Kernel
- Kernel for Mini Systems
- [Kernel Overview](kernel/kernel-mini-overview.md)
......@@ -285,8 +299,8 @@
- [Magic Key](kernel/kernel-small-debug-shell-magickey.md)
- [User-Space Exception Information](kernel/kernel-small-debug-shell-error.md)
- [Trace](kernel/kernel-small-debug-trace.md)
- [perf](kernel/kernel-mini-memory-perf)
- [LMS](kernel/kernel-small-memory-lms)
- [perf](kernel/kernel-mini-memory-perf.md)
- [LMS](kernel/kernel-small-memory-lms.md)
- [CPUP](kernel/kernel-small-debug-process-cpu.md)
- Memory Debugging
- [Memory Information Statistics](kernel/kernel-small-debug-memory-info.md)
......@@ -438,23 +452,23 @@
- [Telephony Development](subsystems/subsys-tel-guide.md)
- Security
- [Overview](subsystems/subsys-security-overview.md)
- [Development Guidelines on Application Signature Verification](subsystems/subsys-security-sigverify.md)
- [Development Guidelines on Application Permission Management](subsystems/subsys-security-rightmanagement.md)
- [Development Guidelines on IPC Authentication](subsystems/subsys-security-communicationverify.md)
- [Development on Application Signature Verification](subsystems/subsys-security-sigverify.md)
- [Development on Application Permission Management](subsystems/subsys-security-rightmanagement.md)
- [Development on IPC Authentication](subsystems/subsys-security-communicationverify.md)
- [Development on Device Security Level Management](subsystems/subsys-security-devicesecuritylevel.md)
- Startup
- [Startup](subsystems/subsys-boot-overview.md)
- [init Module](subsystems/subsys-boot-init.md)
- [appspawn Module](subsystems/subsys-boot-appspawn.md)
- [appspawn Module for the Standard System](subsystems/subsys-boot-appspawn-standard.md)
- [bootstrap Module](subsystems/subsys-boot-bootstrap.md)
- [syspara Module](subsystems/subsys-boot-syspara.md)
- [FAQs](subsystems/subsys-boot-faqs.md)
- [Reference](subsystems/subsys-boot-ref.md)
- [Test](subsystems/subsys-testguide-test.md)
- DFX
- [DFX](subsystems/subsys-dfx-overview.md)
- [HiLog Development](subsystems/subsys-dfx-hilog-rich.md)
- [HiLog_Lite Development](subsystems/subsys-dfx-hilog-lite.md)
- [HiLog\_Lite Development](subsystems/subsys-dfx-hilog-lite.md)
- [HiTrace Development](subsystems/subsys-dfx-hitrace.md)
- [HiCollie Development](subsystems/subsys-dfx-hicollie.md)
- HiSysEvent Development
......@@ -463,6 +477,8 @@
- [HiSysEvent Listening](subsystems/subsys-dfx-hisysevent-listening.md)
- [HiSysEvent Query](subsystems/subsys-dfx-hisysevent-query.md)
- [HiSysEvent Tool Usage](subsystems/subsys-dfx-hisysevent-tool.md)
- [HiDumper Development](subsystems/subsys-dfx-hidumper.md)
- [HiChecker Development](subsystems/subsys-dfx-hichecker.md)
- Featured Topics
- HPM Part
- [HPM Part Overview](hpm-part/hpm-part-about.md)
......@@ -480,7 +496,7 @@
- [Photographing](guide/device-iotcamera-control-demo-photodevguide.md)
- [Video Recording](guide/device-iotcamera-control-demo-videodevguide.md)
- [Use Case](guide/device-iotcamera-control-example.md)
- Cameras with a Screen)
- Cameras with a Screen
- Screen and Camera Control
- [Overview](guide/device-camera-control-overview.md)
- Development Guidelines
......@@ -502,19 +518,20 @@
- [Development Example for Platform Drivers](guide/device-driver-demo.md)
- [Development Example for Peripheral Drivers](guide/device-outerdriver-demo.md)
- Debugging
- [Test Subsystem](subsystems/subsys-testguide-test.md)
- Debugging Tools
- [bytrace Usage Guidelines](subsystems/subsys-toolchain-bytrace-guide.md)
- [hdc_std Usage Guidelines](subsystems/subsys-toolchain-hdc-guide.md)
- [bytrace](subsystems/subsys-toolchain-bytrace-guide.md)
- [hdc\_std](subsystems/subsys-toolchain-hdc-guide.md)
- [hiperf](subsystems/subsys-toolchain-hiperf.md)
- [XTS Certification](subsystems/subsys-xts-guide.md)
- Tools
- [Docker Environment](get-code/gettools-acquire.md)
- [IDE](get-code/gettools-ide.md)
- Hands-On Tutorials
- [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
- [Codelabs](https://gitee.com/openharmony/codelabs/blob/master/README.md)
- References
- [Overview of FAQs](faqs/faqs-overview.md)
- [FAQs Overview](faqs/faqs-overview.md)
- [Environment Setup](faqs/faqs-environment-setup.md)
- [Compilation and Building Subsystem](faqs/faqs-building.md)
- [Burning](faqs/faqs-burning.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册