get Wifi Link Speed and its unit - Android android.net.wifi

Android examples for android.net.wifi:Wifi Property

Description

get Wifi Link Speed and its unit

Demo Code

import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

public class Main{

    public static String getWifiLinkSpeed(WifiManager wifiManager) {
        WifiInfo wifiInfo = wifiManager.getConnectionInfo();
        int speed = wifiInfo.getLinkSpeed();

        return speed + WifiInfo.LINK_SPEED_UNITS;
    }//  ww w .j  av a 2s . c o  m

}

Related Tutorials