Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating Internet Speed in android

Tags:

android

I am working with an App which contains web service things.

In that I need to know the status when the Internet speed is low. How to find the internet speed level in Android?

For example, Consider if I am using 2Mbps connection in my cell phone and when it slows to 50Kbps I need to notice that situation by making a Toast or Alert.

Thanks.

like image 773
Dhamodharan Avatar asked Aug 03 '12 13:08

Dhamodharan


1 Answers

If you are connected to WiFi you can find the speed of the connection using WifiManager :

WifiInfo wifiInfo = wifiManger.getConnectionInfo();

and then from the WifiInfo you can get the current speed :

int speedMbps = wifiInfo.getLinkSpeed();

If you are on 3G, I don't think there is a standard way of finding out, maybe you can assume automatically that 3G is slow.

like image 78
Ovidiu Latcu Avatar answered Oct 16 '22 15:10

Ovidiu Latcu