當前位置: 首頁>>代碼示例>>Java>>正文


Java RadioInfo類代碼示例

本文整理匯總了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;
    }
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:25,代碼來源:TransportDetective.java

示例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;

}
 
開發者ID:yanex,項目名稱:vika,代碼行數:29,代碼來源:TransportDetective.java

示例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;

}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:38,代碼來源:TransportDetective.java

示例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);
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:5,代碼來源:Network.java

示例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);
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:5,代碼來源:Network.java

示例6: test

import net.rim.device.api.system.RadioInfo; //導入依賴的package包/類
public static boolean test() {
    return RadioInfo.isDataServiceOperational() || Network.hasWifi() || Network.hasSignal();
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:4,代碼來源:Network.java

示例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);
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:9,代碼來源:TransportDetective.java

示例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 );
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:8,代碼來源:TransportDetective.java

示例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;
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:9,代碼來源:TransportDetective.java

示例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;
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:9,代碼來源:TransportDetective.java


注:本文中的net.rim.device.api.system.RadioInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。