Should fix up remaining problems in J2ME build and enable build of deployable .jar file

git-svn-id: https://zxing.googlecode.com/svn/trunk@19 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2007-11-07 21:56:22 +00:00
parent f0a299ec80
commit a583462cde
4 changed files with 37 additions and 19 deletions

View file

@ -0,0 +1,11 @@
MIDlet-1: ZXingReader, , com.google.zxing.client.j2me.ZXingMIDlet
MIDlet-Description: Bar Code Reader
MIDlet-Info-URL: code.google.com/p/zxing
MIDlet-Jar-Size: @JAR_SIZE@
MIDlet-Jar-URL: ZXingReader.jar
MIDlet-Name: ZXingReader
MIDlet-Permissions-Opt: javax.microedition.media.control.VideoControl.getSnapshot
MIDlet-Vendor: ZXing Project
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0

View file

@ -27,20 +27,31 @@
</classpath>
</javac>
<unzip src="../core/core.jar" dest="build"/>
<mkdir dir="build-j2me"/>
<exec executable="${WTK-home}/bin/preverify">
<arg line="-classpath ${WTK-home}/lib/cldcapi11.jar:${WTK-home}/lib/midpapi20.jar:${WTK-home}/lib/mmapi.jar:${WTK-home}/lib/satsa-apdu.jar:../core/core.jar -d build-j2me build"/>
<exec executable="${WTK-home}/bin/preverify1.1">
<arg line="-classpath ${WTK-home}/lib/cldcapi11.jar:${WTK-home}/lib/midpapi20.jar:${WTK-home}/lib/mmapi.jar:${WTK-home}/lib/satsa-apdu.jar -d build-j2me build"/>
</exec>
<!-- TODO add manifest -->
<jar jarfile="javame.jar" basedir="build-j2me"/>
<jar jarfile="ZXingReader.jar" basedir="build-j2me" manifest="src/com/google/zxing/client/j2me/MANIFEST.MF"/>
<exec executable="sh" outputproperty="jar-size">
<arg line="-c &quot;wc -c ZXingReader.jar | cut -d' ' -f1&quot;"/>
</exec>
<copy file="ZXingReader.jad.template" tofile="ZXingReader.jad">
<filterset>
<filter token="JAR_SIZE" value="${jar-size}"/>
</filterset>
</copy>
</target>
<target name="clean">
<delete dir="build"/>
<delete dir="build-j2me"/>
<delete file="javame.jar"/>
<delete file="ZXingReader.jar"/>
<delete file="ZXingReader.jad"/>
</target>
</project>

View file

@ -0,0 +1,10 @@
Manifest-Version: 1.0
MIDlet-1: ZXingReader, , com.google.zxing.client.j2me.ZXingMidlet
MIDlet-Description: Bar Code Reader
MIDlet-Info-URL: code.google.com/p/zxing
MIDlet-Name: ZXingReader
MIDlet-Permissions-Opt: javax.microedition.media.control.VideoControl.getSnapshot
MIDlet-Vendor: ZXing Project
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0

View file

@ -21,7 +21,6 @@ import com.google.zxing.MultiFormatReader;
import com.google.zxing.Reader;
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.qrcode.detector.GridSampler;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
@ -48,10 +47,6 @@ public final class ZXingMIDlet extends MIDlet implements CommandListener {
private static final Command DECODE = new Command("Decode", Command.SCREEN, 1);
private static final Command EXIT = new Command("Exit", Command.EXIT, 1);
static {
GridSampler.setGridSamplerClassName("com.google.zxing.client.j2me.JAIGridSampler");
}
private Player player;
private VideoControl videoControl;
@ -66,15 +61,6 @@ public final class ZXingMIDlet extends MIDlet implements CommandListener {
videoControl.setDisplaySize(canvas.getWidth(), canvas.getHeight());
videoControl.setVisible(true);
/*
FormatControl imageFormatControl = (FormatControl)
player.getControl("javax.microedition.amms.control.ImageFormatControl");
if (imageFormatControl != null) {
imageFormatControl.setFormat("image/png");
imageFormatControl.setParameter(FormatControl.PARAM_VERSION_TYPE, "PNG");
} else {
System.out.println("ImageFormatControl not supported");
}
FocusControl focusControl = (FocusControl)
player.getControl("javax.microedition.amms.control.FocusControl");
if (focusControl != null) {