What is System.out and System.err redirection?

The SDK provides the possibility to view on the PC the System.out and System.err streams used by a MIDlet running on a phone with the help of the Device Connectivity Tool. All necessary settings to enable the feature are described in Setting up system.out and system.err redirection. The ability to view System.out and System.err streams on the PC provides additional means of MIDlet debugging on a real S60 device.

System.out and System.err streams, which are written to by a MIDlet under a test, are captured by a special redirector MIDlet running simultaneously with the MIDlet being tested. The redirector MIDlet sends the data using the PC connectivity Symbian application and a Bluetooth connection to the Device Connectivity tool running on a PC (see Starting the Device Connectivity Tool on your PC). System.out and System.err streams are delivered to the redirector MIDlet in chunks of approximately 110 symbols. Therefore, shorter strings are not immediately seen in the Diagnostics window (see Introduction to Diagnostics window), but are held in the buffer. Right after start-up the redirector MIDlet sends a “Redirector MIDlet: redirection is started” message to the diagnostics window.

The figure below shows the Diagnostics window of the Device Connectivity tool running on a PC. System.err and System.out printouts are seen in the SystemOut part of the window.

Figure 63: Device Connectivity tool, Diagnostics view with System.out printouts