@@ -129,14 +129,13 @@ 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**, **phone**, **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**, **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.
Table 5 Internal structure of the deviceConfig tag
| 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 phones, tablets, smart TVs, head units, and wearable devices. The valuecan 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 phones, tablets, smart TVs, head units, and wearable devices.| Boolean | Yes (initial value: **true**) |
| 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 default, tablets, smart TVs, head units, and wearable devices. The valuecan 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 default, tablets, smart TVs, head units, and wearable devices. | 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 default, tablets, smart TVs, head units, and wearable devices. | 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**)|
| 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) |
...
...
@@ -219,18 +218,18 @@ Table 11 Internal structure of the module tag
| 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 phones, tablets, smart TVs, head units, and wearable devices.| String | Yes (initial value: left empty) |
| 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 default, tablets, smart TVs, head units, and wearable devices. | 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 default, tablets, smart TVs, head units, and wearable devices. | 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 default, tablets, smart TVs, head units, and wearable devices. | 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 **phone**, **tablet**, **tv**, **car**, **wearable**, and **liteWearable**.| String array| No |
| distro | Distribution description of the current HAP file. This attribute applies only to phones, tablets, smart TVs, head units, and wearable devices. 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**, **wearable**, and **liteWearable**. | String array| No |
| distro | Distribution description of the current HAP file. This attribute applies only to default, tablets, smart TVs, head units, and wearable devices. 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 phones, tablets, smart TVs, head units, and wearable devices.| String | Yes (initial value: **auto**) |
| 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 default, tablets, smart TVs, head units, and wearable devices. | 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 HUAWEI 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.|
| 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) |
...
...
@@ -348,12 +347,12 @@ Table 17 Internal structure of the abilities attribute
| 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 phones, tablets, smart TVs, head units, and wearable devices.<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 default, tablets, smart TVs, head units, and wearable devices.<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 phones, tablets, smart TVs, head units, and wearable devices.| String | Yes (initial value: **standard**) |
| 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 default, tablets, smart TVs, head units, and wearable devices. | String | Yes (initial value: **standard**) |
| 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) |
...
...
@@ -363,13 +362,13 @@ Table 17 Internal structure of the abilities attribute
| 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 default, tablets, smart TVs, head units, and wearable devices. | 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 default, tablets, smart TVs, head units, and wearable devices. | 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 phones, tablets, smart TVs, head units, and wearable devices.| 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 default, tablets, smart TVs, head units, and wearable devices. | 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 default, tablets, smart TVs, head units, and wearable devices. | 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 default, tablets, smart TVs, head units, and wearable devices. | 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 default, tablets, smart TVs, head units, and wearable devices. | 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**. |
...
...
@@ -506,7 +505,7 @@ Table 22 Internal structure of the js attribute
| 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 phones, tablets, smart TVs, head units, and wearable devices. For details, see Table 23.| Object | Yes |
| window | Window-related configurations. This attribute applies only to default, tablets, smart TVs, head units, and wearable devices. 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) |