harmony 鸿蒙Bundle Management Development

  • 2022-12-13
  • 浏览 (354)

Bundle Management Development

How do I obtain the version code and version name of an application?

Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9

Use bundle.getBundleInfo() to obtain the bundle information, which contains the version code and version name.

Reference: Bundle

How do I obtain the bundle name of an application?

Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9

Obtain the bundle name through context.abilityInfo.bundleName.

Reference: AbilityContext and AbilityInfo

How do I obtain an application icon?

Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9

Use bundle.getAbilityIcon to obtain the application icon. To use this API, you must configure the permission ohos.permission.GET_BUNDLE_INFO.

Reference: Bundle

How do I determine whether an application is a system application?

Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9

Use bundle.getApplicationInfo to obtain the application information, and then check the value of systemApp in the information. The application is a system application if the value is true.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙FAQs

harmony 鸿蒙Ability Framework Development

harmony 鸿蒙Network and Connection Development

harmony 鸿蒙Data Management Development

harmony 鸿蒙Development Board Usage

harmony 鸿蒙Device Management Development

harmony 鸿蒙DFX Development

harmony 鸿蒙Common Event and Notification Development

harmony 鸿蒙File Management Development

harmony 鸿蒙Graphics and Image Development

0  赞