Fortunately, the Zaurus uses Personal Java instead of J2ME, which, in my opinion, is a great advantage. This allows developers to extend Java functionality using native methods, preventing the 'it is what it isthe vendor knows best' situation that you get with J2ME.
Having worked with Java since its inception, my opinion is that without developer access to native methods Java would have had limited market acceptance. Native methods were required for the first Java project our company worked on. Additional support of this perspective can be found looking at the existing crop of J2ME cell phones: Most J2ME implementations don't provide access to the device phone book. Without native methods to bridge the gap, the value of Java on these phones is limited.
The Zaurus doesn't have this restriction, so the possibilities for developers are virtually endless. For example, the application displayed in Figure 1 uses native methods to extend Java to access the RS-232 serial port.
To create native methods on the Zaurus, you typically compile native code with an ARM cross-compiler running on Linux. These compilers are free. Here's a list of some of the ones available. The components at the time of this writing are:
A good developer knows that a good application does not guarantee success; a good user interface must accompany good application logic, functionality, and successful code execution. So, too, installation must be a snap. Typically, installing a Java app on a PDA is about as fun as getting a root canal. The Zaurus, however, provides a quick and easy installation process.
Sharp has made building installers straightforward, too. Installers can be built on Linux using the ipkg-tools. To get the tool, go to ftp://lorien.handhelds.org/pub/linux/feeds/demo and download the file named ipkg-tools.tgz. If Windows is your development platform these ipkg-tools can be run under cygwin. Gabriel Software has a Zaurus deployment feature plug-in for JBuilder .
The directory structure in Figure 4 is for a typical Java installer. Note the install location on the Zaurus is controlled by the folder location for the .desktop file. For your application to install in Applications area instead of the Jeode area, simply replace the apps/Jeode folder with apps/Applications and put the ScanChamp.desktop file in that folder. The contents of these files are described in pjava_prog-gd-020404_mk_checked_sh.pdf (or newer version) at http://developer.sharpsec.com.
|Figure 4. Check the Location: This directory structure is for a typical Java installer. Note the install location on the Zaurus is controlled by the folder location for the .desktop file.|
There is one documentation issue related to the script file (runscanchamp, in this example) that evaded even the excellent Zaurus support team. Except for the standard script header, the content of the file is shown below (it would normally be all on one line). The documentation indicates that the XappName entry should be set to the application name. When this is done, the application icon doesn't display on the taskbar, eliminating the entire task-switching benefits described earlier! Until this is fixed, always set XappName=$0 to have the app icon on the taskbar.
$QPEDIR/bin/evm -Xprogressbar -XappName=$0 -cp
Once created, IPK installer packages can be installed via USB or a network connection. Or you can simply pop the IPK file on a Compact Flash (CF) memory card, put the card in the Zaurus, and do the install with just a few stylus taps. If your application uses the built-in serial port, a CF card is very convenient. To avoid having to pop a CF memory card in and out of the device, a CF network card can be used with the "Install packages via networks" option. I routinely use 802.11b WLAN CF cards, from D-Link and Socket/Symbol for this purpose with great results.