Running a VisAD application on the iPAQ PDA using SavaJe

Summary: VisAD on the iPAQ/SavaJe is possible, but it's best not to put your application into a JAR file. I hope the following suggestions could save anyone else trying to to run VisAD under SavaJe some time:

1) Copy all data and class files to your iPAQ - don't try to use a network filesystem for data or class loading. 2) Don't use the SavaJe suggestion of bundling your application into a JAR file. 3) Surprise yourself at how usable a VisAD application can be on a handheld device which doesn't even have hardware floating-point! The application I use produces a visualisation of a 35 KB netCDF file representing wave heights in the Mediterranean sea. VisAD runs on my iPAQ about 4-5 times slower than on my 400 MHz PII PC - not stellar performance, but still acceptable.

Background

The research project I am working on is exploring distributed collaborative visualisation and component software technology. We have recently bought Compaq iPAQ PDAs for each of our project team and I saw the prospect of running our VisAD application on such a constrained device as an exciting challenge. (More details of the research project, VisualBeans, are available at http://www.acu.rl.ac.uk/VisualBeans/).

Procedure

I chose the SavaJe operating system, http://www.savaje.com, rather than staying with Windows CE/Pocket PC, as SavaJe supports Java 2 Standard Edition. My application only requires Java2D graphics, which is well supported under SavaJe. Installing SavaJe on the iPAQ was a simple process using the GUI installer which SavaJe provide. I backed-up Windows CE to allow for possible re-installation later.

I had problems getting a network filesystem working reliably under SavaJe. One can either use a web filesystem, using HTTP, or SMB mounts. I have found the latter to be more reliable, although the implementation in SavaJe uses NetBEUI as a transport, so I had to re-install NetBEUI on my desktop PC. (SavaJe appear to be using the jCIFS package from http://jcifs.samba.org - this only runs under NetBEUI as far as I can tell, not TCP/IP).

My attempts at using the Web filesystem worked for files with simple pathnames, but longer pathnames were corrupted, possibly due to my mis-configuration of the Apache web server (I tried this under both Windows NT and Linux). It appears that Apache was returning a directory listing to the iPAQ which contained HTML character entities in the pathnames - i.e. more suitable for presenting to a user reading a HTML page - this particularly confused the SavaJe class loader.

My *recommendation* is not to use a network filesystem for class loading. Instead, copy all class files and other resources directly to the RAM filesystem on the iPAQ. On my 64MB iPAQ, there is around 48 MB available to be shared between program memory and data files. My application takes about 60 KB and the visad.jar file I was using is around 4.5 MB. I was able to run two datasets into my application without running out of space.

The SavaJe documentation on running Java applications (http://www.savaje.com/support/docs/doc/run_java.html) suggests that you bundle your application into a JAR file whose manifest includes entries for 'Main-Class:' and 'Class-Path:' I didn't find running my application from a JAR file to be reliable - my application would start to run, but quickly run out of free memory and usually end up in a system crash. If I was quick enough, I could start the program, then (in another window) remove the application JAR file - this appeared to free some system resources and allow my application to behave as expected. Not what you would call intuitive.

Instead, I copied the directory containg the package class files over to the iPAQ.

The equivalent of CLASSPATH under SavaJe is the environment variable 'base'. This normally allows one to include references to HTTP or SMB filesystems with the syntax http:// or smb:// - however, the syntax for accessing directories or JAR files in the local filesystem uses the syntax file:/// - that's three occurences of the slash character, which caught me out a few times.

In my case, I did the following:

set base=file:///ramfs/users/USER,file:///ramfs/users/ijj/visad.jar

To invoke the Java application, I needed to use the 'run' command with the '-nosm' flag. This specifies running without a security manager - otherwise, access to the local filesystem for e.g. reading data files is not allowed. The run step looks like:

run -nosm package.MainClass

where the 'package' is the directory containing the class files in the Java package within the USER home directory.

Results

My application runs on the iPAQ! A testiment to Java portability, VisAD's effiency, and SavaJe's J2SE environment. The application is quite usable, despite the hardware constraints (no H/W FP, slow-ish CPU and lack of physical screen real estate). The SavaJe environment has some nice features, such as rapid switching between windows with short presses of the iPAQ 'Record' button, and allows one to rotate the screen by long presses on the 'Record' button - each long press rotates the screen by 90 degrees. The spec. also claims that one can pan around a virtual screen if the application windows are larger than the physical screen - I haven't had a chance to try this yet.

Ian Johnson,
Business and Information Technology Department,
CLRC Rutherford Appleton Laboratories.


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: