本文整理匯總了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);
}