BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-03-2007, 12:12 PM   #1 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Unhandled Exception: Application Not Responding in Socket app

Please Login to Remove!

I've written a socket app using the best examples from the JDK and this forum. The application is fairly basic. On a screen I have a few label fields. In a thread I establish a socket connection, and whenever the server pushes me data (every 3 seconds) I use it to update the labels. Very basic monitoring app.

It runs great in the simulator. However, on the Blackberry itself (8300, AT&T), it makes a connection, does get a bit of data, then throws an "Unhandled Exception: Application Not Responding". I can't figure out what I'm doing wrong. Any pointers on where I might start looking?

For what it's worth, I'm not closing this socket. It's a live monitoring app. Most examples show reading data, then shutting the connection down. In my thread, once I make the connection, I leave it open and just keep calling/blocking on read(). I don't see why this would be an issue, though. The main UI thread seems to keep running just fine, and I can hit the menu button and see my custom menu there.
Offline  
Old 10-03-2007, 03:45 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2005
Model: 8830
Carrier: Verizon
Posts: 144
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

One problem might be expecting the connection to remain open indefinitely. You may want to think about what's going to happen when users pop in and out of coverage areas. It might be better if the app on the BB requests the data when it knows its in coverage.

Have you split your app into two pieces? One piece that's the UI, and the other that can run constantly in the background as your socket listener?

fbrimm
Offline  
Old 10-03-2007, 10:15 PM   #3 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by fbrimm View Post
One problem might be expecting the connection to remain open indefinitely. You may want to think about what's going to happen when users pop in and out of coverage areas. It might be better if the app on the BB requests the data when it knows its in coverage.

Have you split your app into two pieces? One piece that's the UI, and the other that can run constantly in the background as your socket listener?
I haven't done that yet mostly because I never even get close to the opportunity to have that problem. The application usually crashes within 3-8 seconds after starting. I'll consider it for the future, though, thanks.

So odd that it works PERFECTLY in the simulator.
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.