2

How can I configure the size of the icon to fit correctly on the multiple mobile devices?

Based on the J2ME Polish documentation, I'm using the following resources folder structure:

IconSize.15x15\icon.png
IconSize.16x16\icon.png
...

But it's no working, I've tried in several mobile devices and all of them load the default J2ME Polish icon.

Here's my build.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project name="myProject" default="j2mepolish">
    <property name="polish.home" location="C:\Program Files (x86)\J2ME-Polish" />
    <property name="wtk.home" location="C:\JavaME_SDK" />
    <taskdef
        name="j2mepolish"
        classname="de.enough.polish.ant.PolishTask"
        classpath="${polish.home}/lib/enough-j2mepolish-build.jar"
    />
    <target name="run">
        <j2mepolish>
            <info
                name="My Project"
                version="1.0.0"
                description="My Project"
                vendorName="Diogo"
                jarName="myProject.jar"
            />
            <deviceRequirements>
                <requirement name="Term" value="polish.api.wmapi" />
                <requirement name="Identifier" value="Generic/AnyPhone" />
            </deviceRequirements>
            <build
                usePolishGui="true">
                <libraries>
                        <library file="lib/json-1.0.jar" />
                </libraries>
                <midlet class="myProject" />
                <resources
                    dir="resources/"
                    defaultexcludes="yes"
                    excludes="readme.txt" >
                    <root dir="resources/" includeSubDirs="true" includeBaseDir="true" />
                </resources>
                <variables>
                    <variable name="polish.usePolishTitle" value="true" />
                    <variable name="polish.TextField.suppressCommands" value="true" />
                    <variable name="polish.TextField.useDirectInput" value="true" />
                    <variable name="polish.TextField.showInputInfo" value="false" />
                </variables>
                <obfuscator name="ProGuard"></obfuscator>
                <postcompiler name="java5" />
            </build>
            <emulator />
        </j2mepolish>
    </target>
    <target name="clean">
        <delete dir="build" />
        <delete dir="dist" />
    </target>
</project>
Diogo Cardoso
  • 21,637
  • 26
  • 100
  • 138

1 Answers1

0

Java ME application icon is defined on Jad and Manifest keys. It is often informed in both MIDlet-Icon and the second value of MIDlet-1. See this other question about it add icon to j2me application. And also see this other questions on icon sizes Is there a standard icon size and color depth for J2ME?.

On the link you provided http://www.enough.de/products/j2me-polish/documentation/building/resource-handling/resource-assembling.html there is this text: "You can use the IconSize.0x0 for storing icon resources for devices with an unknown IconSize capability"

I suggest you, by my personal experience with icons - not with polish - to add a 32x32 png icon image at this folder.

Community
  • 1
  • 1
Telmo Pimentel Mota
  • 4,033
  • 16
  • 22
  • Have you tried using 32x32 on Nokia N70? The application icon shows up shrunken. – Diogo Cardoso Aug 31 '12 at 23:10
  • The IconSize.0x0 folder tries a "one size fits all" approach. If the N70 is important enough you can create a custom build for it with the proper icon size. – Telmo Pimentel Mota Sep 01 '12 at 15:43
  • If you did use IconSize.0x0 and are now seeing an icon... Shouldn't you mark my answer as correct? – Telmo Pimentel Mota Sep 01 '12 at 15:44
  • IconSize.0x0 does show an icon, but on the menu it shows a badly drawn alpha channel and the icon is actually displayed as a small 10x10 icon on the top left size. about it defaulting from that folder, wouldn't that be the same case with just dumping the icon in the resources folder and stating it's name on the build.xml? – Gonçalo Vieira Sep 03 '12 at 09:09
  • From your question you say you want to "configure the size of the icon to fit correctly on the multiple mobile devices". This is a highly fragmented area and using 0x0 folder is like saying "I do not know the proper icon size and I don't care". If the N70 is important enough you can create an IconSize directory for it with the correct image. – Telmo Pimentel Mota Sep 03 '12 at 11:36