I'm testing SuperWaba for potential use with a project. For this project we have to support the use of Palm and WinCE handheld devices for data entry. I'm posting notes that I have as I go along.
My initial test machines are a Treo 650 and a NEC MobilePro 770.
Installing the runtime
You can download the necessary runtime files from http://www.superwaba.org/install/
Treo 650
This was just a matter of syncing a couple of files over to the Treo. The file I downloaded was http://www.superwaba.org/install/PalmOS5_ARM_16bpp.zip. Expanded, it contained the following files:
SuperWaba.pdb SuperWaba.prc XPlatGame.pdb XPlatIo.pdb XPlatUI.pdb XPlatUtil.pdb XPlatUtilProps.pdb license.txt
I synced the following files to my Treo (to the main memory, not the expansion card):
SuperWaba.pdb SuperWaba.prc
MobilePro 770
For this one I had to download the file http://www.superwaba.org/install/superwaba.HPC211_MIPS.CAB.
After copying the CAB file over to the handheld, I just executed the file to install it. I installed it to the directory \SuperWaba.
Building a Demo
I made a copy of the EditExample.java file and set it up in a directory structure as follows:
build/
build.xml
src/
com/
gnm/
test01/
EditExample.java
Here is the contents of EditExample.java:
package com.gnm.test01;
import waba.ui.*;
import waba.fx.*;
public class EditExample extends MainWindow
{
private Edit ed1;
public EditExample()
{
super("Edit Example",TAB_ONLY_BORDER);
// waba.sys.Settings.setPalmOSStyle(true);
}
public void onStart()
{
ed1 = new Edit();
add(ed1);
ed1.setRect(LEFT,TOP+5,80,PREFERRED);
Edit ed2 = new Edit("9999.99");
ed2.setMode(Edit.CURRENCY);
add(ed2,LEFT,AFTER+5);
Edit ed3 = new Edit("99/99/9999");
ed3.setMode(Edit.DATE);
add(ed3,LEFT,AFTER+5);
Edit ed4 = new Edit("AAAAA");
ed4.setMode(Edit.PASSWORD);
add(ed4,LEFT,AFTER+5);
ed4.setText("pass");
Edit ed5 = new Edit();
ed5.setMaxLength(4);
ed5.setValidChars("123ABC");
add(ed5);
ed5.setRect(LEFT,AFTER+5,40,PREFERRED);
String txt = "Can't Edit";
Edit ed6 = new Edit(txt);
ed6.setEditable(false);
ed6.setText(txt);
add(ed6,LEFT,AFTER+5);
}
}
Here is the contents of build.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- simple project ant build file -->
<project name="TEST" default="run-warp-and-exegen" basedir=".">
<description>
Simple script to runs Warp and Exegen, ideal to be called from Eclipse.
Just copy to your program's directory and create the ant target.
Exegen needs to be called just once (unless you are creating wince install files),
and Warp must be called every time a class is changed.
</description>
<!-- change these properties to match yours -->
<target name="init">
<property name="sw.root" value="/Users/gordy/Projects2/superwaba/GPL_SuperWabaSDK_0552"/>
<property name="version" value="1.0"/>
<property name="app.creator" value="gmT1"/>
<property name="app.name" value="EditExample"/>
<property name="main.class" value="com.gnm.test01.EditExample"/>
<property name="app.title" value="EditExample"/>
<property name="app.package" value="com/gnm/test01/*.class"/>
<echo message="Superwaba SDK root folder is ${sw.root}"/>
</target>
<target name="test01_compile" depends="init" description="Compile the source code files">
<javac srcdir="./src" destdir="./build" target="1.1">
<classpath>
<pathelement location="${sw.root}/lib/SuperWaba.jar" />
<pathelement location="${sw.root}/lib/SuperWabaTools.jar" />
</classpath>
</javac>
</target>
<target name="test01_run" depends="test01_compile" description="Run on computer">
<java classname="waba.applet.Applet" fork="true"
jvm="/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Commands/java">
<jvmarg value="-Dcom.apple.hwaccel=false"/>
<arg value="com.gnm.test01.EditExample"/>
<classpath>
<pathelement location="${sw.root}/lib/SuperWaba.jar" />
<pathelement location="${sw.root}/lib/SuperWabaTools.jar" />
<pathelement location="./build" />
</classpath>
</java>
</target>
<!-- no changes should be needed from here to the end -->
<target name="run-warp" depends="init,test01_compile" description="Executes Warp.">
<java classname="superwaba.tools.Warp" fork="yes" dir=".">
<classpath>
<pathelement location="./build"/>
<pathelement location="${sw.root}/lib/SuperWabaTools.jar"/>
<pathelement location="${sw.root}/lib/SuperWaba.jar"/>
</classpath>
<arg value="c"/>
<arg line="/C ${app.creator}"/>
<arg line="${app.name}"/>
<arg value="${app.package}"/>
</java>
</target>
<target name="run-exegen" depends="init" description="Executes Exegen.">
<java classname="superwaba.tools.Exegen" fork="yes" dir=".">
<classpath>
<pathelement location="${sw.root}/lib/SuperWabaTools.jar"/>
<pathelement location="${sw.root}/lib/SuperWaba.jar"/>
</classpath>
<arg line="/C ${app.creator}"/>
<arg line="/V ${version}"/>
<arg line="/L"/>
<arg line="/E"/>
<arg line="${app.name} ${main.class} ${app.name}"/>
</java>
</target>
<target name="run-warp-and-exegen" depends="init" description="Executes Warp, then Exegen.">
<antcall target="run-warp"/>
<antcall target="run-exegen"/>
</target>
</project>
When I ran the ant command, this was the output:
Buildfile: build.xml
init:
[echo] Superwaba SDK root folder is /Users/gordy/Projects2/superwaba/GPL_SuperWabaSDK_0552
run-warp-and-exegen:
init:
[echo] Superwaba SDK root folder is /Users/gordy/Projects2/superwaba/GPL_SuperWabaSDK_0552
test01_compile:
[javac] Compiling 1 source file to /Users/gordy/Projects2/superwaba/test_01/build
run-warp:
[java] (Super)Waba Application Resource Packager for Java Version 5.0
[java] Copyright (C) Rob Nielsen 1999-2001. All rights reserved
[java] Copyright (C) SuperWaba Ltda 2002-2005. All rights reserved
[java] PDB file: EditExample.pdb
[java] PDB name: EditExample
[java] PDB creator: gmT1
[java] PDB copy protected: false
[java] ...writing EditExample.pdb
[java] ...adding: com/gnm/test01/EditExample.class
[java] ...done
init:
[echo] Superwaba SDK root folder is /Users/gordy/Projects2/superwaba/GPL_SuperWabaSDK_0552
run-exegen:
[java] SuperWaba Launch Executable Generator for Java Version 5.0
[java] Copyright (C) Rob Nielsen 1999-2001. All rights reserved
[java] Copyright (C) SuperWaba Ltda 2002-2005. All rights reserved
[java] Output file: EditExample
[java] Class name: com/gnm/test01/EditExample
[java] PalmOS PRC name: EditExample
[java] Creator ID: gmT1
[java] WindowsCE Program directory: EditExample
[java] App version: 1.0
[java] WindowsCE Link Path: \SuperWaba\EditExample
[java] ...writing EditExample.prc
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/HPC211/ARM/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/HPC211/MIPS/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/HPC211/SH3/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/PocketPC/ARM/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/PocketPC/MIPS/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/PocketPC/SH3/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/PPC211/MIPS/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/PPC211/SH3/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/HPC2000/MIPS/EditExample.exe
[java] ...writing /Users/gordy/Projects2/superwaba/test_01/HPC2000/ARM/EditExample.exe
[java] ...writing EditExample.lnk
[java] ...done
BUILD SUCCESSFUL
Total time: 4 seconds
Here are the resulting files after running the ant command:
build/
com/
gnm/
test01/
EditExample.class
build.xml
EditExample.lnk
EditExample.pdb
EditExample.prc
HPC2000/
ARM/
EditExample.exe
MIPS/
EditExample.exe
HPC211/
ARM/
EditExample.exe
MIPS/
EditExample.exe
SH3/
EditExample.exe
PocketPC/
ARM/
EditExample.exe
MIPS/
EditExample.exe
SH3/
EditExample.exe
PPC211/
MIPS/
EditExample.exe
SH3/
EditExample.exe
src/
com/
gnm/
test01/
EditExample.java
To test on the Treo 650 I synched these two files over to the Treo:
EditExample.pdb EditExample.prc
This worked just fine.
To test on the WinCE device, I set it up as follows:
