This procedure provides instructions for running the FPDemo sample project on a device running Windows Mobile. You can use this procedure with any project.
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 Project in Debug Mode, or click the Run Main Project in Debug mode icon on the toolbar.
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
In this case the port number is 51307 to match the default debugging 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: