本文整理汇总了Java中net.rim.device.api.system.RadioInfo类的典型用法代码示例。如果您正苦于以下问题:Java RadioInfo类的具体用法?Java RadioInfo怎么用?Java RadioInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RadioInfo类属于net.rim.device.api.system包,在下文中一共展示了RadioInfo类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: updateTransportCoverageAvailability
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
/**
* Updates transport coverage availability.
*/
private void updateTransportCoverageAvailability() {
// reset cached availability
_availableTransportCoverage = 0;
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_3GPP
| RadioInfo.WAF_CDMA | RadioInfo.WAF_IDEN, false)) {
_availableTransportCoverage |= TransportDetective.TRANSPORT_TCP_CELLULAR;
_availableTransportCoverage |= TransportDetective.TRANSPORT_WAP2;
_availableTransportCoverage |= TransportDetective.TRANSPORT_WAP;
}
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)) {
_availableTransportCoverage |= TransportDetective.TRANSPORT_BIS_B;
}
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS)) {
_availableTransportCoverage |= TransportDetective.TRANSPORT_MDS;
}
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_WLAN,
false)) {
_availableTransportCoverage |= TransportDetective.TRANSPORT_TCP_WIFI;
}
updateTransportServiceAvailability();
_availableTransportCoverage &= _availableTransportServices;
}
示例3: updateTransportCoverageAvailability
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
/**
* Updates transport coverage availability.
*/
private void updateTransportCoverageAvailability() {
// reset cached availability
// In 3G network it works...
_availableTransportCoverage = 0;
// Required for 2G networks
int _coverageStatus = CoverageInfo.getCoverageStatus();
if ((_coverageStatus & COVERAGE_DIRECT) > 0
|| CoverageInfo.isCoverageSufficient(COVERAGE_DIRECT, RadioInfo.getSupportedWAFs(), false)) {
_availableTransportCoverage |= TRANSPORT_TCP_CELLULAR;
_availableTransportCoverage |= TRANSPORT_WAP2;
_availableTransportCoverage |= TRANSPORT_WAP;
}
if ((_coverageStatus & CoverageInfo.COVERAGE_BIS_B) > 0
|| CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)
|| CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B, RadioInfo.getSupportedWAFs(), false)) {
_availableTransportCoverage |= TRANSPORT_BIS_B;
}
if ((_coverageStatus & CoverageInfo.COVERAGE_MDS) > 0
|| CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS)
|| CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS, RadioInfo.getSupportedWAFs(), false)) {
_availableTransportCoverage |= TRANSPORT_MDS;
}
if (CoverageInfo.isCoverageSufficient(COVERAGE_DIRECT, RadioInfo.WAF_WLAN, false)) {
_availableTransportCoverage |= TRANSPORT_TCP_WIFI;
}
updateTransportServiceAvailability();
_availableTransportCoverage &= _availableTransportServices;
}
示例4: 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);
}
示例5: hasWifi
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
private static boolean hasWifi() {
return (RadioInfo.getActiveWAFs() & RadioInfo.WAF_WLAN) != 0
&& CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_WLAN, true);
}
示例6: test
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
public static boolean test() {
return RadioInfo.isDataServiceOperational() || Network.hasWifi() || Network.hasSignal();
}
示例7: isCellularDataServiceSupported
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
/**
* Determines if Data Service is enabled via Cellular radio.
*
* @return <b>true</b> if enabled. <b>false</b> otherwise.
*/
public boolean isCellularDataServiceSupported() {
return ((RadioInfo.getSupportedWAFs() & (RadioInfo.WAF_3GPP | RadioInfo.WAF_CDMA | RadioInfo.WAF_IDEN)) > 0);
}
示例8: isWifiSupported
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
/**
* Determines if WiFi is supported.
* @return <b>true</b> if enabled. <b>false</b> otherwise.
*/
private boolean isWifiSupported() {
return ( (RadioInfo.getSupportedWAFs() & RadioInfo.WAF_WLAN) > 0 );
}
示例9: isCellularDataServiceSupported
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
/**
* Determines if Data Service is enabled via Cellular radio.
*
* @return <b>true</b> if enabled. <b>false</b> otherwise.
*/
public boolean isCellularDataServiceSupported() {
return (RadioInfo.getSupportedWAFs() & (RadioInfo.WAF_3GPP | RadioInfo.WAF_CDMA | RadioInfo.WAF_IDEN)) > 0;
}
示例10: isWifiSupported
import net.rim.device.api.system.RadioInfo; //导入依赖的package包/类
/**
* Determines if WiFi is supported.
*
* @return <b>true</b> if enabled. <b>false</b> otherwise.
*/
private boolean isWifiSupported() {
return (RadioInfo.getSupportedWAFs() & RadioInfo.WAF_WLAN) > 0;
}