我想以编程方式在Android上获取所有附近的移动运营商及其信号强度
使用PhoneStateListener
,我能够获得我当前注册的运营商的信号强度,但我找不到找到附近其他运营商信号强度的方法。
我怎样才能做到这一点?
答案 0 :(得分:0)
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();
希望它可以帮到你