Categories: S60 | Symbian C++ | UI | How To | Code Examples
This page was last modified 16:32, 23 June 2008.
How to define application icon
From Forum Nokia Wiki
With S60 1st and 2nd Edition
With S60 1st and 2nd Edition you could define an application icon using AIF file. The AIF file could be generated by using AIF builder or by using command line tools.
For command line tools you need to define AIF resource file, which for example could look like this (you could copy paste this to a file called MyApp.rss, for example):
#include <aiftool.rh>
RESOURCE AIF_DATA
{
app_uid=0x12345678; // change to your own application UID
caption_list=
{
CAPTION { code=ELangEnglish; caption="My app"; }
};
num_icons=2;
embeddability= KAppNotEmbeddable;
hidden=KAppNotHidden;
newfile= KAppDoesNotSupportNewFile;
}
The file should have same name as your application file and rss ending, thus it is exactly same name as your application resource file, and for this reason it is advisable to make a separate folder for aif files.
Secondly you need icon bitmap files, you could use bmp images with 44x44 and 42x29 pixels in size, one with colors and one monochrome mask image. Then use bmconv to make a MBM (multibitmap file) from the icon bitmaps, for example by typing the following in command shell:
bmconv MyApp.mbm /c12s.bmp s_m.bmp /c12b.bmp b_m.bmp
where the s-images are the 42x29 in size and b-images are 44x44 in size.
After making the mbm file you can use aiftool to make the aif file by typing the following command:
aiftool MyApp MyApp.mbm
With S60 3rd Edition
In S60 3rd Edition icons are defined in the registration file. A registration file looks something like this:
UID2 KUidAppRegistrationResourceFile
UID3 0x12345678 // change to your own UID
RESOURCE APP_REGISTRATION_INFO
{
app_file="MyApp";
localisable_resource_file = "\\resource\\apps\\MyApp";
localisable_resource_id =R_LOCALISABLE_APP_INFO;
embeddability=KAppNotEmbeddable;
newfile=KAppDoesNotSupportNewFile;
group_name="My own folder";
}
The important parts inside the registration file are:
1. UID3, which needs to be your own application UID
2. app_file, which needs to be your application executables name without extension
3. localisable_resource_file, which needs to be your application resource files name with path (no drive and no extension)
4. localisable_resource_id, which needs to have the resource definition name used in your main resource for the application information.
The application information is then defined in your application’s main resource file, for example like this:
RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
{
short_caption = "My app name";
caption_and_icon =
{
CAPTION_AND_ICON_INFO
{
caption = " My application name ";
number_of_icons = 1;
icon_file = "\\Resource\\Apps\\MyApp_aif.mif";
}
};
}
The important parts inside the application information are:
1. Application viewable names (short_caption & caption), which can be localized for different languages
2. number_of_icons, with SVG this is 1, with bitmaps can be more, each bitmap icon also needs to have mask included.
3. icon_file, which is the name with path for the icon file (note that it also defined the extension, but doesn’t need to define the drive)
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Series60 Fp3 application icon size | mahmfa | Symbian User Interface | 3 | 2005-11-21 13:28 |
| application icon | nicholasgaye | Symbian User Interface | 4 | 2005-04-15 12:46 |
| How to know what is the appropriate Icon size for a device | symwarrior | General Symbian C++ | 0 | 2006-08-25 07:08 |
| SharedData API | patrickfrei | General Symbian C++ | 4 | 2008-02-10 20:15 |
| Icon problem! | MAD4NOKIA | Symbian User Interface | 1 | 2007-08-23 09:45 |
