×
Namespaces

Variants
Actions
(Difference between revisions)

Creating and adding an icon to an S60 3rd Edition application

From Nokia Developer Wiki
Jump to: navigation, search
extkbeditor1 (Talk | contribs)
m
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix links)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{Archived|timestamp=20120715145144|user=[[User:Lpvalente|Lpvalente]]}}
__NOEDITSECTION__
+
[[Category:Graphics]][[Category:Symbian C++]][[Category:SVG]][[Category:Code Snippet]][[Category:Code Snippet]][[Category:S60 3rd Edition (initial release)]][[Category:S60 3rd Edition FP1]][[Category:S60 3rd Edition FP2]]
{{KBCS}}
+
 
{{CodeSnippet
+
 
 +
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= Nokia E90 Communicator
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|platform= S60 3rd Edition<br/>S60 3rd Edition, FP1<br/>S60 3rd Edition, FP2
 +
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20080206
 +
|author= [[User:Tapiolaitinen]]
 +
<!-- The following are not in current metadata -->
 +
|subcategory= Graphics, SVG
 
|id= CS000808
 
|id= CS000808
|platform=S60 3rd Edition<br/>S60 3rd Edition, FP1<br/>S60 3rd Edition, FP2
 
|devices=Nokia E90 Communicator
 
|category=Symbian C++
 
|subcategory=Graphics, SVG
 
|creationdate=February 6, 2008
 
|keywords=
 
 
}}
 
}}
  
 
==Overview==
 
==Overview==
  
This code example describes how to create and add an icon to an S60 3rd Edition application.
+
{{Abstract|This code example describes how to create and add an icon to an S60 3rd Edition application.}}
  
In order to create SVG icons, you must have a suitable graphics editor, for example, [http://www.inkscape.org/ Inkscape].
+
In order to create SVG icons, you must have a suitable graphics editor, for example, [http://inkscape.org/ Inkscape].
  
 
This snippet can be self-signed.
 
This snippet can be self-signed.
Line 22: Line 39:
 
==Steps==
 
==Steps==
  
1. Create an SVG icon on a 48-x-48-pixel canvas. You can test the icon by building the HelloWorldBasic application (in <tt>S60Ex</tt> directory under the SDK) with your own icon.
+
1. Create an SVG icon on a 48-x-48-pixel canvas. You can test the icon by building the HelloWorldBasic application (in {{Icode|S60Ex}} directory under the SDK) with your own icon.
  
2. Save the icon in the <tt>gfx</tt> folder of your application according to the standard Symbian directory structure guidelines.
+
2. Save the icon in the {{Icode|gfx}} folder of your application according to the standard Symbian directory structure guidelines.
  
3. Create <tt>group\icons_scalable_dc.mk</tt> to automatically convert the icon to a Symbian .mif file whenever the application is compiled:
+
3. Create {{Icode|group\icons_scalable_dc.mk}} to automatically convert the icon to a Symbian .mif file whenever the application is compiled:
  
 
<code>
 
<code>
Line 69: Line 86:
 
'''Note:''' When editing the makefile, make sure that you use tabulators instead of spaces. (Otherwise you get the error: "ICONS_SCALABLE_DC.MK:25: *** missing separator.  Stop.")
 
'''Note:''' When editing the makefile, make sure that you use tabulators instead of spaces. (Otherwise you get the error: "ICONS_SCALABLE_DC.MK:25: *** missing separator.  Stop.")
  
4. Edit <tt>group\bld.inf</tt> to contain the makefile created above:
+
4. Edit {{Icode|group\bld.inf}} to contain the makefile created above:
  
 
<code>
 
<code>
Line 82: Line 99:
 
'''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 (<tt>data\[app].rss</tt>) to contain the icon:
+
5. Edit the resource file of your application ({{Icode|data\[app].rss}}) to contain the icon:
  
 
<code>
 
<code>
Line 108: Line 125:
 
</code>
 
</code>
  
'''Note:''' The localizable application information presented above is often located in <tt>data\[app]_loc.rss</tt> file. Experience has shown that an 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 the <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>).
+
'''Note:''' The localizable application information presented above is often located in {{Icode|data\[app]_loc.rss}} file. Experience has shown that an 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 the {{Icode|localisable_resource_file}} declaration in {{Icode|APP_REGISTRATION_INFO}} resource in {{Icode|data\[app]_reg.rss}} and {{Icode|RESOURCE}} section in {{Icode|group\[app].mmp}}).
  
'''Note:''' Ensure that <tt>App_reg.rss</tt> file contains a reference to the localizable application information:
+
'''Note:''' Ensure that {{Icode|App_reg.rss}} file contains a reference to the localizable application information:
 
<code>
 
<code>
 
localisable_resource_id = R_APPLICATION_LOCALISABLE_APP_INFO;
 
localisable_resource_id = R_APPLICATION_LOCALISABLE_APP_INFO;
 
</code>
 
</code>
  
6. Edit the pkg file (<tt>sis\[app].pkg</tt>):
+
6. Edit the pkg file ({{Icode|sis\[app].pkg}}):
  
 
<code>
 
<code>
Line 133: Line 150:
 
==See also ==
 
==See also ==
  
* [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]
+
* [[How to create a Symbian application icon (SVG)]]
 
+
[[Category:Symbian C++]][[Category:Graphics]][[Category:SVG]][[Category:Code Examples]]
+

Latest revision as of 07:49, 17 July 2012

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.


Article Metadata
Tested with
Devices(s): Nokia E90 Communicator
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Article
Created: tapiolaitinen (06 Feb 2008)
Last edited: hamishwillee (17 Jul 2012)

[edit] Overview

This code example describes how to create and add an icon to an S60 3rd Edition application.

In order to create SVG icons, you must have a suitable graphics editor, for example, Inkscape.

This snippet can be self-signed.

[edit] Steps

1. Create an SVG icon on a 48-x-48-pixel canvas. You can test the icon by building the HelloWorldBasic application (in S60Ex directory under the SDK) with your own icon.

2. Save the icon in the 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 a 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. (Otherwise you get the error: "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 localizable application information presented above is often located in data\[app]_loc.rss file. Experience has shown that an 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 the localisable_resource_file declaration in APP_REGISTRATION_INFO resource in data\[app]_reg.rss and RESOURCE section in group\[app].mmp).

Note: Ensure that App_reg.rss file contains a reference to the localizable application information:

localisable_resource_id = R_APPLICATION_LOCALISABLE_APP_INFO;

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"

[edit] See also

This page was last modified on 17 July 2012, at 07:49.
133 page views in the last 30 days.
×