Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



About application resources


Overview

In EPOC, much of the information that defines the appearance, behaviour and functionality of an application is stored in a resource file — external to the main body of the program. This is unlike some other programming environments, in which a single executable contains all the code and information used by the application.

The two types of resource file used in EPOC are application information files (aif files) and resource files. The difference between these file types is that application information files define application behaviour within the system context, while ordinary resource files define the appearance and behaviour within an application.

The GUI tool AIF Builder provides a simple way to create aif files: for details see Introduction to AIF Builder. It is possible though to write the required source files by hand, and compile them using command-line tools, and this section contains the information to do so.

This section describes some of the advantages gained by separating an application’s resources from its executable code, and provides a listing of the file types used in the resource compilation process.

[Top]


Customise the user interface

For C++ programs, the Uikon programming framework requires that some aspects of an application’s layout and behaviour, such as the menu, are defined in a resource file.

This can have powerful implications for application development. Small changes to the resource file can change an application significantly.

[Top]


User resources

Resource files are not restricted to declaring information used by the Uikon framework. A resource file might also, for example, define resources for dialog text, error messages, and program initialisation.

Again, the advantages of declaring user information in a resource file are that information is loaded only when needed, that resource files can be compressed, and that they can be localised without recompiling the main program.

[Top]


System resources

The application information file is a special type of resource file, which defines application properties within the system context. These properties include:

In addition, some applications support MIME types, and this property is also defined in the aif file.

The structure of the application information resource file is similar to that of the ordinary resource file. However, since the information to be contained is pre-defined, formatting of aif resource files is very simple.

[Top]


File types reference

The resource compilation process uses a number of file types:

rss

resource source file, for input to Rcomp or Aiftool.

h

header file, for inclusion in C++ file

rh

resource header, for inclusion in resource file

hrh

common C++ or resource header, for inclusion in either type of source file

rsg

generated resource header file, output from Rcomp

rsc

generated resource file, output from Rcomp

aif

application information file, as defined by the application architecture, output by Aiftool

[Top]


Delivering resource files

Resource files are usually delivered with other application files as part of an installation file — see Application Installation Guide.

The installation file should be configured so that the aif file is copied to the same directory as its associated application file. If the application is to appear on the shell, this should be the directory \System\Apps\AppName\ folder in any drive.