BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   RadioInfo.isDataServiceOperational (http://www.blackberryforums.com/developer-forum/101477-radioinfo-isdataserviceoperational.html)

Thomas Shek 10-24-2007 06:28 AM

RadioInfo.isDataServiceOperational
 
Hi,

From 4.2.0, there is two new method in RadioInfo called isDataServiceOperational() and isDataServiceSuspended().

I have tried to turn off data services in Options -> Mobile Network, but isDataServiceOperational() still return true, and isDataServiceSuspended() still return false.

I would like to know how the setting can be obtained, or is it a way to determine whether the handheld have data service or not... here is my code for 4.2.0 :

return ((RadioInfo.getState()==RadioInfo.STATE_ON) &&
(RadioInfo.getNetworkType() == RadioInfo.NETWORK_GPRS) &&
((RadioInfo.getNetworkService() & RadioInfo.NETWORK_SERVICE_DATA) != 0) &&
(RadioInfo.getSignalLevel()!=RadioInfo.LEVEL_NO_CO VERAGE) &&
(RadioInfo.isDataServiceOperational()) &&
(!RadioInfo.isDataServiceSuspended())
);

It returns true even if there is no SIMCARD inserted, i.e. data service won't be available.

Can anyone point out my problem ??

Thanks
Thomas

RemyJ 10-24-2007 09:49 AM

I wasn't able to get it to report properly either. Have a look at CoverageInfo. It seems to be a little more reliable.

Thomas Shek 10-24-2007 09:48 PM

Thank you RemyJ, CoverageInfo works in this case, my updated code is
Code:

        return ((RadioInfo.getState()==RadioInfo.STATE_ON) &&
                (RadioInfo.getNetworkType() == RadioInfo.NETWORK_GPRS) &&
                ((RadioInfo.getNetworkService() & RadioInfo.NETWORK_SERVICE_DATA) != 0) &&
                ((RadioInfo.getNetworkService() & RadioInfo.NETWORK_SERVICE_EMERGENCY_ONLY) == 0) &&
                (RadioInfo.getSignalLevel()!=RadioInfo.LEVEL_NO_COVERAGE) &&
                (RadioInfo.isDataServiceOperational()) &&
                (!RadioInfo.isDataServiceSuspended()) &&
                (!CoverageInfo.isOutOfCoverage())
              );



All times are GMT -5. The time now is 03:20 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.