信号跟踪器android应用程序 [英] signal tracker android application
本文介绍了信号跟踪器android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
各位大家好,我问的是关于无线电测量(信号质量,速率,信号电平......)的android应用程序谢谢
hello everybody, i'm asking about android application who give a trace about radio measurement ( quality of signal , rate, Signal level..) thanks
推荐答案
通过在TelephonyManager
上使用PhoneStateListener
进行监听,可以检索信号信息。
像这样的东西会听取信号强度并将其记录到 LogCat ;
Signal information can be retrieved by listening using aPhoneStateListener
on aTelephonyManager
.
Something like this will listen to signal strength and log it to LogCat;
package com.bornander.signaltest;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.app.Activity;
import android.content.Context;
public class MainActivity extends Activity {
public class MyListener extends PhoneStateListener {
@Override
public void onSignalStrengthsChanged(final SignalStrength signalStrength) {
super.onSignalStrengthsChanged(signalStrength);
Log.i("SIGNAL", String.format("Strength=%s", signalStrength));
}
}
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TelephonyManager telephonyManager =
(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(
new MyListener(),
PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);
}
}
请注意,您应该在获得许可的情况下归档您的清单;
Note that you should attribute up your manifest with permission;
<uses-permission Android:name="android.permission.READ_PHONE_STATE" />
希望这会有所帮助,
Fredrik
Hope this helps,
Fredrik
这篇关于信号跟踪器android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文