Hi,

The android API, getLinkDownstreamBandwidthKbps returns the value 102400 
(100 MHz). When I verified the same with *#0011# command on the Samsung 
Active S5, it shows 10MHz. Please let me know if I am missing something.

Below is my code snippet to retreive getLinkDownstreamBandwidthKbps. 

int netBw;
ConnectivityManager conMgr = (ConnectivityManager) 
getSystemService(Context.CONNECTIVITY_SERVICE);
Network[] networks = conMgr.getAllNetworks();
NetworkInfo networkInfo;
for (Network mNetwork : networks){
    networkInfo = conMgr.getNetworkInfo(mNetwork);

    if ((networkInfo.getType() ==     ConnectivityManager.TYPE_MOBILE) && 
(networkInfo.getState().equals(NetworkInfo.State.CONNECTED))) {
        NetworkCapabilities capabilities = 
conMgr.getNetworkCapabilities(mNetwork);
        int bw = capabilities.getLinkDownstreamBandwidthKbps();
        showMessage(networkInfo.getSubtypeName() +"downlink BW in kbps = " + 
capabilities.getLinkDownstreamBandwidthKbps());
        showMessage(networkInfo.getSubtypeName() +"Uplink BW in kbps = " + 
capabilities.getLinkUpstreamBandwidthKbps());
        break;
    }


    if ((networkInfo.getType() ==     ConnectivityManager.TYPE_WIFI) && 
(networkInfo.getState().equals(NetworkInfo.State.CONNECTED))) {
        //ConnectivityManager.setProcessDefaultNetwork(network);
        NetworkCapabilities capabilities = 
conMgr.getNetworkCapabilities(mNetwork);
        int bw = capabilities.getLinkDownstreamBandwidthKbps();
        showMessage("wifi bandwidth = " + bw/1024);
        break;
    }
}


*showMessage() is my own function to print the arguments passed to it.

Regards
Abhishek

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/5de34511-0fa5-409e-848f-1b95ccc77303%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to