MoFire支持保存post到本地

如果有图片,会保存到图片文件夹

但是现在有新的问题,如果本地操作太多,比如读文件,写文件,使用相机,使用网络连接…e61i会总是提示用户是否同意做这些本地操作 .太麻烦.是不是可以用签名来做 – 也就是在安装时候让用户同意,以后都不会提示.

发现现在的编码水平有点提升,基本一遍通过.顺便赞一下antenna,实在是很方便的工具.
经验:如果使用FileConnection的话需要使用jsr75的file包.默认情况下antenna是不支持这个包的,所以用他build的时候会找不到FileConnection类,但用eclipseme是可以编译的,因为eclipseme默认都包含了jsr75的包.要让antenna支持jsr75也很简单.只要在build.xml里加入:

<property name=”wtk.optionalpda.enabled” value=”true” />

参考 

使用antenna时候的问题

编译时找不到List.deleteAll这个方法,因为默认的的antenna使用cldc1.0。而这个deleteall是1.1的方法,解决方法是覆盖默认的cldc版本

<property name=”wtk.cldc.version” value=”1.1″/>

Antenna是用来构建j2me项目的ant任务 扩展。让整个构建过程变的很简单和易于管理。

附我使用的构建脚本供参考:

<?xml version=”1.0″?>

<project name=”MoFire” default=”build” basedir=”.”>

<!– Define the Wireless Toolkit home directory. Needed by the tasks. –>

<property name=”wtk.home” value=”D:developmentWTK2.5.2″/>
<property name=”wtk.cldc.version” value=”1.1″/>
<property name=”wtk.midp.version” value=”2.0″/>
<property name=”wtk.proguard.home” value=”D:developmentworkspaceMElibproguard4.1″/>

<!– Define some additional properties for this project. Not required. –>

<property name=”midlet.name” value=”${ant.project.name}”/>
<property name=”midlet.home” value=”.”/>
<property name=”midlet.vendor” value=”MoDoFo”/>
<property name=”midlet.version” value=”0.0.1″/>
<!– Define the tasks. –>

<taskdef resource=”antenna.properties” classpath=”lib/antenna-bin-1.0.0.jar”/>

<target name=”clean”>
<delete failonerror=”false” dir=”classes”/>
</target>

<target name=”dist” depends=”build”>
<mkdir dir=”dist/${midlet.name}-${midlet.version}” />
<property name=”distfolder” value=”dist/${midlet.name}-${midlet.version}”/>
<zip destfile=”${distfolder}/${midlet.name}-${midlet.version}-src.zip”>
<fileset dir=”src” includes=”**/*.*” />
<fileset dir=”res” includes=”**/*.*” />
</zip>
<copy file=”${midlet.name}.jad” todir=”${distfolder}” />
<copy file=”${midlet.name}.jar” todir=”${distfolder}” />
<copy file=”README.txt” todir=”${distfolder}” />

<wtkrun jadfile=”${distfolder}/${midlet.name}.jad” device=”DefaultColorPhone” wait=”true”/>
</target>

<target name=”build”>

<!– Make a JAD file from scratch, don’t copy the original one. –>

<wtkjad jadfile=”${midlet.name}.jad”
name=”${midlet.name}”
vendor=”${midlet.vendor}”
version=”${midlet.version}” >

<midlet name=”MoFire”
icon=”/logo.png”
class=”com.modofo.mofire.MoFire”/>
</wtkjad>

<mkdir dir=”classes”/>

<!– Compile everything, but don’t preverify (yet). –>

<wtkbuild srcdir=”${midlet.home}/src”
destdir=”classes”
preverify=”false”/>

<!– Package everything. Most of the necessary information is
contained in the JAD file. Also preverify the result this
time. To obfuscate everything, set the corresponding
parameter to “true” (requires RetroGuard or ProGuard). The
version parameter increments the MIDlet-Version by one. –>

<wtkpackage jarfile=”${midlet.name}.jar”
jadfile=”${midlet.name}.jad”
obfuscate=”false”
autoversion=”true”>

<!– Package our newly compiled classes and the
resources from the WTK’s demo application. –>

<fileset dir=”classes”/>
<fileset dir=”${midlet.home}/res”/>

</wtkpackage>

<!– Obfuscate. –>
<!– Not needed
<wtkobfuscate jarfile=”${midlet.name}.jar”
jadfile=”${midlet.name}.jad”/>
–>
<!– Preverify things, this time separately to test the
corresponding task. –>

<wtkpreverify jarfile=”${midlet.name}.jar”
jadfile=”${midlet.name}.jad”/>

<!– Convert the JAR file into a MIDP for PalmOS PRC file. –>
<!– Not supported in wtk anymore – Zhangv
<wtkmakeprc jadfile=”${midlet.name}.jad”
prcfile=”${midlet.name}.prc”/>
–>
<!– Start the MIDlet suite –>
<!– Not need
<wtkrun jadfile=”${midlet.name}.jad” device=”DefaultColorPhone” wait=”true”/>
–>
</target>
</project>