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