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 using ActiveSync 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" directory.

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 helloworld.java and javatest.java. (Javatest is basically the WiFiSpotterExpample outside of any package.)

  1. 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 '\')

  2. Copy the .class to your PDA (e.g. copy helloworld.class or javatest.class. to a directory on the PDA called /test)

  3. 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 line):
    234#\placelab\j9\bin\j9.exe
    "-Xbootclasspath:\placelab\j9\lib\classes.zip;\placelab\lib\ppro-ui-win.zip"
    -Dplacelab.ini=/placelab/placelabdata/placelab.ini -cp
    "/placelab/lib/placelab.jar;/test" javatest

  4. Run the program by clicking on the .lnk file on the PDA


Misc Tips

0