• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Application- or Component-Level Configuration (Stage Model)
2
3
4When developing an application, you may need to configure certain tags to identify the application, such as the bundle name and application icon. This topic describes key tags that need to be configured during application development. Icons and labels are usually configured together. There is the application icon, application label, entry icon, and entry label, which correspond to the **icon** and **label** fields in the [app.json5 file](../quick-start/app-configuration-file.md) and [module.json5 file](../quick-start/module-configuration-file.md). The application icon and label are used in **Settings**. For example, they are displayed in the application list in **Settings**. The entry icon is displayed on the device's home screen after the application is installed. The entry icon maps to a [UIAbility](uiability-overview.md) component. Therefore, an application can have multiple entry icons and labels. When you touch one of them, the corresponding UIAbility page is displayed.
5
6
7  **Figure 1** Icons and labels
8
9![application-component-configuration-stage](figures/application-component-configuration-stage.png)
10
11
12- **Configuring the bundle name**
13
14  The bundle name is specified by the **bundleName** field in the [app.json5 file](../quick-start/app-configuration-file.md) in the **AppScope** directory of the project. This field uniquely identifies an application. You are advised to use the reverse domain name notion, for example, *com.example.demo*, where the first part is the domain suffix **com**, the second part is the vendor/individual name, and the third part is the application name, which can be of multiple levels.
15
16- **Configuring the application icon and label**
17
18  You must configure an icon and label for an application on the stage model.
19
20  The application icon is specified by the **icon** field in the [app.json5 file](../quick-start/app-configuration-file.md) in the **AppScope** directory of the project. The **icon** field must be set to the index of an image so that the image is displayed as the application icon.
21
22  The application label is specified by the **label** field in the [app.json5 file](../quick-start/app-configuration-file.md) in the **AppScope** module of the project. The **label** field specifies the application name displayed to users. It must be set to the index of a string resource.
23
24  ```json
25    {
26      "app": {
27        "icon": "$media:app_icon",
28        "label": "$string:app_name"
29        // ...
30      }
31    }
32  ```
33
34- **Configuring the entry icon and label**
35
36    On the stage model, you can configure an entry icon and label for each application component. The entry icon and label are displayed on the home screen.
37
38    The entry icon is configured by specifying **icon** under **abilities** in the [module.json5 file](../quick-start/module-configuration-file.md). For example, if you want to display the icon of the UIAbility component on the home screen, add **entity.system.home** to **entities** and **ohos.want.action.home** to **actions** under **skills**. If this field is configured for multiple UIAbility components of an application, multiple icons are displayed on the home screen, corresponding to their respective UIAbility component.
39
40  ```json
41  {
42    "module": {
43      // ...
44      "abilities": [
45        {
46          // The information starting with $ is the resource value.
47          "icon": "$media:icon",
48          "label": "$string:EntryAbility_label",
49          "skills": [
50            {
51              "entities": [
52                "entity.system.home"
53              ],
54              "actions": [
55                "ohos.want.action.home"
56              ]
57            }
58          ],
59        }
60      ]
61    }
62  }
63  ```
64- **Configuring application version declaration**
65
66  To declare the application version, configure the **versionCode** and **versionName** fields in the [app.json5 file](../quick-start/app-configuration-file.md) in the **AppScope** directory of the project. **versionCode** specifies the version number of the application. The value is a 32-bit non-negative integer. It is used only to determine whether a version is later than another version. A larger value indicates a later version. **versionName** provides the text description of the version number.
67
68- **Configuring device types supported by the module**
69
70  To configure the device types supported by the module, set the **deviceTypes** field in the [module.json5 file](../quick-start/module-configuration-file.md). If a certain device type is added to **deviceTypes**, the module can run on that device.
71
72- **Configuring the module permission**
73
74  The **requestPermission** field in the [module.json5 file](../quick-start/module-configuration-file.md) is used to configure the permission information required by the module to access the protected part of the system or other applications. This field declares the name of the permission to request, the reason for requesting the permission, and the scenario where the permission is used.
75