hartti | 18 October, 2006 19:42
There is a document on Forum Nokia web site describing how to redirect the System.out and System.err on newer S60 phones. I dawned only recently to me that this similar functionality is quite easy to achieve on Series 40 phones.
By "debug" I simply mean here that one can see the System.out stream on a connected PC while running your midlet on Series 40 handset. I have not yet had time find out for sure which handsets support this, but works at least on newest handsets like 5300.
How did I got it working? I first installed PC Suite on my PC (yes, running Windows here). I also created a test midlet printing messages during execution with System.out.println() and installed it on my handset.
Then I connected the phone with a USB cable (selected the mode to be the default) and waited the corresponding drivers to be installed. I went on to check from the PC Device manager what was the com port assigned to my phone.
"Control Panel -> System -> Hardware -> Device Manager -> Ports (COM & LPT). You should see something like: "Nokia GSM Phone USB" there.
Select Properties -> Port Settings -> Advanced. The port should be something between COM1 and COM10 for the Terminal program to be able to access it. Change it if necessary."
If you changed the port it is always a good idea to disconnect the phone and reconnect it, to make sure the port change is updated.
Open a terminal program and connect to that port. HyperTerminal works, but the output gets messy with the linefeeds. Instead you could use some other, more configurable terminal program, like Terminal.
Run your midlet and enjoy the stream of messages displaying on the terminal screen.
Java, Series 40 |
Permalink |
Comments (11) |
Trackbacks (0)