harmony 鸿蒙Bundle Management Development
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 鸿蒙Ability Framework Development
harmony 鸿蒙Network and Connection Development
harmony 鸿蒙Data Management Development
harmony 鸿蒙Development Board Usage
harmony 鸿蒙Device Management Development
harmony 鸿蒙Common Event and Notification Development
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦