Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting data speed of wifi/mobile network programmatically [duplicate]

How do I get the data speed of wifi/mobile network programmatically in my application.

like image 454
Ullas Avatar asked Oct 03 '13 09:10

Ullas


1 Answers

Here's the code for getting the WiFi speed:

WifiManager wifiManager = getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
if (wifiInfo != null) {
    Integer linkSpeed = wifiInfo.getLinkSpeed(); //measured using WifiInfo.LINK_SPEED_UNITS
}

For mobile network speed, refer to the below link:

http://www.gregbugaj.com/?p=47

like image 189
Hariharan Avatar answered Oct 24 '22 18:10

Hariharan