BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 02-18-2012, 12:12 AM   #1 (permalink)
Knows Where the Search Button Is
Join Date: Jul 2011
Model: 8520
Carrier: airtel
Posts: 17
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default Coverage info api return wrong results in 5.0 os version

Please Login to Remove!

Hi All,

I want to check internet connection status in device. Whether wifi or gprs enabled in the device, my check need to ensure that network is available or not.
So I used the following code to check status

private boolean getConnectionStatus() {

String value = "";
if (CoverageInfo.isOutOfCoverage()) {
// Dialog.alert("No Internet Coverage. Enable Internet And Try Again");
//Logger.getInstance().writeToLogger("No Internet Coverage. Enable Internet And Try Again");
return false;

} else if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
// Dialog.alert("Wireless Found");
//Logger.getInstance().writeToLogger("Wireless Found");
value = "interface=wifi";
return true;

} else if (CoverageInfo.getCoverageStatus() == CoverageInfo.COVERAGE_DIRECT) {
// Dialog.alert("Coverage Direct");
//Logger.getInstance().writeToLogger("Coverage Direct");
value = "deviceside=true";
return true;

return false;

It's working fine in 4.5 and 6.0 os versions. But in 5.0 version getting result as connection is not available, even device have it.

It's looking strange. Working fine in one but not in other.

Pls help me in this regard.

Old 02-20-2012, 08:38 AM   #2 (permalink)
BlackBerry Extraordinaire
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: Coverage info api return wrong results in 5.0 os version

I believe that if you look closely at the return value for CoverageInfo.getCoverageStatus(), you will see that this method returns a "bitmapped" value.

In other words, your use of '==' to determine the active coverage type(s) is incorrect - you need to use a bitwise boolean operation.
The Following User Says Thank You to Dougsg38p For This Useful Post:
saranyassr (03-14-2012)
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

Similar Threads for: Coverage info api return wrong results in 5.0 os version
Thread Thread Starter Forum Replies Last Post
Losing Call Logs, SMS or Emails? Optimize your BB! How To Setup for max free memory! John Clark BlackBerry Help 1620 12-31-2012 07:43 AM
Emergency contacts list question a_kayaker BES Admin Corner 2 11-07-2008 12:23 PM
Another Activating Initializing on BB Professional patrickd26 BES Admin Corner 4 05-06-2008 06:12 AM
Blackberry 9000 and OS 5.0 info on BGR John Clark General 9000 Series Discussion - Bold 46 02-21-2008 12:35 AM
BES 4.1 SP2 for Microsoft Exchange - Now Available jibi BES Admin Corner 51 01-10-2007 10:30 AM

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