本文整理汇总了Java中net.rim.device.api.system.RadioInfo.getState方法的典型用法代码示例。如果您正苦于以下问题:Java RadioInfo.getState方法的具体用法?Java RadioInfo.getState怎么用?Java RadioInfo.getState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.rim.device.api.system.RadioInfo
的用法示例。
在下文中一共展示了RadioInfo.getState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBestTransportForActiveCoverage
import net.rim.device.api.system.RadioInfo; //导入方法依赖的package包/类
public int getBestTransportForActiveCoverage() {
int availableTransports = getAvailableTransportCoverage();
int iCurTransport = -1;
if ((availableTransports & TransportDetective.TRANSPORT_TCP_WIFI) > 0) {
iCurTransport = TransportDetective.TRANSPORT_TCP_WIFI;
} else if (RadioInfo.getState() == RadioInfo.STATE_ON
&& RadioInfo.getSignalLevel() != RadioInfo.LEVEL_NO_COVERAGE) {
if ((availableTransports & TransportDetective.TRANSPORT_MDS) > 0) {
iCurTransport = TransportDetective.TRANSPORT_MDS;
} else if ((availableTransports & TransportDetective.TRANSPORT_BIS_B) > 0) {
iCurTransport = TransportDetective.TRANSPORT_BIS_B;
}
if (iCurTransport == -1 && ((availableTransports & TransportDetective.TCP_CELLULAR_APN_SERVICE_BOOK) > 0)) {
iCurTransport = TransportDetective.TCP_CELLULAR_APN_SERVICE_BOOK;
} else if (iCurTransport == -1 && ((availableTransports & TransportDetective.TRANSPORT_TCP_CELLULAR) > 0)) {
iCurTransport = TransportDetective.TRANSPORT_TCP_CELLULAR;
}
}
return iCurTransport;
}
示例2: hasSignal
import net.rim.device.api.system.RadioInfo; //导入方法依赖的package包/类
private static boolean hasSignal() {
return !(RadioInfo.getState() == RadioInfo.STATE_OFF
|| RadioInfo.getSignalLevel() == RadioInfo.LEVEL_NO_COVERAGE);
}