BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-14-2007, 11:35 AM   #1 (permalink)
New Member
 
Join Date: Jun 2007
Model: 7390
PIN: N/A
Carrier: verizon
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default PushScreen Issue

Please Login to Remove!

I am encountering some weird behaviour of the PushScreen method in the UI class.First and foremost, what could be a simple reason for PushScreen to not push the user screen on to the UI stack and also not throw an exception (saying it was not able to Push Screen). I am having a hard time debugging this issue as the pushscreen is being called and it doesnot throw any exception and passes succesfully without pushing my screen on the stack
One point to be noted here is that , the situation arises only after i get a Time out exception/ IOException in the my Connection class which i will explain it further.

I am aware of the fact that Blackberry uses a single thread to do its UI processing and it should not be blocked and I am taking care of it.
. Currently our architecture is such a way that we constantly need to be connected to the server and there is a two way communication going on between the server and the BBclient.

I have a seperate thread for receiving data from the server and the Send thread is inner class of the Recieve Thread. In my exception handling of the receive thread whenever i get a IOException
1)Connection Refused ( i do the needful)
2)exceeded the limit of number of bytes allowed per connection ( i do the needful)
3)Any other exception (connection time out /I get an empty exception message too ( I am not sure what this means , do you know what it could be ) - In this case , i set my boolean for resetting the recieve thread , so what i do is -
A) I have a stop method inside the Recieve thread which closes and notifies , StreamConnection obj ,DataInputStream obj etc (.close and .notify)
B) start the thread.

Can some one tell me whats going on ??? I would really appreciate if you could tell me what is the best way to debug such an issue is, any pointers would be helpful. Any help is appreciated

It starts working fine if i quit the application and come back. I have System.exit() call in my Close application which clears up all the threads and hence works fine. But again after sometime if i get any of the IO exception it stops pushing on to the screen.

I have also noticed this sometimes, even after getting the Exception , after some time (maybe a minute or so) if i try to run the same scenario it works fine, but its just too flaky currently.
Offline  
Old 06-14-2007, 12:08 PM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm building an application that sounds very similar to yours. The only time I've ever seen a push screen not push and no exception happen is when:
-You push a screen to the display
-While it's rendering (could be a while if you have alot of objects, I've seen 30 seconds for 1200 labelfields) you try and push another screen

I've locked up the application this way and had many screaming arguments with the wall until I figured out that they don't synchronize the pushThread such that requests are turned away in the case of an ongoing paint. I refactored to make sure that the subproceses calling the push lock before starting and unlock after ending to ensure a serialized thread.
Offline  
Old 06-14-2007, 06:44 PM   #3 (permalink)
New Member
 
Join Date: Jun 2007
Model: 7390
PIN: N/A
Carrier: verizon
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am a not sure if in my case rendering is the issue , since i dont have many ui components. I had few images , i removed those and the issue still persist. The problem is somewhere related to the issue when i get time out exceptions in the readbyte (when i am reading the input data). If i dont get any time out exceptions i am perfectly fine with the pushscreen , its only when this occurs.

So how do you handle your time out ??, i believe - 1) nullify the recieve thread , 2) connection.close 3) in.close 4) out.close.
Offline  
Old 06-15-2007, 06:11 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

maybe just paste the code and it'd be easier to debug.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.