BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-18-2012, 12:12 AM   #1
saranyassr
Knows Where the Search Button Is
 
Join Date: Jul 2011
Model: 8520
PIN: N/A
Carrier: airtel
Posts: 17
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, 08:38 AM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
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  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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 1623 06-30-2022 04:06 PM
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 05: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


DELL PowerEdge R310 Server picture

DELL PowerEdge R310 Server

$80.00



EMC2 HPE-S HPES Server picture

EMC2 HPE-S HPES Server

$465.00



Canon imagePRESS Server B5100 picture

Canon imagePRESS Server B5100

$1199.00



Riverbed Steelhead Server SHA-01050-H Model:1UABA picture

Riverbed Steelhead Server SHA-01050-H Model:1UABA

$135.00



USED Moxa NPort5610-16 16-port RS-232 Serial Communication Server picture

USED Moxa NPort5610-16 16-port RS-232 Serial Communication Server

$284.58



Server - 92020 - Double Dip Server picture

Server - 92020 - Double Dip Server

$348.84







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