Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
Executing Console Applications on Devices
Having an icon for a console application allows you to start the application on the mobile phone. Only a few steps are necessary to achieve this.
The name of the example application is “ConsoleMenu”, its UID3 is 0xE79A8F85. Whenever this appears in a source code segment, adapt this to your own application name and UID3.
1. Create a new \data\-folder in your project and add a file ConsoleMenu_reg.rss to this directory.
2. Paste the following text into ConsoleMenu_reg.rss:
UID3 0xE79A8F85 // Replace this with the UID3 of your application
app_file="ConsoleMenu"; // The filename of your executable, without .exe
3. Add the new resource file to the .mmp file, so that it’s included in the compilation-process. Do not change the "10003a3f" ID, this folder is used for all applications.
START RESOURCE ConsoleMenu_reg.rss
4. Add the new resource file to the .pkg-file, in order to include it in the .sis that you will install on the phone:
Defining your own application icon
Right now, your application will have the default icon. If you want it to have your own icon, follow these additional steps.
1. Create an icon file in any vector graphics application that supports SVG-Tiny (e.g. Adobe Illustrator).
2. Create a \gfx\-folder in your project and save the icon file into this directory (e.g. ConsoleMenu.svg)
3. Add a file called Icons_scalable_dc.mk to the group-directory. Carbide.c++ should automatically suggest adding this new file to bld.inf. Allow this. If you do not use Carbide.c++, add the make file to bld.inf manually:
gnumakefile Icons_scalable_dc.mk // New line
4. Paste the following code into the Icons_scalable_dc.mk-file:
ifeq (WINS,$(findstring WINS, $(PLATFORM)))
# Adapt the filename of the .mif-file that will be created:
MAKMAKE : do_nothing
BLD : do_nothing
CLEAN : do_nothing
LIB : do_nothing
CLEANLIB : do_nothing
RESOURCE : $(ICONTARGETFILENAME)
# Adapt the filename of the icon in the following lines!
$(ICONTARGETFILENAME) : $(ICONDIR)\ConsoleMenu.svg
mifconv $(ICONTARGETFILENAME) \
FREEZE : do_nothing
SAVESPACE : do_nothing
FINAL : do_nothing
5. Create a new file called ConsoleMenu.rss in the /data/-folder and fill it with the following definition. Adapt the name of the short_caption and the caption to your needs – this will be the visible name of your application.
RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
short_caption = "ConsoleMenu"; // Short name of your application
caption = "ConsoleMenu"; // Normal name of your application
number_of_icons = 1;
icon_file = "\\resource\\apps\\ConsoleMenu.mif"; //.mif created by make file
6. Add the new resource file to the .mmp-file, in order to include it in the compilation process:
START RESOURCE ConsoleMenu.rss
7. The ConsoleMenu_reg.rss-file has to be extended by one line defining the location of the localisable resource file:
localisable_resource_file = "\\resource\\apps\\ConsoleMenu"; // New line!
8. Of course, the new files also have to be added to the .pkg-file to include them into the installation package (.sis):
9. Clean the project and rebuild it.
Usually, console applications will be rather small and for testing purposes only. If yours is larger and needs to be localized, you should not define the short_caption and the caption directly in the .rss-file, but instead externalize it to localizable files. For explanations on how to do this, take a look at the following pages in the Wiki: How to create application icon(SVG) in S60 3rd edition, How to define application icon.