Blackberry is notified when an internet connection is available.

is there any way to know if network is connected or not in blackbery device. I have the following code, but it was waiting for the network to close.

int rc = connection.getResponseCode();
if (rc != HttpConnection.HTTP_OK) {
 throw new IOException("HTTP response code: " + rc);
}

      

Is there another way.

+2


source to share


2 answers


The title of this question has a different meaning than the body of the question. Based on the header, you can be notified when the network starts using the RadioStatusListener interface, which defines the networkStarted () function. You can then use the checks that cold recommends to make sure your current network supports data transfer.



RadioStatusListner JavaDocs

+4


source


There are several APIs for getting information about the network:



RadioInfo.isDataServiceOperational();
CoverageInfo.isOutOfCoverage();
WLANInfo.getWLANState();

      

+3


source







All Articles