获取蜂窝网络android的频段?

问题描述 投票:3回答:1

有没有办法在android中以编程方式为移动设备分配频段号。例如,使用移动互联网接听电话或连接到互联网(不是wifi)时的频率号码。

android
1个回答
2
投票

据我所知,到目前为止,您无法获得精确的带号,但您可以获得GPRS或EDGE,HSDPA等网络名称:

public String getNetworkClass(Context context) {
        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = cm.getActiveNetworkInfo();
        if(info==null || !info.isConnected())
            return "Not connected!";
        if(info.getType() == ConnectivityManager.TYPE_WIFI)
            return "Wifi";
        if(info.getType() == ConnectivityManager.TYPE_MOBILE){
            // this will return on of EDGE, LTE, HSDPA and many other
            return info.getSubtypeName();
        }
        return "Unknown";
    }
© www.soinside.com 2019 - 2024. All rights reserved.