• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ApplicationInfo
2
3The **ApplicationInfo** module defines the application information. A system application can obtain its own or others' application information through [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo). The input parameter [appFlags](js-apis-bundleManager.md#applicationflag) specifies the information to be contained in the returned [ApplicationInfo](js-apis-bundleManager-applicationInfo.md) object.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8
9## ApplicationInfo
10
11**System capability**: SystemCapability.BundleManager.BundleFramework.Core
12
13| Name                      | Type                                                        | Readable| Writable| Description                                                        |
14| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
15| name                       | string                                                       | Yes  | No  | Application name.                                                |
16| description                | string                                                       | Yes  | No  | Description of the application, for example, "description": $string: mainability_description".                                                |
17| descriptionId              | number                                                       | Yes  | No  | ID of the application description.                                              |
18| enabled                    | boolean                                                      | Yes  | No  | Whether the application is enabled. The default value is **true**.                          |
19| label                      | string                                                       | Yes  | No  | Application name, for example, "label": "$string: mainability_description".|
20| labelId                    | number                                                       | Yes  | No  | ID of the application label.                                              |
21| icon                       | string                                                       | Yes  | No  | Application icon, for example, "icon": "$media:icon".                                                |
22| iconId                     | number                                                       | Yes  | No  | ID of the application icon.                                              |
23| process                    | string                                                       | Yes  | No  | Process in which the application runs. If this parameter is not set, the bundle name is used.                  |
24| permissions                | Array\<string>                                               | Yes  | No  | Permissions required for accessing the application. The permissions can be obtained by passing in **GET_APPLICATION_INFO_WITH_PERMISSION** to the **appFlags** parameter of [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo).|
25| codePath                   | string                                                       | Yes  | No  | Installation directory of the application.                                            |
26| metadata<sup>(deprecated)<sup>  | Map\<string, Array\<[Metadata](js-apis-bundleManager-metadata.md)>> | Yes  | No  | Metadata of the application. The information can be obtained by passing in **GET_APPLICATION_INFO_WITH_METADATA** to the **appFlags** parameter of [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo). <br>**NOTE**<br>This field is deprecated since API version 10. You are advised to use **metadataArray** instead. |
27| metadataArray<sup>10+<sup>              | Array\<[ModuleMetadata](#modulemetadata)> | Yes  | No  | Metadata of the application. The information can be obtained by passing in **GET_APPLICATION_INFO_WITH_METADATA** to the **appFlags** parameter of [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo).|
28| removable                  | boolean                                                      | Yes  | No  | Whether the application is removable.                                        |
29| accessTokenId             | number                                                       | Yes  | No  | Access token ID of the application.                                     |
30| uid                       | number                                                       | Yes  | No  | UID of the application.                                               |
31| iconResource              | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details.                    |
32| labelResource             | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details.                        |
33| descriptionResource       | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details.|
34| appDistributionType       | string                                                       | Yes  | No  | Distribution type of the application signing certificate. The options are **app_gallery**, **enterprise**, **os_integration**, and **crowdtesting**.   |
35| appProvisionType          | string                                                       | Yes  | No  | Type of the application signing certificate file. The options are **debug** and **release**.          |
36| systemApp          | boolean                                                       | Yes  | No  | Whether the application is a system application.          |
37| bundleType                |[BundleType](js-apis-bundleManager.md#bundletype)             | Yes  | No  | Bundle type, which can be **APP** (common application) or **ATOMIC_SERVICE** (atomic service).                               |
38| debug<sup>10+</sup>       | boolean                                | Yes  | No  | Whether the application is in debugging mode. The default value is **false**.       |
39
40## ModuleMetadata
41
42Describes the metadata of a module.
43
44 **System capability**: SystemCapability.BundleManager.BundleFramework.Core
45
46| Name     | Type          | Readable| Writable| Description                       |
47| --------- | -------------- | ---- | ---- | --------------------------- |
48| moduleName<sup>10+<sup>| string         | Yes  | No  | Module name.  |
49| metadata<sup>10+<sup>  | Array\<[Metadata](js-apis-bundleManager-metadata.md)>      | Yes  | No  | Metadata list of the module.|
50