Viewing and Editing Project Properties
Running Projects in the Emulator
Searching the WURFL Device Database
Finding Files in the Multiple User Environment
CLDC Emulation on a Windows Mobile Device
Installing CLDC Emulation on a Windows Mobile Emulator
Attach a Command Line Debugger
JSR 82: Bluetooth and OBEX Support
JSR 135: Mobile Media API Support
JSR 177: Smart Card Security (SATSA)
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)
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:
clear calculator.CalculatorMIDlet.commandAction
Let the application continue:
cont
You can see that the application displays the overridden result.
Exit the debugger:
exit
Exit FPDemo.