在Eclipse 下应用J2ME POLISH

深入了解 J2ME Polish+Eclipse 配置过程 J2ME Polish 是一个用于开发 Java ME(Micro Edition)应用程序的开源框架,它提供了丰富的工具和库,帮助开发者简化和加速移动应用程序的开发过程。本文将详细介绍如何配置 J2ME PolishEclipse,以便在前端开发中进行 Java ME 应用程序的开发。通过按照上述步骤配置 J2ME PolishEclipse,您可以开始开发和调试 Java ME 应用程序。J2ME Polish 提供了丰富的功能和工具,使得开发过程更加高效和便捷。安装 Eclipse 阅读详情

 

在Eclipse 下应用J2ME POLISH
这是一个简单的帮助文档,看完后你将学会polish的基本用法,并用它构建你的j2me工程。
 
Polish拥有着强大的预编译命令,用它可以很方便的去打包资源和分离代码。
 
1.配置:
第一步解压缩最好放到根目录下,无需安装。
第二步将xml的解析文件copy到工程目录下。
第三步在xml上单击右键选择-打开方式-ant构建。
就是这么简单。
 
2.介绍xml
下面是一个例子,在这个xml下填写jad,和资源的目录。很简单,相信大家都能看懂。
<!-- This file controls the build process.                    -->
<!-- The most important target is the j2mepolish-target,      -->
<!-- which controls for what devices the application should   -->
<!-- be created and so on.                                    -->
<!--                                                          -->
<!-- Important: when you have no Wireless Toolkit installed   -->
<!-- you need to define the "preverify"-attribute             -->
<!-- of the <build>-element of the J2ME Polish task.          -->
<!--                                                          -->
<!-- When you call Ant from the command-line, you can         -->
<!-- call "ant test j2mepolish" to skip the obfuscation       -->
<!-- and to build the example for fewer handsets.             -->
<!-- The default target builds and obfuscates the example.    -->
<!--                                                          -->
<!-- The full documentation can be found at                   -->
<!-- http://www.j2mepolish.org                                -->
<!--                                                          -->
<!-- Have fun!                                                -->
<project
    name="SC"
    default="j2mepolish">
 
<!-- The wtk.home property should point to the directory      -->
<!-- containing the Wireless Toolkit.                         -->
<propertyname="wtk.home"value="C:/WTK22"/>
<!-- The polish.home property should point to the directory   -->
<!-- containing the J2ME Polish installation.                 -->
<propertyname="polish.home"value="C:/J2ME-Polish"/>
 
<!-- The siemens.home, nokia.home and motorola.home-          -->
<!-- properties can be necessary when their emulators         -->
<!-- should be started.                                       -->
<!-- The directory which contains the Siemens-SMTK
    <property name="siemens.home" value="C:/siemens" />
-->
<!-- The directory which contains the Nokia-emulators
    <property name="nokia.home" value="C:/Nokia" />
-->
<!-- The path to the Sony-Ericsson SDK
    <property name="sony-ericsson.home" value="C:/SonyEricsson/J2ME_SDK" />
-->
<!-- The directory which contains the Motorola-emulators
    <property name="motorola.home" value="C:/Program Files/Motorola/SDK v4.3 for J2ME" />
-->
 
<!-- Definition of the J2ME Polish task:                      -->
<taskdefname="j2mepolish"
    classname="de.enough.polish.ant.PolishTask"
    classpath="${polish.home}/import/enough-j2mepolish-build.jar:${polish.home}/import/jdom.jar:${polish.home}/import/proguard.jar:${polish.home}/yguard-lib.jar:${wtk.home}/wtklib/kenv.zip"/>
 
<targetname="init">
  <propertyname="test"value="false"/>
    <propertyname="dir.work"value="build"/>
</target>
 
<targetname="clean"
       description="allows a clean build. You should call [ant clean] whenever you made changes to devices.xml, vendors.xml or groups.xml">
    <deletedir="build"/>
    <deletedir="dist"/>
</target>
 
<!-- In this target the J2ME Polish task is used.             -->
<!-- It has 3 sections:                                       -->
<!--    1. The info-section defines some general information -->
<!--    2. The deviceRequirements-section chooses the devices -->
<!--       for which the application is optimized.            -->
<!--    3. The build-section controls the actual build        -->
<!--       process.                                           -->
<targetname="j2mepolish"
        depends="init"
        description="This is the controller for the J2ME build process."
        >
    <j2mepolish>
        <!-- general settings, these settings basically form the JAD-attributes. -->
        <!-- Have a look at the <jad>-section for setting specialised attributes.
             You can also define localized attributes in the resources/messages.txt files -->
        <info
            license="GPL"
            name="驱魔Q传"
            version="1.0"
            description="单机版;Nokia_N${polish.name};动作类"
            vendorName="创艺和弦"
            icon="/icon.png"
            jarName="ExorcismSword_NOK_N${polish.name}.jar"
        />
        <deviceRequirementsunless="test">
            <or>
            <requirementname="Identifier"value="Nokia/7610"/>
            </or>
        </deviceRequirements>
        <build
            symbols=""
            fullscreen="yes"
            usePolishGui="false"
            workDir="${dir.work}">
 
            <midletclass="GhostMidlet"name="驱魔Q传"/>
            <variablesincludeAntProperties="true">
                <variablename="update-url"value="http://www.enough.de/update"/>
                <variablename="title"value="cc"/>
            </variables>
 
            <resourcesdir="res"excludes="">
                <filesetdir="res/"if="polish.identifier == Nokia/7610"/>
            </resources>
 
            <obfuscatorname="ProGuard"useDefaultPackage="true"unless="test">
            </obfuscator>
                 <jad>
                           <attributename="MicroEdition-Configuration"value="CLDC-1.0"/>
                           <attributename="MicroEdition-Profile"value="MIDP-1.0"/>
                          <attributename="Media-Price"value="单次下载8元"/>
                 </jad>
        </build>
    </j2mepolish>
</target>
 
</project>
 
3.Polish语法简介:
几个例子,
关于不同屏幕大小设置变量坐标。
    //#if (polish.ScreenWidth == 240)
    byteoffextX=20;
    inttitleNameX=25+offextX;
    inttitleNameY=43+20;
    intnameOffestX=33+4;
    intnameOffestY=33;
    intnumOffestX=23;
    intnumOffestY=42+4;
    intnumAllY=-5;
 
    bytenameTranY=1;
 
    intmidleMuX=-20+offextX;
    intmidleMuY=-40+30+10;
 
    intyoungManX=-70+offextX;
    intyoungManY=-40+90+10;
 
    integgX=-20;
    integgY=-37+90+10;
 
    intbigEggX;
    intbigEggY=13-12;
 
    //#else (polish.ScreenHeight == 220)
    //# int titleNameX=25;
    //#     int titleNameY=43;
    //#     byte nameOffestX=33;
    //#     byte nameOffestY=33;
    //#     byte numOffestX=23;
    //#     byte numOffestY=42;
    //#     byte numAllY=-5;
 
    //#     byte nameTranY=1;
 
    //#     int midleMuX=-20;
    //#     int midleMuY=-40;
 
    //#     int youngManX=-70;
    //#     int youngManY=-40;
 
    //#     int eggX=-20;
    //#     int eggY=-37;
 
    //# int bigEggX;
    //# int bigEggY=13;
    //#endif
 
不同按键。
    //#if (polish.Vendor == Sony-Ericsson) || (polish.Vendor == Samsung) || (polish.Vendor == Nokia)
    finalstaticpublicintisLeftKey=-6;
    finalstaticpublicintisRightKey=-7;
 
    //#elif (polish.Vendor == Motorola)
    //# final static public int isLeftKey=-21;
    //# final static public int isRightKey=-22;
    //#endif
 
 
 
4. build失败的可能原因:
Jdk的版本1.42的可以,高版本的会出错。(可能和polish的版本有关)
Xml的修改的参数有误,如midlet的名字,是否存在的资源文件夹,wtk,polish的路径。
Polish语法有错,这个一般会在build失败的控制台下有标记。
另外混淆包的路径也要设置正确
 
由于太忙的原因,基本上我没有写什么东西,慢慢我会把这个帖子完善的。
pro j2me polish j2me polish 资料 j2me polish 资料 j2me polish 资料 j2me polish 资料 立即下载

相关推荐

eclipse中怎样使用j2me

eclipse中怎样使用j2meeclipse中怎样使用j2meeclipse中怎样使用j2me

j2me polish v212源码

j2me polish v212完全源码

ASP.NET毕业设计含文档和代码asp.net数据存储与交换系统设计(源代码+论文)

ASP.NET毕业设计含文档和代码asp.net数据存储与交换系统设计(源代码+论文)

J2ME Polish + Eclipse配置过程详解

     到目前(2010/1/20)为止,J2ME Polish官方网站上公布的Polish最新版本是2.1.4,但是鉴于本人使用Eclipse-SDK-3.5.1-win32 + J2ME-Polish-2.1.3版本配置时反复试验均没有成功,于是改为Eclipse-SDK-3.4.1-win32 + J2ME-Polish-2.0.1版本进行配置,下面就对配置过程以及最后创建工程的整个过程做

Mushroom 3450

J2mePolish集成到eclipse32

一、        环境 PC:windows Xp IDE:Eclipse3.2.1 IDE-plug-in:EclipseMe1.5.4 IDE-plug-in:Mepose0.7.1 JAVA :Jdk1.5 SDK:WTK25 GUI:J2mePolish2.0beta3   二、下载 1、Eclipse321,下载地址: http://mirrors.nsa.co.il/eclipse...

vearyy的专栏 180

从一个实例浅谈J2ME Polishbuild功能(二、环境的搭建)

    上一篇文章,我们大致讲了polish的一个基本应用,但我们手头上有同一个游戏不同版本的代码的时候,我们就开始利用polish进行整合,那么在利用polish之前,我们必须把环境搭配好,接下来简单的谈谈polish环境的搭建。     1、eclipse me+jdk+wtk这是开发环境,一般移动百宝箱需要我们用wtk1.0.4,而一般我们开发可以用更高的版本wtk2.2.     2、an

yujiajie1985的专栏 1620

BlackBerry 开发环境建立:Eclipse + J2me polish + BlackBerry

分三步来写,这样清楚些。要是仅仅开发基于 MIDP 的 J2ME 程序, EClipseME 足矣。要是使用到 J2me polishEclipseMe不是必须的, 因为 J2me polish 也提供 Eclipse 插件。要是开发基于 BlackBerry 的应用, 分两种情况:    1 使用了如 J2me polish 等第三方类库。要是 J2me polish 的话,它本身支持 BB

1548

Eclipse Polish 2.1 安装指南

 由于最近在做J2ME的开发,用到了Polish(很强大的工具,网上赞的太多,不多讲,很好很强大)。不过也由于Polish在中国还不普及,资料也不健全,上手还是要点耐心的(夸张了,呵呵),为了配Polish的环境,花了整整两天时间,以前都直接用它的工程修改(很偷懒的做法),过程中有曲折,也希望正准备用的少走点弯路,分享下我的配置经验,不保证完全正确性,但有可行性。   先说Polish的几个重要部

yoyo的专栏 1385

j2me 打包 脚本

Eclipse中使用Ant来自动编译J2me程序 http://www.jspcn.net/htmlnews/11500198197031346.html Antenna与j2me打包 http://www.javaeye.com/topic/117568  netbeans+j2mepolish 环境下开发黑莓(BlackBerry) 程序 http://blog.j2me

blade2001的专栏 644

polish builder 功能二

<br />上一篇文章,我们大致讲了polish的一个基本应用,但我们手头上有同一个游戏不同版本的代码的时候,我们就开始利用polish进行整合,那么在利用polish之前,我们必须把环境搭配好,接下来简单的谈谈polish环境的搭建。<br />     1、eclipse me+jdk+wtk这是开发环境,一般移动百宝箱需要我们用wtk1.0.4,而一般我们开发可以用更高的版本wtk2.2.<br />     2、ant工具(ant是一个基于JAVA的自动化脚本引擎,脚本格式为XML。除了做JAVA编

android大牛MrJing 活动中心 670

j2mepolish导入第三方JAR包

<br /><build><br /><libraries><br />          <library file="D:/j2me/tools/J2ME-Polish/import/SINASMS_2.0.1.jar" />   //这就是导入的jar包<br />          </libraries><br /></build><br /> <br /> <br /> <br /> 原文地址 http://www.devdiv.net/bbs/redirect.php?tid=18282&go

shichao2008的专栏 527

Eclipse搭建J2ME开发环境

sun_java_wireless_toolkit-2_5_2-ml-windows.exe 下载地址:http://www.oracle.com/technetwork/java/download-135801.html(官方网站) Eclipse ME 插件 下载地址: http://nchc.dl.sourceforge.net/project/eclipseme/eclipse

Hsiao的二进制生活 3749

J2mePolish 打包帮助

准备工作下载* Java 2 Standard Edition SDK 1.4 or higher, http://java.sun.com/j2se/ * Sun Java Wireless Toolkit, http://java.sun.com/products/sjwtoolkit/

BlUe H0Use 1481

eclipse中配置j2me,简单运行j2me程序

1.安装好jdk2.去官网上下载eclipse,去eclipseme.org上下载eclipseme,http://www.oracle.com/technetwork/java/download-135801.html下载(wiress toolkit)wtk,WTK需要安装。3.进入eclipse选择help4.选择install new software5.点击add6.在Add Repository中点击archive...7.选择下载好的eclipseme.feature包,zip格式的8.ok

代码之路 3744

ValidX分组验证详解:不同场景使用不同验证规则

一个 DTO 引发的连环事故: 创建时必填、更新时禁止:UserDTO 里用户名注册时必须填、编辑资料时却不用改;ID 新增时不能传、修改时必须带。于是团队拆了 CreateUserDTO 和 UpdateUserDTO 两个类,字段复制一份,改字段时漏改一处,线上悄悄出现"更新把用户名清空了"的 bug。 同一字段两套规则:订单号在"下单"和"查询"两个接口里一个必填、一个可空。为了一个字段写两个 DTO,Controller 里到处是 if (dto.getX() != null) 的补丁式判断。 审

vipxieliang的博客 660
java_think
博客等级 码龄19年 1粉丝 1原创
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值