The most efficient way to debug on a Blackberry device?

I'm looking for the fastest and most efficient way to debug my Java application for BlackBerry.

I noticed that it remains forever to connect the debugger to the device using the 9800 torch in my case. Should I pin it every time I make changes to my code, or is there a better way?

I also noticed that on the console, the device seems to be printing a lot of things on which I don't care. Sifting through all of this can really be a pain. Is there a way to see only the material related to my application in the console, namely only the ones that I print on it myself?

+7
source share
2 answers
  • The Eclipse debugger and profiler are, in most cases, the best solution, but in some cases it does not help to figure out what is the source of the problem.

  • Logging to the internal device through the EventLogger class. As an option, if there is a huge amount of data - an external text file located on the device board (not the device’s internal file system).

  • Using the console output window. Unfortunately, there is no way to apply a filter to the console output, but there is a way to simplify working with the console. Add a sequence of characters at the beginning of the debug messages to distinguish debug prints from system ones. For example,

    System.out.println ("!!!!!!!!!!!!!!!!!!!!!!!!! myVar value =" + myVar);

Or so:

System.out.println("#############################################"); System.out.println("############# object1: " + object1); System.out.println("############# object2: " + object2); System.out.println("############# object3: " + object3); System.out.println("#############################################"); 

When a large amount of debugging data in the console simply copies all the console text to a text editor, for example Notepad ++, and we work with it there.

+8
source

Yes, the debugger on most modern simulators takes forever to attach. The higher the simulator, the longer it takes. I usually do the following:

  • Try to do heavy debugging in the old simulator (often 83xx).
  • If this is not possible, run the simulator and do not close it. This hot swap feature is only available for 5.0 in the BlackBerry eclipse plugin.
  • Thanks to the hot swap, you can start the simulator (with the launch configuration), and then click the debug button. This is much faster than starting debugging from the start.
  • When working with old versions of the eclipse plugin, where hot-swapping is not available, or coding for OS 5.0, launch the simulator with eclipse and start, then open the RIM JDE (yes, this old-fashioned RIM version of the Java IDE) and postpone the debugger from there (menu Debug -> Attach to -> simulator). You cannot stop at breakpoints, but you can see the output of the text. JDE does not come with the eclipse plugin, you must download and install it yourself.
+5
source

All Articles