<dfn id="is4kg"></dfn>
  • <ul id="is4kg"></ul>
  • <abbr id="is4kg"></abbr>
  • <ul id="is4kg"></ul>
    <bdo id="is4kg"></bdo>

    曙海教育集團(tuán)論壇Linux專區(qū)Linux應(yīng)用開發(fā) → 在Eclipse下應(yīng)用J2ME POLISH


      共有5139人關(guān)注過(guò)本帖樹形打印

    主題:在Eclipse下應(yīng)用J2ME POLISH

    美女呀,離線,留言給我吧!
    wangxinxin
      1樓 個(gè)性首頁(yè) | 博客 | 信息 | 搜索 | 郵箱 | 主頁(yè) | UC


    加好友 發(fā)短信
    等級(jí):青蜂俠 帖子:1393 積分:14038 威望:0 精華:0 注冊(cè):2010-11-12 11:08:23
    在Eclipse下應(yīng)用J2ME POLISH  發(fā)帖心情 Post By:2010-11-23 10:02:38

    這是一個(gè)簡(jiǎn)單的幫助文檔,看完后你將學(xué)會(huì)polish的基本用法,并用它構(gòu)建你的j2me工程。

          Polish擁有著強(qiáng)大的預(yù)編譯命令,用它可以很方便的去打包資源和分離代碼。

    1.配置:
    第一步解壓縮最好放到根目錄下,無(wú)需安裝。
    第二步將xml的解析文件copy到工程目錄下。
    第三步在xml上單擊右鍵選擇-打開方式-ant構(gòu)建。
    就是這么簡(jiǎn)單。

    2.介紹xml
    下面是一個(gè)例子,在這個(gè)xml下填寫jad,和資源的目錄。很簡(jiǎn)單,相信大家都能看懂。
    <!-- 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ū)魔Q傳"
                version="1.0"
                description="單機(jī)版;Nokia_N${polish.name};動(dòng)作類"
                vendorName="創(chuàng)藝和弦"
                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ū)魔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語(yǔ)法簡(jiǎn)介:
    幾個(gè)例子,
    關(guān)于不同屏幕大小設(shè)置變量坐標(biāo)。
        //#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的可以,高版本的會(huì)出錯(cuò)。(可能和polish的版本有關(guān))
    Xml的修改的參數(shù)有誤,如midlet的名字,是否存在的資源文件夾,wtk,polish的路徑。
    Polish語(yǔ)法有錯(cuò),這個(gè)一般會(huì)在build失敗的控制臺(tái)下有標(biāo)記。
    另外混淆包的路徑也要設(shè)置正確


    支持(0中立(0反對(duì)(0單帖管理 | 引用 | 回復(fù) 回到頂部

    返回版面帖子列表

    在Eclipse下應(yīng)用J2ME POLISH








    簽名
    主站蜘蛛池模板: 污污动漫在线观看| 够够了太深了h1v3| 免费看美女被靠到爽的视频| 黄色软件视频大全免费下载| 宝宝你里面好烫很软不想出来 | fulidown国产精品合集| 黄色免费短视频| 欧男同同性videos免费| 啊灬啊灬啊灬快灬高潮少妇| 91freevideos精品| 成年人黄色一级片| 亚洲成AV人片久久| 精品人妻人人做人人爽夜夜爽| 国产成人精品久久| 亚洲av永久无码精品三区在线4 | 综合欧美亚洲日本| 国产精品久久久久一区二区| 中文乱码精品一区二区三区| 日韩人妻无码中文字幕视频| 交性大片欧美网| 精品久久久久久中文字幕大豆网 | 国语精品视频在线观看不卡| 久久9精品久久久| 日韩在线观看第一页| 国产精品久久国产精麻豆99网站 | 婷婷激情五月综合| 久久爰www免费人成| 本道久久综合无码中文字幕| 亚洲线精品一区二区三区| 男女一级毛片免费视频看| 国产精品美女在线观看| 一级毛片免费不卡| 成人福利app| 久久波多野结衣| 日韩精品欧美一区二区三区 | 国产呦系列免费| 黑白禁区在线观看免费版 | 亚洲人成影院77777| 欧美国产激情二区三区| 人人公开免费超级碰碰碰视频| 看看屋在线看看电影|