Application icon support for all platforms

18 posts / 0 new
Last post
iDennis
iDennis's picture
Offline
Joined: 28 Aug 2009
Posts:
Application icon support for all platforms

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

Regards
Dennis

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anthony Hartley
Hartley's picture
Offline
Mobile Wizard
Joined: 25 Sep 2007
Posts:

Its work in progress, watch this space.

/Tony

anol
anol's picture
Offline
Mobile Wizard
Joined: 11 Dec 2009
Posts:

I am watching this space Smile

What is the status on application icons?

Anthony Hartley
Hartley's picture
Offline
Mobile Wizard
Joined: 25 Sep 2007
Posts:

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 Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:

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
ezyclie's picture
Offline
Mobile Wizard
Joined: 4 Mar 2010
Posts:

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

Fredrik Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:

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
ezyclie's picture
Offline
Mobile Wizard
Joined: 4 Mar 2010
Posts:

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 Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:

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
poocka's picture
Offline
Joined: 6 Apr 2010
Posts:

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 Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:
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
poocka's picture
Offline
Joined: 6 Apr 2010
Posts:

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
poocka's picture
Offline
Joined: 6 Apr 2010
Posts:

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

Fredrik Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:

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

poocka
poocka's picture
Offline
Joined: 6 Apr 2010
Posts:

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

poocka
poocka's picture
Offline
Joined: 6 Apr 2010
Posts:

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
qlmhuge's picture
Offline
Mobile Sorcerer
Joined: 11 Jan 2010
Posts:

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.

flashback
flashback's picture
Offline
Joined: 11 Nov 2010
Posts:

Hi,

i'm developping an application for a WinMobile phone. Everything went smooth, till i wanted to add an application-icon. I added the xml-file as described above, but no result. Then i tried to run the icon-injector mannualy with following command :

icon-injector -src c:\Mosync\workspace\Chronometer\Chronometer.icon -smallSize 32x32 -largeSize 64x64 -platform winmobile -dst c:\MoSync\workspace\Chronometer\Output\Release\wm6pro\1\Chronometer.cab

this is the result :

about to parse...
We have an icon!

parsed
"c:\MoSync\bin\ImageMagick\convert.exe" "c:\Mosync\workspace\Chronometer\skin\chrono64.png" -resize 64x64 "temp_large.ico"
"c:\MoSync\bin\ImageMagick\convert.exe" "c:\Mosync\workspace\Chronometer\skin\chrono32.png" -resize 32x32 "temp_small.ico"
Error: MoSync::InjectMainIcon failed with error 193: %1 is geen geldige Win32-to
epassing.

result : not a valid Win32-application.
I looked at the code of the icon-projector, and i have to give a valid exe-application. Where can i find this ?

Is it yet possible to add an application-icon for Windows Mobile 6 phones ?
How is the procedure ?

thank you !
David

Eclipse Platform 3.5.0.v20090611a-9gEeG1HFtQcmRThO4O3aR_fqSMvJR2sJ
MoBuild SDK 1.0.0
MoSync SDK - WinMobile Platform 1.0.0.201010280205