Creating and adding an icon to an S60 3rd Edition application
(New page: __NOTOC__ __NOEDITSECTION__ {|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0" |- |'''ID''' || |'''Creation date''' || 30/01/2008 |- |'''Platfor...) |
|||
| Line 10: | Line 10: | ||
|'''Tested on devices''' || Nokia E90 | |'''Tested on devices''' || Nokia E90 | ||
|- | |- | ||
| − | |'''Category''' || | + | |'''Category''' || Symbian C++ |
| − | |'''Subcategory''' || | + | |'''Subcategory''' || Graphics, SVG |
|- | |- | ||
|'''APIs''' || None | |'''APIs''' || None | ||
| Line 30: | Line 30: | ||
==Steps== | ==Steps== | ||
| − | 1. Create an SVG icon on a 48x48 canvas. You can test the icon by building HelloWorldBasic application (in S60Ex directory under the SDK) with your own icon. | + | 1. Create an SVG icon on a 48x48 canvas. You can test the icon by building HelloWorldBasic application (in <tt>S60Ex</tt> directory under the SDK) with your own icon. |
| − | 2. Save the icon in gfx folder of your application, according to the standard Symbian directory structure guidelines. | + | 2. Save the icon in <tt>gfx</tt> folder of your application, according to the standard Symbian directory structure guidelines. |
| − | 3. Create group\icons_scalable_dc.mk to automatically convert the icon to Symbian mif file whenever the application is compiled: | + | 3. Create <tt>group\icons_scalable_dc.mk</tt> to automatically convert the icon to Symbian mif file whenever the application is compiled: |
<code> | <code> | ||
| Line 77: | Line 77: | ||
'''Note!''' When editing the makefile, make sure that you use tabulators instead of spaces. (If you don't, the error you would get is: "ICONS_SCALABLE_DC.MK:25: *** missing separator. Stop.") | '''Note!''' When editing the makefile, make sure that you use tabulators instead of spaces. (If you don't, the error you would get is: "ICONS_SCALABLE_DC.MK:25: *** missing separator. Stop.") | ||
| − | 4. Edit group\bld.inf to contain the makefile created above: | + | 4. Edit <tt>group\bld.inf</tt> to contain the makefile created above: |
<code> | <code> | ||
| Line 90: | Line 90: | ||
'''Note!''' Remember to run "bldmake bldfiles" after editing the bld.inf file. | '''Note!''' Remember to run "bldmake bldfiles" after editing the bld.inf file. | ||
| − | 5. Edit the resource file of your application (data\[app].rss) to contain the icon: | + | 5. Edit the resource file of your application (<tt>data\[app].rss</tt>) to contain the icon: |
<code> | <code> | ||
| Line 116: | Line 116: | ||
</code> | </code> | ||
| − | '''Note!''' The localisable application information presented above is often located in | + | '''Note!''' The localisable application information presented above is often located in <tt>data\[app]_loc.rss</tt> file. Experience has shown that icon may not always show on the device if it is declared in the loc.rss file. If you decide to use .rss instead of loc.rss, make sure that you remove all references to loc.rss (especially <tt>localisable_resource_file</tt> declaration in <tt>APP_REGISTRATION_INFO</tt> resource in <tt>data\[app]_reg.rss</tt> and <tt>RESOURCE</tt> section in <tt>group\[app].mmp</tt>). |
| − | 6. Edit the pkg file: | + | 6. Edit the pkg file (<tt>sis\[app].pkg</tt>): |
<code> | <code> | ||
| Line 137: | Line 137: | ||
* [http://wiki.forum.nokia.com/index.php/How_to_create_application_icon%28SVG%29_in_S60_3rd_edition How to create application icon (SVG) in S60 3rd edition] | * [http://wiki.forum.nokia.com/index.php/How_to_create_application_icon%28SVG%29_in_S60_3rd_edition How to create application icon (SVG) in S60 3rd edition] | ||
| + | |||
| + | [[Category:Symbian C++]][[Category:Graphics]][[Category:SVG]] | ||
Revision as of 17:14, 4 February 2008
| ID | Creation date | 30/01/2008 | |
| Platform | S60 3rd Ed. MR | Tested on devices | Nokia E90 |
| Category | Symbian C++ | Subcategory | Graphics, SVG |
| APIs | None | Classes | None |
| Methods | None |
Overview
This code example describes how to create and add an icon to an S60 3rd Ed. application.
In order to create SVG icons, you must have a suitable program. One such program is Inkscape.
This snippet can be self-signed.
Steps
1. Create an SVG icon on a 48x48 canvas. You can test the icon by building HelloWorldBasic application (in S60Ex directory under the SDK) with your own icon.
2. Save the icon in gfx folder of your application, according to the standard Symbian directory structure guidelines.
3. Create group\icons_scalable_dc.mk to automatically convert the icon to Symbian mif file whenever the application is compiled:
ifeq (WINS,$(findstring WINS, $(PLATFORM)))
ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z
else
ZDIR=$(EPOCROOT)epoc32\data\z
endif
TARGETDIR=$(ZDIR)\resource\apps
ICONTARGETFILENAME=$(TARGETDIR)\Application_aif.mif
ICONDIR=..\gfx
do_nothing :
@rem do_nothing
MAKMAKE : do_nothing
BLD : do_nothing
CLEAN : do_nothing
LIB : do_nothing
CLEANLIB : do_nothing
RESOURCE :
mifconv $(ICONTARGETFILENAME) \
/c32 $(ICONDIR)\icon.svg
FREEZE : do_nothing
SAVESPACE : do_nothing
RELEASABLES :
@echo $(ICONTARGETFILENAME)
FINAL : do_nothing
Note! When editing the makefile, make sure that you use tabulators instead of spaces. (If you don't, the error you would get is: "ICONS_SCALABLE_DC.MK:25: *** missing separator. Stop.")
4. Edit group\bld.inf to contain the makefile created above:
#ifdef EKA2 //3rd edition
gnumakefile icons_scalable_dc.mk
Application_S60_3rd_ed.mmp
#else //1st and 2nd edition
Application_S60_2nd_ed.mmp
#endif
Note! Remember to run "bldmake bldfiles" after editing the bld.inf file.
5. Edit the resource file of your application (data\[app].rss) to contain the icon:
#include <appinfo.rh>
#include "Application.rls"
// ----------------------------------------------------------------------------
//
// r_application_localisable_app_info
//
// ----------------------------------------------------------------------------
RESOURCE LOCALISABLE_APP_INFO r_application_localisable_app_info
{
short_caption = STRING_r_app_caption_string;
caption_and_icon =
CAPTION_AND_ICON_INFO
{
caption = STRING_r_app_caption_string;
number_of_icons = 1;
icon_file = "\\resource\\apps\\Application_aif.mif";
};
}
Note! The localisable application information presented above is often located in data\[app]_loc.rss file. Experience has shown that icon may not always show on the device if it is declared in the loc.rss file. If you decide to use .rss instead of loc.rss, make sure that you remove all references to loc.rss (especially localisable_resource_file declaration in APP_REGISTRATION_INFO resource in data\[app]_reg.rss and RESOURCE section in group\[app].mmp).
6. Edit the pkg file (sis\[app].pkg):
;Language - standard language definitions
&EN,FI
{
"\Symbian\9.2\S60_3rd_FP1\Epoc32\Data\z\resource\apps\Application.rsc"
"\Symbian\9.2\S60_3rd_FP1\Epoc32\Data\z\resource\apps\Application.R09"
} -"!:\resource\apps\Application.rsc"
;Icon resources
"\Symbian\9.2\S60_3rd_FP1\Epoc32\Data\z\resource\apps\Application_aif.mif"
-"!:\resource\apps\Application_aif.mif"

