Contents Index Lesson 3: Select the rows from the table Lesson 5: Add synchronization to your application

Native UltraLite for Java User's Guide
  Tutorial: An Introductory Application

Lesson 4: Deploy your application to a Windows CE device


Running the application on Windows CE requires that the Jeode Runtime Java VM be installed on your device. The Jeode Runtime is available for ARM-based devices such as the Compaq iPaq, and can be found on the CD that comes with the device.

To confirm that the Jeode VM is installed on your Windows CE device

To prepare your application to run on a Windows CE device

  1. Specify the location of your database file and schema file.

    In the Customer constructor, alter the CreateParms object to read as follows:

    CreateParms parms = new CreateParms();
    parms.databaseOnDesktop = "c:\\tutorial\\java\\tutcustomer.udb";
    parms.databaseOnCE = "\\UltraLite\\tutorial\\tutcustomer.udb";
    parms.schema.schemaOnDesktop = "c:\\tutorial\\java\\tutcustomer.usm";
    parms.schema.schemaOnCE = "\\UltraLite\\tutorial\\tutcustomer.usm"";

    The new parameters are schemaOnCE and databaseOnCE. They indicate where on the device the schema and database are to be deployed.

  2. Compile your application again.

  3. Run your application to check that no errors were introduced. The schemaOnCE and databaseOnCE parameters have no effect when running in a desktop environment.

  4. Prepare a shortcut to run the application.

    A shortcut is a text file with .lnk extension, which contains a command line to run the application. In the next procedure, you copy this shortcut file to a location on the device.

    Using a text editor, create a file named tutorial.lnk in your tutorial directory with the following content, which should all be on a single line.

    18#"\Windows\evm.exe"
    -Djeode.evm.console.local.keep=TRUE
    -Djeode.evm.console.local.paging=TRUE
    -Djul.library.dir=\UltraLite\lib
    -cp \UltraLite\tutorial;\UltraLite\lib\jul9.jar
    Customer

    The content is displayed on multiple lines for legibility. The meaning of the elements in this command are as follows:

You are now ready to copy the files to your device. You must copy both UltraLite runtime files and application-specific files.

To deploy the UltraLite runtime to the Windows CE device

  1. Start Windows Explorer on your Windows CE device.

  2. Create directories to hold the UltraLite runtime and application.

  3. Copy the UltraLite runtime files to the Windows CE device:

    Desktop location relative to your SQL Anywhere directory Windows CE location
    UltraLite\NativeUltraLiteForJava \jul9.jar \UltraLite\lib\jul9.jar
    UltraLite\NativeUltraLiteForJava \ce\arm\jul9.dll \UltraLite\lib\jul9.dll
  4. Copy the application files to the Windows CE device:

    Desktop location Windows CE location

    Customer.class

    \UltraLite\tutorial
    tutcustomer.usm \UltraLite\tutorial

    In this tutorial, do not copy the database file to the Windows CE device.

  5. Copy the shortcut file to the Windows CE device:

    Desktop location Windows CE location
    tutorial.lnk \Windows\Start Menu

You are now ready to run the application on your Windows CE device.

To run the application

  1. On the Windows CE device, choose Start > tutorial.

    This shortcut is the tutorial.lnk file that you copied onto the device.

  2. On the Windows CE device, choose Start > tutorial again.

    This time the first two messages are as follows:

    Connected to an existing database.
    The table has 2 rows.

You have now written an application, tested it on a desktop computer, and deployed it to a Windows CE device.


Contents Index Lesson 3: Select the rows from the table Lesson 5: Add synchronization to your application