BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-17-2012, 11:12 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2011
Model: 8520
PIN: N/A
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.

Thanks,
Saranya
Offline  
Old 02-20-2012, 07:38 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
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.
Offline  
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 06:43 AM
Emergency contacts list question a_kayaker BES Admin Corner 2 11-07-2008 11:23 AM
Another Activating Initializing on BB Professional patrickd26 BES Admin Corner 4 05-06-2008 05:12 AM
Blackberry 9000 and OS 5.0 info on BGR John Clark General 9000 Series Discussion - Bold 46 02-20-2008 11:35 PM
BES 4.1 SP2 for Microsoft Exchange - Now Available jibi BES Admin Corner 51 01-10-2007 09:30 AM





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