Resources | Resources |



Resource File and Markup Reference

Base version:

Brew ® MP 1.0

Document number:

HT80-VT500-79 Rev. C

Date published:

March 2, 2012

This document discusses the CIF/CAR file syntax files, describes each CIF/CAR primitives that can be added to a CIF or CAR file, and describes BREW 3.x-style Brew MP registry entries and how they are treated by Brew Mobile Platform (Brew MP).

Source files (CIF and CAR)

Component Information Files (CIF) describe a module and the resources that the module needs during execution. CIF files are compiled into MIF files, which are binary files that are loaded when the module that they describe is loaded and executed.

Component Application Resource (CAR) files are Lua files used to specify resources a Brew MP module may require during execution, such as image files and binary objects. The CAR file is compiled into a binary BAR file, using the CIFC compiler with the -bar option. CAR files contain names and locations of the image files, string files (and localized string files), and binary object files.

The CIFC compiler is then used to compile CIF files into MIF files, and CAR files into BAR files, as shown in the image below.

CIF files and CAR files have the same syntax. Both describe resources available to a module. The only difference between the two file types is that compiled CIF files (MIF files) contain metadata about the module, and compiled CAR files (BAR files) do not.

Compiled resource files (MIF and BAR)

Every Brew MP module requires a Module Information File (MIF), which provides metadata about the module, and describes resources it needs to execute in the Brew MP application execution environment. The MIF includes the application ClassID, which comes from the BID file.

BAR files are binary files that contain resources that your module may require, such as image files and binary objects. BAR files are loaded when the module that uses them is loaded and executed. BAR files also contain strings that an applet uses in displays, which can be changed for different devices without recompiling the applet into a module, and localized and placed in language-specific folders where they are available to users based on language preference.

Each Brew MP resource, whether defined in the MIF file or the BAR file, is uniquely defined by its key, which is a combination of its type and ID. In relational database terminology, Brew MP resources have composite primary keys. Each ID within a single type must be unique; however, two resources that belong to different types can have identical IDs.

The division between MIF and BAR files is purely functional and not structural since the internal binary format is the same. Thus, MIF files and BAR files can be considered specific application resources.

For more information about localizing Brew MP resource files, refer to the Localizing a Brew MP Application Reference, which is available in the Library of the Brew MP Developer Network website. For more information about using the CIFC compiler to compile CAR files into BAR files (and CIF files into MIF files), check the Tools Reference on the Brew MP Developer website.

Note: In this release of Brew MP, BRX files are deprecated, and BRH files now have a .h file extension. Use CAR files to define resources instead of BRX files, and use the CIFC compiler with the -bar option to compile the CAR files into BAR files.