我希望能在Android上以编程的方式获取附近所有移动运营商及其信号强度。
使用PhoneStateListener
,我能够获取当前注册的运营商的信号强度,但我没有找到一种方法来查找周围其他运营商的信号强度。
我该如何实现这个功能呢?
Use this for getting cellular carrier name
// Get System TELEPHONY service reference
TelephonyManager telephonyManager = (TelephonyManager) getBaseContext()
.getSystemService(Context.TELEPHONY_SERVICE);
// Get carrier name (Network Operator Name)
String carrierName = telephonyManager.getNetworkOperatorName();
For getting Signal Strength
TelephonyManager telephonyManager = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);`
CellInfoGsm cellinfogsm = (CellInfoGsm)telephonyManager.getAllCellInfo().get(0);
CellSignalStrengthGsm cellSignalStrengthGsm = cellinfogsm.getCellSignalStrength();
cellSignalStrengthGsm.getDbm();
希望它能对你有所帮助