在Android中获得3G信号强度

时间:2016-04-25 15:55:11

标签: android 3g signal-strength

我目前正在onSignalStrengthsChanged(SignalStrength signalStrength)内使用此代码检测我的手机所连接的技术:

int networkType = telephonyManager.getNetworkType();
            switch (networkType) {
                case TelephonyManager.NETWORK_TYPE_UMTS:
                    return "3G-UMTS";
                case TelephonyManager.NETWORK_TYPE_EVDO_0:
                    return "3G-EVDO_0";
                case TelephonyManager.NETWORK_TYPE_EVDO_A:
                    return "3G-EVDO_A";
                case TelephonyManager.NETWORK_TYPE_HSDPA:
                    return "3G-HSDPA";
                case TelephonyManager.NETWORK_TYPE_HSUPA:
                    return "3G-HSUPA";
                case TelephonyManager.NETWORK_TYPE_HSPA:
                    return "3G-HSPA";
                case TelephonyManager.NETWORK_TYPE_EVDO_B:
                    return "3G-EVDO_B";
                case TelephonyManager.NETWORK_TYPE_EHRPD:
                    return "3G-EHRPD";
                case TelephonyManager.NETWORK_TYPE_HSPAP:
                    return "3G-HSPAP";                  
                default:
                    return "Unknown";
            }

但是一旦完成此验证,我该如何设法获得信号强度? 只有当手机在3G网络下时,才需要获取值(DBM或RSSI)。 感谢

0 个答案:

没有答案