This procedure provides instructions for running the FPDemo sample project on a device running Windows Mobile.
Before starting this procedure:
Integrate the device as described in CLDC Emulator Installation for a Device Running Windows Mobile.
Confirm the device is connected and that it appears in the Device Selector window.
If the output console is not visible, select Window > Output > Output to open it.
This procedure features command line debugging, but you can use a graphical debugger in a similar fashion.
In the Java ME Platform SDK, select File > Open Sample Project > FPDemo.
In the Projects window, right-click on FPDemo and select Properties.
Choose the Platform category. From the Device drop-down menu, select the name of the connected device. Click OK.
Select FPDemo and select Run > Run in Debug Mode, or click the corresponding icon on the toolbar.
The application is now deployed and started on the connected device.
Note the Port number displayed in the Output console.
Open a Windows shell.
Start jdb with the following command:
db -sourcepath installdir\apps\FPDemo\src -connect com.sun.jdi.SocketAttach:hostname=127.0.0.1,port=port-number
Set the breakpoint at the place where the demo handles its menu commands:
stop in calculator.CalculatorMIDlet.commandAction
In the FPDemo application, enter two numbers, choose an operation, and invoke the Calc command.
The debugger displays the place where the execution stops.
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;
Check that the input and the calculated values are correct:
eval n1, eval n2, eval res
Override the calculated value as follows:
set res = new-value
Clear the breakpoint as follows:
Let the application continue:
You can see that the application displays the overridden result.
Exit the debugger: