Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 8
Registered: ‎06-13-2014
My Device: 8520
My Carrier: vodafone

Debug issues with Multiple threads



In my applications i have multiple threads which trys to polls continously from server for certain time interval  to retrive information. while debuging the device gets freezed sometimnes so i need to restart the application by disconnection device and connecting again. is there any better way to debug multiple threads without getting device freezed.


Model : 8520

OS : 5.0

Abhijeet Singh
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Debug issues with Multiple threads

[ Edited ]

Let me start by suggesting, as I am sure that anyone you have talked to has, that you don't poll.  Use push to send data to the device when it is updated, don't poll to find out that it hasn't been.  Polling wastes battery and potentially uses up a load of data.


But looking at your problem, in general, reading data from the Server does not cause the device to freeze.  However the connection can 'freeze' and then take two minutes to timeout, so perhaps this is your problem. 


Alternatively, you might have some interaction between your Threads that causes a problem.   


Or you might have exception being thrown that you don't know about, and this causes your procesing to fail.  Check the device log (ALT LGLG) or debug log to see these.  However if you are debugging at the time, as the question suggests, then you will get presented with this exception, so I am not sure that this is your problem. 


The best thing to do is to add some logging in your application to make sure you know exactly what all your Threads are doing at any time and can therefore track the circumstances that causes this freeze.


Beyond that, I am not sure we can help much with the information provided.