The diagnostics and tracing functionality provided by Symbian SDKs allows you to monitor the activities of a MIDlet as it is running in an emulator or on a Symbian device. You can monitor the following types of data:
Diagnostic data on the MIDlet's HTTP connections (requests and responses)
Tracing data returned by the MIDlet, for example, system output messages
Tracing data returned by the Java Runtime, for example, MIDlet runtime error messages
The Java Runtime provides the following standard output streams for MIDlets to return tracing data:
Use the System.out
stream to trace the activities of the MIDlet
while it is running. For example, you can set a System.out
event to be triggered when the user selects a certain menu item.
To write a line of output data, use the System.out.println
method.
Use the System.err
stream to display error messages and other important
information. To write a line of output data, use the System.err.println
method.
System.out
and System.err
outputs
are generated both in the emulator and on the device.
To monitor the MIDlet in an emulator:
Run the MIDlet in the emulator. You can run the MIDlet by launching it directly from the emulator, from an IDE integrated with the emulator, or from the command line.
For more information about different launch options, see the SDK documentation.
Open the diagnostics window to access the diagnostics and tracing data for the MIDlet.
Note: Make sure to use the correct SDK release for the device. The SDK platform must support the same Java Runtime version as the device. For example, if you want to monitor the MIDlet on a device with Java Runtime 2.1 or 2.2, use a Symbian^3 SDK.
To monitor the MIDlet on a Symbian device with Java Runtime 2.1 or newer:
Connect the device to your computer. The supported connection types are Bluetooth, USB, and WLAN. For more information about establishing a connection, see the SDK documentation.
Install the EcmtAgent onto the device.
On the device, launch the EcmtAgent, and select the appropriate connection type from Options > Settings > Bearer.
On the computer, launch the Device Connectivity Tool.
In the Device Connectivity Tool, select the correct connection, and click Connect. After the connection is established, the EcmtAgent and Device Connectivity Tool both change their status to "Connected".
Open your IDE, open the MIDlet project, and set the SDK configuration to SymbianDevice.
Launch the MIDlet from the IDE. The MIDlet is installed onto the device, where you can now test it.
Tip: You can also launch the MIDlet from the command line. For more information, see the SDK documentation.
To access the diagnostics and tracing data for the MIDlet, open the diagnostics window from the Device Connectivity Tool by selecting Tools > Diagnostics.
Tip: You can also view the tracing data in the IDE console. If you launched the MIDlet from the command line, the command console also shows the tracing data.
After you have finished testing the MIDlet, close it on the device. The MIDlet is uninstalled from the device.
The following figure shows the diagnostics and tracing setup for Symbian^3 devices.
Figure: Diagnostics and tracing setup for Symbian^3
Note: Make sure to use the correct SDK release for the device. The SDK platform must match the device platform. For example, if you want to monitor the MIDlet on an S60 3rd Edition FP2 device, use an S60 3rd Edition FP2 SDK.
To monitor the MIDlet on an S60 5th Edition device with Java Runtime 1.x, or on an S60 3rd Edition FP2 or earlier device:
Connect the device to your computer. The supported connection types are Bluetooth, USB, and WLAN. For more information about establishing a connection, see the SDK documentation.
Install the EcmtAgent onto
the device. The installation additionally stores the RedMIDlet.jar
file in the installation files folder on the device.
On the device, open the application manager, and install the RedMIDlet.
On the device, launch the EcmtAgent, and select the appropriate connection type from Options > Settings > Bearer.
On the computer, launch the Device Connectivity Tool.
In the Device Connectivity Tool, select the correct connection, and click Connect. After the connection is established, the EcmtAgent and Device Connectivity Tool both change their status to "Connected".
On the device, launch the RedMIDlet. Any tracing data is now redirected to the computer.
Note: Keep the EcmtAgent running in the background.
Open your IDE, open the MIDlet project, and set the SDK configuration to SymbianDevice.
Launch the MIDlet from the IDE. The MIDlet is installed onto the device, where you can now test it.
Tip: You can also launch the MIDlet from the command line. For more information, see the SDK documentation.
To access the diagnostics and tracing data for the MIDlet, open the diagnostics window from the Device Connectivity Tool by selecting Tools > Diagnostics.
Tip: You can also view the tracing data in the IDE console. If you launched the MIDlet from the command line, the command console also shows the tracing data.