The bundle module provides APIs for querying application information.
System capability: SystemCapability.BundleManager.BundleFramework.Core
Since: 9
| Name | Description |
|---|---|
| native_interface_bundle.h | Provides application information structs and functions. File to include: <bundle/native_interface_bundle.h> Library: libbundle_ndk.z.so |
| Name | Description |
|---|---|
| OH_NativeBundle_GetCurrentApplicationInfo | Obtains the current application information. |
| OH_NativeBundle_GetAppId | Obtains the appId information about the current application. |
| OH_NativeBundle_GetAppIdentifier | Obtains the appIdentifier information about the current application. |
OH_NativeBundle_ApplicationInfo OH_NativeBundle_GetCurrentApplicationInfo()
Description
Obtains the current application information.
Since: 9
Returns
Returns the OH_NativeBundle_ApplicationInfo struct.
char* OH_NativeBundle_GetAppId()
Description
Obtains the appId information about the current application.
Since: 11
Returns
Returns a string that describes the appId information of the application.
char* OH_NativeBundle_GetAppIdentifier()
Description
Obtains the appIdentifier information about the current application. appIdentifier is the unique ID of the application. It is a random string allocated by AppGallery Connect during the creation of the application. This ID does not change along the application lifecycle, including version updates, certificate changes, public and private key changes, and application transfers.
Since: 11
Returns
Returns a string that describes the appIdentifier information of the application.