J2ME打包办理移动平台api问题[Java编程]
本文“J2ME打包办理移动平台api问题[Java编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
提交给移动上线的kjava游戏,假如直接用jb打包会碰到平台api 问题.
目前我们可以用ant打包来办理移动平台api问题.具体办法以下:
1.下载antenna-bin-0.9.13.jar,apache-ant-1.6.2
2.把antenna-bin-0.9.13.jar放到apache-ant-1.6.2lib下,
3.把nokiaui.jar放到apache-ant-1.6.2lib下,
4.把gx.jar放到apache-ant-1.6.2lib下,
5.设置ant的环境变量:有ANT_HOME,PATH两项
6.编写bulid.xml
7.打包后在bulid.xml的同一目录下有一个MANIFEST.MF这个文件,可以把这个放到
jar里面替换掉本来的,可以减小一点size.
8.MicroEdition-Profile: MIDP-1.0
MicroEdition-Configration: CLDC-1.0
Media-Price: 5元每次
这些只要手工加在jad里面就行,build.xml里面仿佛没有选项加这个.
下面给出一个例子:bulid.xml
<?xml version="1.0"?>
<project name="LoveNote_S40" default="build" basedir=".">
<property name="build.compiler" value="classic"/>
<!-- Define the Siemens Mobility Toolkit home directory. Needed by the tasks. -->
<property name="wtk.home" value="C:WTK104"/>
<!-- Define some additional properties for this project. Not required. -->
<property name="midlet.name" value="LoveNote_S40"/>
<property name="midlet.home" value="."/>
<!-- Define the tasks. -->
<taskdef resource="antenna.properties"/>
<target name="clean">
<delete failonerror="false" dir="classes"/>
<delete failonerror="false">
<fileset dir=".">
<exclude name="build.xml"/>
</fileset>
</delete>
</target>
<target name="build">
<!-- Create a JAD file. -->
<wtkjad jadfile="LoveNote_S40.jad"
jarfile="LoveNote_S40.jar"
name="LoveNote"
vendor="websurf tech co., inc."
manifest="MANIFEST.MF"
version="1.0">
<midlet name="LoveNote" icon="/icons/icon.png" class="GameMidlet"/>
</wtkjad>
<!-- Make sure we have a fresh classes directory. -->
<delete dir="classes"/>
<mkdir dir="classes"/>
<!-- Compile everything, but don't preverify (yet). -->
<wtkbuild srcdir="${midlet.home}" destdir="classes" preverify="false" encoding="utf-8"/>
<!-- Package everything. -->
<wtkpackage jarfile="${midlet.name}.jar" jadfile="${midlet.name}.jad" manifest="MANIFEST.MF" obfuscate="true">
<fileset dir="classes"/>
<fileset dir="res"/>
</wtkpackage>
<!-- Preverify -->
<wtkpreverify jarfile="${midlet.name}.jar" jadfile="${midlet.name}.jad"
bootclasspath="${wtk.home}libmidpapi.zip"
classpath="${wtk.home}libextnokiaui.jar"/>
<!-- Start the MIDlet suite
<wtkrun jadfile="${midlet.name}.jad" wait="false" device="DefaultColorPhone"/> -->
</target>
</project>
以上是“J2ME打包办理移动平台api问题[Java编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |