Android: How To Determine Network Speed In Android Programmatically
Answer : 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(); Check internet speed for mobile network to use this code ConnectivityManager connectivityManager = (ConnectivityManager)this.getSystemService(CONNECTIVITY_SERVICE); Ne...