For better experience for users of my app I wanted to show them different UI based on their network speed, problem here is that there is no way to know what network we are currently on.
My first instinct was to use android.net.ConnectivityManager getActiveNetworkInfo() which gives us current network information, but the only thing we can find out from this is the connection type TYPE_MOBILE or TYPE_WIFI which is not very useful for my purpose.
So here is a quick tool that will try to determine network type by testing the download speed, I use threshold of 176 kbits/sec as EDGE cut of value.
14 thoughts on “Detecting Network Speed and Type on Android (Edge,3G)”
Try TelephonyManager.getNetworkType() and save yourself some time 🙂
@Philippe : Thanks, that is exactly what I was looking for.At least now I can know my actually speed and network type
hey, greg, I’ve tried your src. It’s a great one.
Neo — a guy trying to be a Android developer
Nice post! thank you!
Hey, the result is different from that of SpeedTest.net app. I put a 10M bytes file on an instance in Amazon EC2. the result of this app is at most 2.9 Mbps instead of about 5Mbps of SpeedTest.net app
This is what I was looking for hours n hours on the internet.
Thanks for the code. Its really helpful
For different mobile its giving different download rate
Why is its so?
Please help me
Can you post a code from which i can get upload speed ….plzzzz
it would help me a lot because i stuck on my office project.
Pingback: Show Network Speed Android | andorid best
APK file showing nothing but crashing after some time.
Source code looks good. You made my day.
Here someone is saying wifiInfo.getLinkSpeed(); but that was wrong because getLinkSpeed gives maximum capacity of your wifi link.
Hi, I am glad that is is useful. It’s been a while since I looked at it.
How we can find download speed of wifi connected network in Mbps
If you know that your download speed is 1 Megabyte per second then this is equivalent to 8 Megabits per second. To find out how the download speed is calculated a look at the source.
Typical steps are as follow