With the resourcemanager module, developers can obtain application resources or system resources on the native layer by resource ID or resource name, adapting resources to multiple languages, devices, and screen densities. Specifically, it includes the following:
- Obtaining basic resources: obtains basic resources such as color values (in ARGB format), integers, floating-point numbers, and Boolean values.
- Obtaining string resources: obtains ordinary strings, formatted strings (supporting the %d, %s, and %f placeholders), string arrays, and plural strings.
- Obtaining media resources: obtains the raw binary data or Base64 encoding of media resources.
- Resource overlay: dynamically loads and removes overlay resources at runtime to implement theme switching or resource overriding.
This module depends on the rawfile module. You must first obtain a NativeResourceManager object through the rawfile module.
Since: 12
| Name | Description |
|---|---|
| resmgr_common.h | Provides the enum types and struct definitions required by the resourcemanager module. This header file defines enums such as error codes, screen orientation, color mode, device type, and screen density, as well as the device configuration struct, providing data type support for the resource obtaining functions in ohresmgr.h. |
| ohresmgr.h | Provides the capability of obtaining resources on the native layer of resource management. |