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

Developer

resources

CAR and BAR

The Component Application Resource File (CAR) file contains the specifications for resources an application uses, such as image files or binary objects. A CAR file is a special type of CIF that only contains resource specifications. A CAR file is compiled using cifc.exe to create the BREW Application Resource File (BAR) file, which is used at runtime.

CAR files

The CAR file is a replacement for the BRX file in BREW. A CAR contains ModRsc definitions for resources. A CAR should include a resource header file, which contains all the #define definitions for the IDS_XXXX used in CAR and C/C++ source code. If the CAR is managed by Resource Manager, the resource header is generated only to be used by C/C++ source code and is not included by the CAR.

Brew MP applications can be designed to execute on a variety of different devices, in a number of different languages. Resource files can be used to support the different devices and languages. 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 create a version of an application for a particular language or device, you need to create only system resource files instead of the entire application.

BAR files

The BAR file contains resources such as strings and images in binary format.

Creating resource files

The following options are available to create and manage CAR/resource header files and compile them.

  • Use Resource Manager, which provides a click-to-build UI. Brewrmc.exe is a command-line alternative to generate the resource header and compile the CAR to BAR. The resource header is not included in the CAR, it is auto-generated with the BAR.

    The Resource Manager can be used to create external resources used in applications such as strings, images, and binaries.

  • Use any text editor to manually create and manage the CAR and resource header. To compile the CAR to BAR, use cifc.exe, or the Brew MP build system, which internally invokes cifc.exe, via Visual Studio or the Eclipse IDE, and command-line make.

For more information on CIF and CAR files, see the Resource File and Markup Reference, included with the Brew MP SDK and available in http://developer.brewmp.com/resources on the Brew MP website. For more information on Resource Manager, see the Tools Reference in http://developer.brewmp.com/resources on the Brew MP website.

CAR example

In this example, the CAR file for c_basicapp defines one string resource:

ModRsc {
--
    name = "IDS_STRING_1001",
    id   = 1001,
    type = 1, --RESTYPE_ENCSTRING (see AEEResType.h)
    data =EncStringRscData(0xff, "Hello World"),
}