Close

Application icon support for all platforms

16 replies [Last post]
iDennis's picture
iDennis
User offline. Last seen 44 weeks 1 day ago. Offline
Joined: 08/28/2009
Posts: 16

It would be really nice to build-in application icon support for all platform in MoSync.

Regards
Dennis

Hartley's picture
Hartley
User offline. Last seen 18 weeks 52 min ago. Offline
Mobile Wizard
Joined: 09/25/2007
Posts: 92

Its work in progress, watch this space.

/Tony

anol's picture
anol
User offline. Last seen 17 hours 59 min ago. Offline
Mobile Wizard
Joined: 12/11/2009
Posts: 93

I am watching this space Smile

What is the status on application icons?

Hartley's picture
Hartley
User offline. Last seen 18 weeks 52 min ago. Offline
Mobile Wizard
Joined: 09/25/2007
Posts: 92

Good news and thank you for watching.

Icon support will be in the next release,
the beta should be out within a week or so.

/tony

Fredrik's picture
Fredrik
User offline. Last seen 5 days 18 hours ago. Offline
Mobile Sorcerer
Joined: 02/16/2009
Posts: 346

In the nightly builds, since r576, there's experimental icon support for Java ME and Symbian S60, 3rd edition. Note that your icon must be in SVG format for it to work on S60.

ezyclie's picture
ezyclie
User offline. Last seen 11 weeks 6 days ago. Offline
Mobile Wizard
Joined: 03/04/2010
Posts: 85

Is there any documentation for this? where we should put our icon ?

Fredrik's picture
Fredrik
User offline. Last seen 5 days 18 hours ago. Offline
Mobile Sorcerer
Joined: 02/16/2009
Posts: 346

We don't have any proper documentation yet, as the system is a little bit buggy.

For now, place a file called "icon.xml" into your project directory. Its content should look like the code below. This file defines the icons available for your project, and their sizes, in pixels.

<?xml version="1.0" encoding="UTF-8"?>
<icon>
	<instance size="default" src="star2t.svg" />
	<instance size="32x32" src="star2q.png" />
</icon>

SVG icons must conform to the SVT-Tiny standard. An example SVG-T file is attached.

When updating an application on Symbian phones with a changed icon, due to a bug in the Symbian OS, the icon displayed will not change until you restart the phone.

ezyclie's picture
ezyclie
User offline. Last seen 11 weeks 6 days ago. Offline
Mobile Wizard
Joined: 03/04/2010
Posts: 85

Hi Fredrik,

I was wondering why my icon.mif commented out from my PKG file:

here's my icon.mif inside my pkg file:

;"C:\MoSync\workspace\activefile\FileExplorer\FinalOutput\Release\Nokia\6110_Navigator\package\ede9dd39_icon.mif" -"!:\resource\apps\ede9dd39_icon.mif"

Should i put the svg or png into my project directory root ?

Fredrik's picture
Fredrik
User offline. Last seen 5 days 18 hours ago. Offline
Mobile Sorcerer
Joined: 02/16/2009
Posts: 346

That is a bug; we forgot to update the PKG template.

If you don't want to wait for a new build, you edit the file yourself. You'll find it in \mosync\eclipse\plugins\com.mobilesorcery.sdk.builder.s60_1.0.0.jar\templates\.

Project root is fine, although you should be able to put the svg in a subdirectory too, if you like. Its path is relative to the icon.xml file.

poocka's picture
poocka
User offline. Last seen 1 week 4 days ago. Offline
Joined: 04/06/2010
Posts: 15

I find that instead of icon.xml must be created file with icon.xml content and .icon extension, then no need to change template.
The only bug that I do find is, that icon-injector.exe tool does not adds quotation marks to the path when calls ImageMagick's convert. So if you have Project path with spaces, the MIF creation process will fail.

Fredrik's picture
Fredrik
User offline. Last seen 5 days 18 hours ago. Offline
Mobile Sorcerer
Joined: 02/16/2009
Posts: 346
Quote:

The only bug that I do find is, that icon-injector.exe tool does not adds quotation marks to the path when calls ImageMagick's convert. So if you have Project path with spaces, the MIF creation process will fail.

Thank you. I'll go through the icon-injector to add quotation marks wherever needed.

poocka's picture
poocka
User offline. Last seen 1 week 4 days ago. Offline
Joined: 04/06/2010
Posts: 15

My preview post was based on r915.
Today I have installed r1006 - quotation mark is added, but unfortunately another bug appears,

this is console log from building:

c:\MoSync\bin\icon-injector.exe -src C:\MoSync\workspace\test\icon.icon -size 16x16 -platform more -dst C:\MoSync\workspace\test\Output\Release\\more.png
The filename, directory name, or volume label syntax is incorrect.
about to parse...
We have an icon!



parsed
"c:\MoSync\bin\ImageMagick\convert" "C:\MoSync\workspace\test\test.svg" -resize 16x16 "C:\MoSync\workspace\test\Output\Release\\more.png"
Error 1
Image Magick failed.

I tried to run command
c:\MoSync\bin\icon-injector.exe -src C:\MoSync\workspace\test\icon.icon -size 16x16 -platform more -dst C:\MoSync\workspace\test\Output\Release\\more.png
from console - still it gave me error:

C:\>c:\MoSync\bin\icon-injector.exe -src C:\MoSync\workspace\test\icon.icon -size 16x16 -platform more -dst C:\MoSync\workspace\test\Output\Release\\more.png
about to parse...
We have an icon!



parsed
"c:\MoSync\bin\ImageMagick\convert" "C:\MoSync\workspace\test\test.svg" -resize 16x16 "C:\MoSync\workspace\test\Output\Release\\more.png"
The filename, directory name, or volume label syntax is incorrect.
Error 1
Image Magick failed.

However when I run just the convert command exactly as icon-injector states ("c:\MoSync\bin\ImageMagick\convert" "C:\MoSync\workspace\test\test.svg" -resize 16x16 "C:\MoSync\workspace\test\Output\Release\\more.png") - all was finished successfully.
Also there is double backslash before more.png ( ...\Release\\more.png ). It's OK, but better to be removed additional backslash.

poocka's picture
poocka
User offline. Last seen 1 week 4 days ago. Offline
Joined: 04/06/2010
Posts: 15

Build (r1041) - same problems with icon-injector.exe :roll:

Fredrik's picture
Fredrik
User offline. Last seen 5 days 18 hours ago. Offline
Mobile Sorcerer
Joined: 02/16/2009
Posts: 346

Windows' command line parser had me pulling my hair out for a while. Finally found something that worked. See r1051.

poocka's picture
poocka
User offline. Last seen 1 week 4 days ago. Offline
Joined: 04/06/2010
Posts: 15

Thanks a lot for your patience with Windows' command line parser Smile

poocka's picture
poocka
User offline. Last seen 1 week 4 days ago. Offline
Joined: 04/06/2010
Posts: 15

In my last post forgot to point that it does not works Wink
Yea, thanks a lot for your patience with Windows' command line parser, however the situation is pretty same as before - the best result was with r915.
Today checked r1175

The build log states:

We have an icon!



parsed
""c:\MoSync\bin\ImageMagick\convert" "C:\MoSync\workspace\Test\TestLOGO.svg" -resize 16x16 "C:\MoSync\workspace\Test\Output\Release\\more.png"
c:\MoSync\bin\e32hack.exe c:\MoSync\profiles\runtimes\s60v3\1\MoSync.exe C:\MoSync\workspace\Test\FinalOutput\Release\Nokia\6120_classic\package\e03b853c.exe e03b853c
found uid @ 0x18c
c:\MoSync\bin\icon-injector -src C:\MoSync\workspace\Test\icon.icon -size 53x53 -platform symbian9 -dst C:\MoSync\workspace\Test\FinalOutput\Release\Nokia\6120_classic\package/e03b853c_icon.mif
The filename, directory name, or volume label syntax is incorrect.
about to parse...
We have an icon!



parsed
"c:\MoSync/bin/mifconv.exe" "C:\MoSync\workspace\Test\FinalOutput\Release\Nokia\6120_classic\package/e03b853c_icon.mif" "C:\MoSync\workspace\Test\TestLOGO.svg"
Error 1
mifconf failed
c:\MoSync\bin\makesis-4.exe C:\MoSync\workspace\Test\FinalOutput\Release\Nokia\6120_classic\package\e03b853c.pkg
Processing C:\MoSync\workspace\Test\FinalOutput\Release\Nokia\6120_classic\package\e03b853c.pkg...
C:\MoSync\workspace\Test\FinalOutput\Release\Nokia\6120_classic\package\e03b853c.pkg(26) : error: file not found
*** COMMAND LINE WITHHELD, CONTAINS PASSWORDS ***
C:\MoSync\workspace\Test\FinalOutput\Release\Nokia\6120_classic\package\e03b853c.sis: No such file or directory

However when all commands where copied and entered to command line the e03b853c.sis was packed successfully. Shock

I'll try reinstall r915, and try the icon-injector from that package with new build of MoSync. :?

Chris Hughes's picture
Chris Hughes
User offline. Last seen 15 hours 44 min ago. Offline
Mobile Wizard
Joined: 01/11/2010
Posts: 82

You can easily application icons to your projects. All you need to do is to add a file to the project with the *.icon extension and in that file put a few lines of XML. You also, of course, need to add the icons themselves to the project. MoSync handles the rest.

Here is a typical .icon file:

<?xml version="1.0" encoding="UTF-8"?>




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.

There are a few simple guidelines to keep in mind when you add an icon.

1) Some platforms accept only a few image file formats. Symbian for example only accepts SVG format icons. A general rule of thumb is that SVG and PNG formats together cover all the platforms. A good way to step around this problem is to have your icon in both PNG and SVG formats and list both of them in the .icon file. The compiler will then try all the icons and pick one that it feels is the best match (based on size, image type) for the platform.

2) 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.)

3) 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.