How to show a slow internet connection to the user when the network is connected Note: Not a network type (2G,3G,4G, WIFI)
Go to your Android device's settings, find the Notification panel & status bar option, and tap on it. Step 2. Once inside the Notification panel & status bar settings, enable the Display network speed option. And that's it now you will be able to see internet speed on the status bar whenever you are using the internet.
Mobile applications You can use applications like Speedtest to check both broadband and cellular data on both Android and iOS. The application also shows a real time graph presenting the connection consistency. You can see how stable your network is using this particular feature.
Determining your Network Speed - (Slow Internet Speed)
Using NetworkInfo class, ConnectivityManager and TelephonyManager to determine your Network Type.
Download any file from the internet & calculate how long it took vs number of bytes in the file. ( Only possible way to determine Speed Check )
I have tried the below Logic for my projects, You have also look into this, Hope it helps you.
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
//should check null because in airplane mode it will be null
NetworkCapabilities nc = cm.getNetworkCapabilities(cm.getActiveNetwork());
int downSpeed = nc.getLinkDownstreamBandwidthKbps();
int upSpeed = nc.getLinkUpstreamBandwidthKbps();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With