Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0

Get PDF Book Print View

Document Information

Getting Started

Java ME Platform SDK Features

Using Sample Projects

Creating and Editing Projects

Viewing and Editing Project Properties

Running Projects in the Emulator

Searching the WURFL Device Database

Finding Files in the Multiple User Environment

Profiling Applications

Monitoring Network Traffic

Lightweight UI Toolkit

Security and MIDlet Signing

BD-J Support

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator

On-device Debugging

On-device Debugging Procedure

Attach a Command Line Debugger

Attach a Graphical Debugger

Sample CLDC Debugging Session

Command Line Reference


JSR Support

JSR 75: PDA Optional Packages

JSR 82: Bluetooth and OBEX Support

JSR 135: Mobile Media API Support

JSR 172: Web Services Support

JSR 177: Smart Card Security (SATSA)

JSR 179: Location API Support

JSRs 184, 226, and 239: Graphics Capabilities

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 238: Mobile Internationalization API (MIA)

JSR 229: Payment API Support

JSR 256: Mobile Sensor API Support


Sample CLDC Debugging Session

This procedure provides instructions for running the FPDemo sample project on a device running Windows Mobile. You can use this procedure with any project.

  1. In the Java ME Platform SDK, select File > Open Sample Project > FPDemo.

  2. In the Projects window, right-click on FPDemo and select Properties.

  3. Choose the Platform category. From the Device drop-down menu, select the name of the connected device. Click OK.

  4. Select FPDemo and select Run > Run Project in Debug Mode, or click the Run Main Project in Debug mode icon on the toolbar.

  5. Open a Windows shell.

  6. Start jdb with the following command:

    db -sourcepath installdir\apps\FPDemo\src -connect com.sun.jdi.SocketAttach:hostname=,port=port-number

    In this case the port number is 51307 to match the default debugging port number.

  7. Set the breakpoint at the place where the demo handles its menu commands:

    stop in calculator.CalculatorMIDlet.commandAction

  8. In the FPDemo application, enter two numbers, choose an operation, and invoke the Calc command.

    The debugger displays the place where the execution stops.

  9. To step through the source past the point where the result is calculated, use the next command until you get past the following line:

    res = n1 <op> n2;

  10. Check that the input and the calculated values are correct:

    eval n1, eval n2, eval res

  11. Override the calculated value as follows:

    set res = new-value

  12. Clear the breakpoint as follows:

    clear calculator.CalculatorMIDlet.commandAction

  13. Let the application continue:


    You can see that the application displays the overridden result.

  14. Exit the debugger:


  15. Exit FPDemo.