在J2ME Polish上配置图标的大小

时间:2012-08-23 12:13:23

标签: java java-me icons midlet j2mepolish

如何配置图标的大小以便在多个移动设备上正确匹配?

基于J2ME Polish documentation,我使用以下resources文件夹结构:

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

但它没有用,我尝试过几个移动设备,所有这些设备都加载了默认的J2ME波兰语图标。

这是我的build.xml文件:

<?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>

1 个答案:

答案 0 :(得分:0)

Java J应用程序图标是在Jad和Manifest键上定义的。它通常以MIDlet-IconMIDlet-1的第二个值通知。请参阅有关它的其他问题add icon to j2me application。另请参阅有关图标大小Is there a standard icon size and color depth for J2ME?的其他问题。

在您提供的链接http://www.enough.de/products/j2me-polish/documentation/building/resource-handling/resource-assembling.html上有以下文字:“您可以使用IconSize.0x0为具有未知IconSize功能的设备存储图标资源”

我建议您根据我个人使用图标的经验 - 而不是使用图标 - 在此文件夹中添加32x32 png图标图像。