SDK Tools Guides

Home

Application Icons

It's easy to add application icons to your project. All you need to do is to add a file to the project with the *.icon extension, for example App.icon (you can pick any name you like), write in a few lines of XML, and add the icon images to the project. MoSync does the rest.

Here is an example of a .icon file:

<?xml version="1.0" encoding="UTF-8"?>
<icon> 
  <instance size="default" src="Icon.svg" /> 
  <instance size="64x64" src="Icon.svg" /> 
  <instance size="32x32" src="Icon.svg" /> 
</icon>

It is generally sufficient to just specify the default instance size option, the other options are not mandatory:

<?xml version="1.0" encoding="UTF-8"?>
<icon> 
  <instance size="default" src="Icon.svg" /> 
</icon>

SVG is the recommended image format and works for all platforms. An example of an open-source drawing program you can use to create SVG files is Inkscape.

Note: If you are developing your app using the MoSync SDK on Windows, you can also use the PNG image format for your icons. If you are developing your app using the MoSync SDK on OS X and you want to use the PNG format for your icons you must first install the latest version of Image Magick via MacPorts: see issue MOSYNC-2308.

To know if the application icon was added correctly during the build process, you only need to look at the last few lines of the IDE console for guidance.

Some quirks that have been observed:

  1. When adding icons for a Java device, it is important to take a look at the device profile information in the MoSync SDK. The device profile should contain the parameters MA_PROF_CONST_ICONSIZE_X and MA_PROF_CONST_ICONSIZE_Y and the size of the image file should be consistent with the icon size listed in the profile. (Alternatively, make sure that all your target devices support icon of the size you provide.)
  2. It has also been observed that on Symbian devices the application icon may not appear if the application is reinstalled. In this case, a quick restart of the phone makes the icon visible.

Please keep in mind that this feature of the MoSync SDK is experimental. Some platforms may show unexpected results. Let us know if you find issues.

MoSync SDK 3.3
Copyright © 2013 MoSync AB
www.mosync.com