Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Brew MP resource files

The Resource Manager is used to create a resource file containing character strings, objects, and binaries that are loaded upon applet execution. IDs are assigned to these resources and Resource Manager creates a header file containing these IDs. This file is included in the applet source C file, which is compiled and linked to produce the applet's dynamic-link library (DLL).

The Resource Manager saves resource information in a CAR file. When you modify the resource file, the Resource Manager loads its contents from the CAR file. Changes to the CAR file are not propagated to the BAR and .h files until you rebuild the file.

As an application runs, it uses the resource-loading functions in the IShell interface to load the resources it needs from the application BAR (see the C/C++ API Reference for detailed descriptions of IShell's LoadRes and CreateDialog functions). Each call to one of these functions includes the ID of the specified resource, which is defined in the Brew MP resource header (.h) file.

Resource files are used when an application runs on the device. The ARM compiler and linker are used instead of the Windows counterparts. Instead of a Windows DLL, the output is a MOD file (for dynamic applets) or a LIB file (for statically linked applets). For dynamic applications, each supported device/language combination contains a separate download bundle for the MOD executable and a BAR file tailored to that device and language.

Running applications in different languages

The Resource Manager lets you create resource files that support the different devices and languages. To create a version of an application for a particular language or device, you need to create only language or device specific system resource files. There is no need to modify the entire application. By decoupling resources from your code and loading them at runtime, you can avoid cluttering your source code with a separate compilation flag for each supported language and device.

To simulate an applet for different devices and languages, you can create multiple versions of the app.bar file.