On Device Debugging
Since I saw this entry on James Gosling blog (November 04), I have always been puzzled by the ability to debug J2ME application running a mobile phone. Most of the time, you need to do the final debugging on the target device, as emulators are generally more tolerant than the real device. On Device Debugging (ODD) has always been very tricky. For example, in the Digital TV world, some development MHP Set-Top boxes provides some sort of debugging capabilities. It works by connecting a terminal emulator to the STB serial port. This approach is very limited in terms of capabilities; it only provides very few limited JVM observations capabilities. Debugging means you have to run an 'enhanced' version of your application (the same application with a bunch ofSystem.out.println("what the hell am I doing in this method?"); statements. There is no transparent way to easily poke variables. Needless to say that debugging your code, step-by-step, is not an option with that approach.
This also exclude any IDE based debugger integration.
The only positive point about this method is that you may have access to lower level events (ex. signaling information, HW events like smart card removal, etc)
This method is proprietary but does work... it was anyway the only one available. Most of the times, debugging capabilities are disabled on production set-top box.
Before that, it was even worst and more complex. Debugging could only be done on modified STB with some specific hardware hooks (JTAG, PCMCIA, SCSI or some other exotic interfaces). This approach was even more complex but also very fragile. That was really a hack!
So being able to debug J2ME application running on a device from the IDE is really a huge step forward!
For that, you need need NetBeans 4.1, Mobility pack but also the latest Sony Ericsson SDK.
The SE SDK will act as a proxy between the mobile and NetBeans, the connection will be bluetooth based. According the SE SDK release note, it seems that cable, and infrared are also supported. Unfortunately, the SDK release notes clearly says that Symbian based phones do not support ODD! Too bad, as a lot of Java Geeks, I have a SE PE910, which is based on Symbian! So that won't work on my phone! I need to find another phone that support ODD! In fact, only the high-end SE smart phones (PE 910, 900, etc) do not support ODD!
Anyway, I have looked on how to configure NetBeans for this. It looks to be straightforward. To configure NetBeans, you need just need to add the SE SDK as a specific J2ME Java Platform "Tools", "Java Platform Manager", "Add Platform".


Trackback URL: http://blogs.sun.com/delabassee/entry/on_device_debugging
Post a Comment:





And about our last paragraph: The on-device-debugging works beautifully! I am using it with SE J2ME SDK 2.2.0, JDK 1.4.2, netbeans 4.1 over bluetooth. Thanks again for your great explanation :)
Posted by Jake on juillet 09, 2005 at 03:48 PM PDT #