android - 如何获得有效的误码率或接收质量

标签 android

我试图通过使用 getGthe 以下编码来获取误码率,但我总是只得到 -1。你们有人知道如何获得有效的误码率吗?请帮助获得正确的值。

代码如下。

public class GetGsmSignalStrengthActivity extends Activity {

        TelephonyManager        Tel;
        MyPhoneStateListener    MyListener;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Tel  = ( TelephonyManager )getSystemService(Context.TELEPHONY_SERVICE);
    Tel.listen(MyListener ,PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);
   }
   private class MyPhoneStateListener extends PhoneStateListener
   {
     @Override
     public void onSignalStrengthsChanged(SignalStrength signalStrength)
     {
      super.onSignalStrengthsChanged(signalStrength);
      TextView dummy1 = (TextView)findViewById(R.id.textView5);            
      String x,m ="";            
          x=String.valueOf(signalStrength.getGsmBitErrorRate());
          dummy4.setText("Bit Error      : " +x);

     }

  }
}

最佳答案

阅读此内容 bug report comment #4 。您会发现它是可选的,因此是可能的。如果调制解调器制造商没有提供,它将返回-1。

引用:

The problem is that AT+CSQ in TS 27.007 section 8.5 is listed as optional. Therefore the modem manufacturer has the choice whether or not to provide both the signal and bit error rate using standard interfaces. So when you see -1 that means the modem people haven't implemented it.

关于android - 如何获得有效的误码率或接收质量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9066586/

相关文章:

java - OnSensorChanged() 不改变循环中的值

php - Android eclipse 注册页面应用已停止错误

java - LibGdx android 访问 .txt 文件并将其转换为字符串

android - 修复了安卓谷歌地图上的标记大小

android - 从Bamboo运行时在根项目中找不到任务 'assemble'

Android:不推荐使用非滑动标签?

android - android中的弹出消息

android - 在 Android 中通过 Intent 限制可选择的文件类型

java - 如何为 ListView 的每个项目创建 onClickListener

java - 网站和 Android 应用程序的单一数据库