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


Java SignalStrength.getEvdoDbm方法代碼示例

本文整理匯總了Java中android.telephony.SignalStrength.getEvdoDbm方法的典型用法代碼示例。如果您正苦於以下問題:Java SignalStrength.getEvdoDbm方法的具體用法?Java SignalStrength.getEvdoDbm怎麽用?Java SignalStrength.getEvdoDbm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.telephony.SignalStrength的用法示例。


在下文中一共展示了SignalStrength.getEvdoDbm方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onSignalStrengthsChanged

import android.telephony.SignalStrength; //導入方法依賴的package包/類
/**
 *  Description:  TODO: add more info
 *
 *  Issues:
 *
 *      [ ]     Getting and comparing signal strengths between different RATs can be very
 *              tricky, since they all return different ranges of values. AOS doesn't
 *              specify very clearly what exactly is returned, even though people have
 *              a good idea, by trial and error.
 *
 *              See note in : SignalStrengthTracker.java
 *
 *  Notes:
 *
 *
 *
 */
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
    // Update Signal Strength
    if (signalStrength.isGsm()) {
        int dbm;
        if (signalStrength.getGsmSignalStrength() <= 2 ||
                signalStrength.getGsmSignalStrength() == NeighboringCellInfo.UNKNOWN_RSSI) {
            // Unknown signal strength, get it another way
            String[] bits = signalStrength.toString().split(" ");
            dbm = Integer.parseInt(bits[9]);
        } else {
            dbm = signalStrength.getGsmSignalStrength();
        }
        mDevice.setSignalDbm(dbm);
    } else {
        int evdoDbm = signalStrength.getEvdoDbm();
        int cdmaDbm = signalStrength.getCdmaDbm();

        // Use lowest signal to be conservative
        mDevice.setSignalDbm((cdmaDbm < evdoDbm) ? cdmaDbm : evdoDbm);
    }
    // Send it to signal tracker
    signalStrengthTracker.registerSignalStrength(mDevice.mCell.getCID(), mDevice.getSignalDBm());
    //signalStrengthTracker.isMysterious(mDevice.mCell.getCID(), mDevice.getSignalDBm());
}
 
開發者ID:5GSD,項目名稱:AIMSICDL,代碼行數:42,代碼來源:CellTracker.java

示例2: onSignalStrengthsChanged

import android.telephony.SignalStrength; //導入方法依賴的package包/類
/**
 *  Description:  TODO: add more info
 *
 *  Issues:
 *
 *      [ ]     Getting and comparing signal strengths between different RATs can be very
 *              tricky, since they all return different ranges of values. AOS doesn't
 *              specify very clearly what exactly is returned, even though people have
 *              a good idea, by trial and error.
 *
 *              See note in : SignalStrengthTracker.java
 */
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
    // Update Signal Strength
    if (signalStrength.isGsm()) {
        int dbm;
        if (signalStrength.getGsmSignalStrength() <= 2 ||
                signalStrength.getGsmSignalStrength() == NeighboringCellInfo.UNKNOWN_RSSI) {
            // Unknown signal strength, get it another way
            String[] bits = signalStrength.toString().split(" ");
            dbm = Integer.parseInt(bits[9]);
        } else {
            dbm = signalStrength.getGsmSignalStrength();
        }
        device.setSignalDbm(dbm);
    } else {
        int evdoDbm = signalStrength.getEvdoDbm();
        int cdmaDbm = signalStrength.getCdmaDbm();

        // Use lowest signal to be conservative
        device.setSignalDbm((cdmaDbm < evdoDbm) ? cdmaDbm : evdoDbm);
    }
    // Send it to signal tracker
    signalStrengthTracker.registerSignalStrength(device.cell.getCellId(), device.getSignalDBm());
    //signalStrengthTracker.isMysterious(device.cell.getCid(), device.getSignalDBm());
}
 
開發者ID:anticomarley,項目名稱:Android-IMSI-Catcher-Detector,代碼行數:37,代碼來源:CellTracker.java

示例3: onSignalStrengthsChanged

import android.telephony.SignalStrength; //導入方法依賴的package包/類
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
	super.onSignalStrengthsChanged(signalStrength);
	String sim = UEDevice.getSimType(activity);
	mNavigationView.setSingalText(sim);
	if (sim.equals("無服務")) {
		mNavigationView.setSingalStatus(UISingalView.STATUS_NONE);
		return;
	}
	mNavigationView.setSingalStatus(UISingalView.STATUS_NORMAL);
	int level = 0;
	if (signalStrength.isGsm()) {
		level = signalStrength.getGsmSignalStrength();
	}else {
		if (sim.equals("中國電信")) {
			level = signalStrength.getCdmaDbm();
		}else {
			level = signalStrength.getEvdoDbm();
		}
	}
	if (level == 0) {
		mNavigationView.setSignal(5);
		return;
	}
	if (level < -112) {
		mNavigationView.setSignal(0);
	}else if (level >= -111 && level < -104) {
		mNavigationView.setSignal(1);
	}else if (level >= -104 && level < -97) {
		mNavigationView.setSignal(2);
	}else if (level >= -97 && level < -90) {
		mNavigationView.setSignal(3);
	}else if (level >= -90 && level < -83) {
		mNavigationView.setSignal(4);
	}else {
		mNavigationView.setSignal(5);
	}
}
 
開發者ID:Soniy7x,項目名稱:Auie,代碼行數:39,代碼來源:UENavigationActivity.java

示例4: onSignalStrengthsChanged

import android.telephony.SignalStrength; //導入方法依賴的package包/類
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
    super.onSignalStrengthsChanged(signalStrength);

    if (isRegistered) {
        int level = signalStrength.getGsmSignalStrength();

        if (level > 4) level /= 7.75;
        else if (level < 1) {
            int strength = signalStrength.getCdmaDbm();

            if (strength < -100) level = 0;
            else if (strength < -95) level = 1;
            else if (strength < -85) level = 2;
            else if (strength < -75) level = 3;
            else if (strength != 0) level = 4;
            else {
                strength = signalStrength.getEvdoDbm();

                if (strength == 0 || strength < -100) level = 0;
                else if (strength < -95) level = 1;
                else if (strength < -85) level = 2;
                else if (strength < -75) level = 3;
                else level = 4;
            }
        }

        onDrawableUpdate(level);
    }
}
 
開發者ID:TheAndroidMaster,項目名稱:Status,代碼行數:31,代碼來源:DualNetworkIconData.java

示例5: onSignalStrengthsChanged

import android.telephony.SignalStrength; //導入方法依賴的package包/類
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
    // TODO Auto-generated method stub
    super.onSignalStrengthsChanged(signalStrength);
    gsmSignal = signalStrength.getGsmSignalStrength();
    cdmaDbm  = signalStrength.getCdmaDbm();
    evdoDbm = signalStrength.getEvdoDbm();
}
 
開發者ID:greenhub-project,項目名稱:batteryhub,代碼行數:9,代碼來源:SignalListener.java


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