• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# UIAbility Overview
2
3
4## Overview
5
6UIAbility is a type of application component that provides the UI for user interactions.
7
8The following design philosophy is behind UIAbility:
9
101. Native support for [cross-device migration](hop-cross-device-migration.md) and [multi-device collaboration](hop-multi-device-collaboration.md) at the application component level
11
122. Support for multiple device types and window modes
13
14> **NOTE**
15>
16> For details, see [Interpretation of the Application Model](application-model-description.md).
17
18UIAbility is the basic unit of scheduling in OpenHarmony and provides a window for applications to draw the UI. An application can contain one or more UIAbility components. For example, for a payment application, you can use separate UIAbility components to carry the entry and payment functionalities.
19
20Each UIAbility component instance is displayed as a mission in the system application Recents.
21
22You can develop a single UIAbility or multiple UIAbilities for your application based on service requirements.
23
24- If you want your application to be displayed as one mission in Recents, use one UIAbility and multiple pages.
25
26- If you want your application to be displayed as multiple missions in Recents or multiple windows to be opened simultaneously, use multiple UIAbilities.
27
28## Declaration Configuration
29
30To enable an application to properly use a UIAbility component, declare the UIAbility name, entry, and label under [abilities](../quick-start/module-configuration-file.md#abilities) in the [module.json5 file](../quick-start/module-configuration-file.md).
31
32
33```json
34{
35  "module": {
36    ...
37    "abilities": [
38      {
39        "name": "EntryAbility", // Name of the UIAbility component.
40        "srcEntry": "./ets/entryability/EntryAbility.ts", // Code path of the UIAbility component.
41        "description": "$string:EntryAbility_desc", // Description of the UIAbility component.
42        "icon": "$media:icon", // Icon of the UIAbility component.
43        "label": "$string:EntryAbility_label", // Label of the UIAbility component.
44        "startWindowIcon": "$media:icon", // Index of the icon resource file.
45        "startWindowBackground": "$color:start_window_background", // Index of the background color resource file.
46        ...
47      }
48    ]
49  }
50}
51```
52