Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0, Mac OS

Get PDF Book Print View

Document Information

Getting Started


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

Network Monitoring

Lightweight UI Toolkit

Security and MIDlet Signing

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator (Windows Only)

On-device Debugging

On-device Debugging Procedure

Wireless 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

JSR 180: SIP Communications

JSR 184: Mobile 3D Graphics

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 226: Scalable 2D Vector Graphics

JSR 229: Payment API Support

JSR 238: Mobile Internationalization API (MIA)

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 CLDC 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 terminal window.
  6. Start jdb with the following command:


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

    Mac OS

    jdb -sourcepath installdir/Contents/Resources/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 pass the following line:

    res = n1 <op> n2;

    Type next to continue.

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

    eval n1

    eval n2

    eval n

  11. Override the calculated value as follows:

    set res = new-value

    Type next to continue.

  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.
Related Information