C H A P T E R  1

Java ME Platform SDK and Windows Mobile Device Integration

This document describes how to configure a target device running Windows Mobile to work with the JavaTM Platform Micro Edition Software Development Kit.


System Requirements

This section describes the required hardware and software environments for the host computer and the target Windows Mobile device.

Host Computer

Java ME Platform SDK must be installed on a system (the host computer) that meets the minimum hardware and software requirements:



Note - If you installed ActiveSync after the Java ME Platform SDK, you must restart the host computer before using on-device SDK features with a Windows Mobile target device.



Windows Mobile Target Device

The target device must have network connectivity, a 32 bit RISC-based microprocessor, and a minimum 64 MB RAM.


Installing CLDC Emulation on a Windows Mobile Device

This procedure describes how to install Sun Java CLDC Emulation software on a real device and make it available to the Java ME Platform SDK software on the host computer. Before starting, be sure the System Requirements have been met.

  1. Connect the device to your host computer with a USB cable and register it with ActiveSync.

  2. Copy the Sun Java CLDC Emulation Installation CAB file onto the clipboard.

    1. Browse to JavaMESdkHome\on-device\winmobile-arm.

    2. Right-click on sun-java-cldc-emu.cab.

    3. Select Copy from the context menu.

  3. Paste the CAB file into the device root directory.

    1. In Windows Explorer, open Mobile Device.

      Open Mobile Device

    2. Open My Windows Mobile-Based Device.

      Open Mobile Device

    3. Open the Edit menu.

      Open Mobile Edit Menu

    4. Click Paste to insert the CAB file.

  4. Run the File Explorer on your device.

    1. Open the Start menu.

    2. Click Programs.

      Open Start then click Programs

    3. Click File Explorer.

      Click File Explorer

  5. Start the CAB installation on the device.

    1. Open the Show menu.

    2. Select My Device.

      Select My Device

    3. Click on the sun-java-cldc-emu.cab file.

  6. If asked during the installation, install the application on the device.

  7. Wait for the installation to finish.

  8. You can delete the CAB file after the installation is complete.

    1. Press on sun-java-cldc-emu.cab label until the context menu opens.

    2. Click Delete.

      Delete CAB

  9. Run the Sun Java CLDC Emulation on the device.

    1. Open Start menu.

    2. Click Programs.

      Select Programs

    3. Click Sun Java CLDC EMU.

      Select Sun Java CLDC Emu

  10. Wait for the Sun Java CLDC Emulation to start.

    Wait for Sun Java CLDC Emulation to begin

  11. Allow up to 30 seconds (the default value) for Java ME SDK to recognize the connected device and the Sun Java CLDC emulation software.

    When the device is recognized a new device, CldcWinceEmunumber (for example, CldcWinceEmu1) should appear in the Device Selector window, and the output from the command emulator.exe -Xquery should also be displayed.

    You can select this device as a target device in the user interface, or if you run the emulator from the command line it can be used as an argument. For example:

    emulator -Xdevice:CldcWinceEmu1 ...


Installing CLDC Emulation on a Windows Mobile Emulator

This procedure describes how to install the CLDC platform binary for the ARM processor into the Windows Mobile Emulator.

Before starting, be sure the System Requirements have been met.

  1. Download and install Microsoft Device Emulator with device images for Windows Mobile 6.

  2. Download and install Microsoft Virtual PC.



    Note - Installs virtual switch driver required for emulated network adapters.



  3. Run Windows Mobile 6 Professional Emulator and bind its emulated NE2000 Network Adapter to a desktop network card.

    Bind network adapter to the desktop network
card

    • Consult the Microsoft device emulator documentation for instructions.

    • Don’t use ActiveSync for networking (cradling the emulator).

  4. Write down the IP address of the emulator.

    Open the Start menu on the emulator, click Settings, click Connections, click Network Cards, Click NE2000 Compatible Ethernet Driver.

    emulator IP address

  5. Open Emulator Properties

    1. Open the File menu.

    2. Click Configure.

      choose File, then configure

  6. Set JavaMESdkHome\on-device\winmobile-arm as a shared folder.

    1. Browse to JavaMESdkHome\on-device\winmobile-arm.

    2. Click OK.

      Choose winmobile-arm

  7. Run File Explorer on the emulator.

    1. Open Start menu.

    2. Click Programs.

      Select Start, then Programs

    3. Click File Explorer.

      Select File Explorer

  8. Start the Sun Java CLDC Emulation CAB file installation.

    1. Open Show menu.

    2. Select Storage Card.

      from the Show menu, select Storage Card

    3. Click on the sun-java-cldc-emu.cab file.

      click on CAB file

  9. Finish the installation and run the Sun Java CLDC Emulation.



    Note - See Installing CLDC Emulation on a Windows Mobile Device.



    running emulation on device

  10. Use the installdir/bin/device-address tool to register the emulator IP address in the SDK.

    1. Execute the following command to ensure the SDK registers the emulator:

      device-address.exe add ip address

      address should be the IP address written down in step 4.

    2. After the device registers the emulator the device selector window should display the device as CldcWinceEmunumber and it should also appear in the output when you call emulator.exe -Xquery.