Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Sharpen Your Java Wireless Skills with the Zaurus SL-5500 PDA  : Page 4

Developing software for PDAs has often been restricted to C/C++ due to performance issues. Lately, advances in hardware and Java technology are making the PDA suitable for development and deployment with Java. Learn how to leverage your Java knowledge, and much of your existing Java object libraries, to deploy a wide range of functionality on one new PDA, Sharp's Zaurus SL-5500.


advertisement

Native Development
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 is—the 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:

  • gcc-cross-sa1100-2.95.2-0.i386.rpm
  • glibc-arm-2.2.2-0.i386.rpm
  • binutils-cross-arm-2.11.2-0.i386.rpm
  • linux-headers-arm-sa1100-2.4.6-3.i386.rpm

Easy Installers
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
$QPEDIR/java/ScanChamp.jar:$QPEDIR/java/CS1504Com.jar:$QPEDIR/java/Serialio.jar
ScanChamp

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.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap