Compiling the application
To compile a Waba class file into a
prc file, which is
executable under the Palm OS, you need to call two programs that come
with Waba, warp and exegen. Both of these are found in the bin
directory under the
<waba_install> directory. The
warp utility creates a
WRP file and a
WRP file is of no use to a Palm device, but
recall that Waba also runs on Windows CE, which is what the
WRP file is for. Warp will generate a default creatorID
PDB file, but this can be overridden with the
/c option, allowing you to specify a creator ID. The
creator ID is a four-byte identifier that is used by the Palm OS to
tie together applications and data. If you distribute an application
commercially, it is a good idea to have a unique creatorID, so that
your application and data do not inadvertently clash with some other
application on the device. You can register a creatorID on the PalmOS
Thus the following command would create a
from our ContactManager class.
warp c /c cnTc ContactManager *.class
c tells warp to create the
file. The other flag is l, which will list the contents of the PDB
/c will set cnTc to be the creatorID associated
PDB file. At least one byte of a creator ID
must be uppercase. The next parameter is what the
file should be called -- in this case, ContactManager. Finally, the
necessary class files should also be included in the
file. Our ContactManager application has only one class, so it is not
important that we have specified the wildcard. However if the app had
many classes, this syntax would add them all to the
The Exegen utility is the other program that must be run against
your application in order to ready it for Palm OS execution. This
PRC file, which will provide the Palm OS with
its entry point into your application. Exegen's command line
parameters look like
Exegen [options] exefile main-window-class warpfile [warpfile2...]
Thus for our ContactManager application, we would run
Exegen ContactManager ContactManager ContactManager
This would specify that the name of the
should be called
ContactManager, our class that extends
waba.ui.MainWindow class is called ContactManager,
and the warp file, which contains our class file(s) is called
ContactManager. As you see, you need to run the warp
utility prior to running Exegen.
After this completes, you will then have a
PDB and a
PRC file, which you can alternately download to the Palm
device itself, or to the Palm OS Emulator (POSE). POSE is a
recommended utility for aiding the compile-edit-run cycle. It is far
less trouble to run your app in the emulator than to do so in the
Of course before you can run this on either, you need to download
the Waba VM itself. Download both the
The other options that can be specified with
are listed below:
||Assign height of application's main window|
||Assign PalmOS PRC icon (e.g.
||Assign size of class heap (e.g.
||Assign size of object heap (e.g.
||Full path to directory containing warp file under WindowsCE|
||Assign size of stack (e.g.
||Assign size of native stack (e.g.
||Assign width of application's main window|
As you can see, there are several flags allowing you to optimize memory usage in your application. It has been my experience that some of these can make a profound difference. For example, without enough class heap size, the Keyboard will not display, but rather throws an exception.
Altering our earlier exegen command, then, we might run it as
exegen /q /i icon.bmp /t 1000 /s 2000 /m 65500 /l 40000
This allows us to set some memory allocations for the VM to make our class run more efficiently. It would be wise to experiment with different values here to find what is optimal for your application. This will depend on how many classes you have, and how many objects you initiate at one time. In device programming such as this, it is always a good idea to be stingy with the number of objects you create.