«

android手机 - 关于信号强度的问题

时间:2024-3-2 19:35     作者:韩俊     分类: Android


信号强度:

信号通常以dBm作为度量单位,dBm是每毫瓦特的电磁波产生的功率。


-60dBm接近完美,-112dBm很容易掉线,-87dBm以上安卓手机会显示满格的信号强度。


从android5.0分析:

信号强度与手机信号格数的转化:

CellSignalStrengthGsm.java

private static final int GSM_SIGNAL_STRENGTH_GREAT = 12;
private static final int GSM_SIGNAL_STRENGTH_GOOD = 8;
private static final int GSM_SIGNAL_STRENGTH_MODERATE = 5;

@Override
public int getLevel() {
int level;
// ASU ranges from 0 to 31 - TS 27.007 Sec 8.5
// asu = 0 (-113dB or less) is very weak
// signal, its better to show 0 bars to the user in such cases.
// asu = 99 is a special case, where the signal strength is unknown.
int asu = mSignalStrength;
if (asu <= 2 || asu == 99) level = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; //无信号或无法识别
else if (asu >= GSM_SIGNAL_STRENGTH_GREAT) level = SIGNAL_STRENGTH_GREAT;
else if (asu >= GSM_SIGNAL_STRENGTH_GOOD) level = SIGNAL_STRENGTH_GOOD;
else if (asu >= GSM_SIGNAL_STRENGTH_MODERATE) level = SIGNAL_STRENGTH_MODERATE;
else level = SIGNAL_STRENGTH_POOR;
if (DBG) log("getLevel=" + level);
return level;
}


注:asu与dBm的转化关系

dBm = -113 + (2 * asu)



        <p>版权声明:本文为博主原创文章,未经博主允许不得转载。</p>

标签: android

热门推荐