Welcome!

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

Reply
Developer
dmglakewood
Posts: 296
Registered: ‎12-07-2008
My Device: Not Specified
Accepted Solution

I'm having an issue with internet connection

[ Edited ]

I have a script that runs in the background and connects to the internet every now and then. Everything works fine until the user has no signal ot they are on the phone etc when the script is trying to access the internet. I have it wrapped in a try / catch and I'm also checking the connection using this code

if(httpConn.getResponseCode() == HttpConnection.HTTP_OK){

 

 

 

For some reason even though it doesn't have a connection it still tries to run the script and eventually it will thorw an error. Is there any other way to see if the connection is not active or can't be accessed? 

Message Edited by dmglakewood on 05-26-2009 12:31 AM
Developer
Ted_Hopp
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: I'm having an issue with internet connection

Take a look at the CoverageInfo class.



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Developer
dmglakewood
Posts: 296
Registered: ‎12-07-2008
My Device: Not Specified

Re: I'm having an issue with internet connection

I couldn't get accurate results using the coverageinfo, I tried using RadioInfo and it works perfectly though. Thanks for the help