2016-02-17 48 views
3

我想以編程方式在Android上獲取所有附近的蜂窩運營商及其信號強度。
使用PhoneStateListener,我能夠獲得目前我登記的載波的信號強度,但是我沒有找到找到附近其他載波的信號強度的方法。
我該如何做到這一點?Android:獲取所有附近的蜂窩運營商及其信號強度

+0

DUP:[http://stackoverflow.com/questions/10454388/android-how-do-i-get-gsm-signal-strength-for-all - 可選的網絡運營商(http://stackoverflow.com/questions/10454388/android-how-do-i-get-gsm-signal-strength-for-all-available-network-operators) –

回答

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(); 

希望可以幫助您