Java Programming for IPAQ 4350
Java Programming for IPAQ 4350
The following are step-by-step instructions on how to get java and
PlaceLab working on the PDAs we're using this quarter. I would suggest
3.8 (or something comparable) to be able to transfer files to the
PDA and navigate the folders on the PDA more easily.
Installing PlaceLab and J9 VM
The PlaceLab v2.0 install includes the J9 java run-time environment,
the PlaceLab source code, pre-compiled jar files,
platform-specific executables, and scripts.
The default version of the PlaceLab toolkit has some issues with
detecting the network cards used in the iPaq 4350, so I have uploaded
a slightly modified install for the class. Download the modified
version of PlaceLab toolkit from here: placelab.zip.
For anyone interested, the specific modifications were:
Unzip the file, and use ActiveSync to copy the "placelab" folder onto
the root directory ("/") of your PDA - this may take a few minutes.
To do this, use the ActiveSync file explorer to drag the file to "My
Pocket PC" - it should show up in the same directory as the "Windows"
- Some non-critical files and directories (like /doc,
/placelabdata) are removed to ensure that the install will fit in the
- The spotter-ce.dll is modified to enable PlaceLab to recognize
the iPaq network card used in the 4350 (among others).
(Details about the tweaks required to the default spotter.dll are
You can use the file explorer on the PDA to go to execute the programs
(.lnk files) in PlaceLab/run/ and ensure that the install is working
correctly. The stumbler program (MyDevice->placelab->run->stumbler)
should be able to detect networks.
Compiling Java scripts and creating .lnk files to run them
To run your own programs on the PDA, you will need to execute the
following steps. Some sample java files to test with are
(Javatest is basically the WiFiSpotterExpample outside of any package.)
- Compile your .java file to generate a .class file: I would
suggest using the J9 JVM available with placelab, but have also tested
a simple application compiled using the Sun Java JDK (1.4.2). For J9,
you can use the J9 install available with the toolkits on the PlaceLab downloads page.
After installing the toolkit on the development machine, you can
compile your program under cygwin using a command line like:
c:/placelab-win32/j9/bin/j9c.exe -classpath c:/placelab-win32/j9/lib/classes.zip\;c:/placelab-win32/src helloworld.java
(from windows using cygwin, with placelab-win32 unzipped in
c:/placelab-win32. Helloworld does not require c:/placelab-win32/src in the classpath, but
javatest or any other application using PlaceLab will.)
Or, from DOS command prompt, it will look like:
c:\placelab-win32\j9\bin\j9c.exe -classpath c:\placelab-win32\j9\lib\classes.zip;c:\placelab-win32\src helloworld.java
(';' is enough as separator, you don't need '\')
- Copy the .class to your PDA (e.g. copy
to a directory on the PDA called /test)
- Create a .lnk shortcut for your program, and copy it to the same
folder on your PDA:
For example, for the above setup, javatest.lnk would contain (on a single
- The number "234#" is supposed to represent how many chars are in the link, but
does not seem to be used.
- "\placelab\j9\bin\j9.exe" is the path to the VM
- The next two items point to PlaceLab specific libraries, etc.
- "-cp" is the class path (include any external jars you need as
well as your application directory or jar). In this case,
javatest.class is in the folder /test. The placelab.jar file is
included in the classpath, since javatest makes use of the PlaceLab
- The last item is the main class to run. In this case, it's javatest.
- Run the program by clicking on the .lnk file on the PDA
- If you are having problems with programs complaining about
insufficient memory, you should check the task manager (silver arrow
button) and close excess applications.
- Even if you don't plan to use PlaceLab functionality, you can use
their applications as a starting point for the GUI or file
organization of your program.