-2

In Android how to get mobile data signal speed in kbps??????

TelephonyManager telephonyManager = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
CellInfoGsm cellinfogsm = (CellInfoGsm)telephonyManager.getAllCellInfo().get(0);
CellSignalStrengthGsm cellSignalStrengthGsm = cellinfogsm.getCellSignalStrength();
cellSignalStrengthGsm.getDbm();
redead
  • 360
  • 3
  • 16
Rakhiii
  • 49
  • 5
  • Have a look at this [question](http://stackoverflow.com/questions/19154992/getting-data-speed-of-wifi-mobile-network-programatically) – redead Mar 27 '17 at 09:03
  • Hai redead i want mobile data speed only not wifi and phone signal – Rakhiii Mar 28 '17 at 07:20

1 Answers1

1

If you need to find the network speed you need to follow the below link :

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

What it does is simply you hit a url that gives you a text file and based on file size and time to download the file you can judge the exact n/w speed.

Also if you just want to check the quality of network you can use the following code :

ConnectionQuality networkQuality = ConnectionClassManager.getInstance().getCurrentBandwidthQuality();

This will return the ConnectionQuality enum that has the following values:

public enum ConnectionQuality {
     /**
   * Bandwidth under 50 kbps.
   */
  WORST,
  /**
   * Bandwidth under 150 kbps.
   */
  POOR,
  /**
   * Bandwidth between 150 and 550 kbps.
   */
  MODERATE,
  /**
   * Bandwidth between 550 and 2000 kbps.
   */
  GOOD,
  /**
   * EXCELLENT - Bandwidth over 2000 kbps.
   */
  EXCELLENT,
  /**
   * Placeholder for unknown bandwidth. This is the initial value and will stay at this value
   * if a bandwidth cannot be accurately found.
   */
  UNKNOWN
}

Hope this helps..

Sreehari
  • 5,621
  • 2
  • 25
  • 59
mudit pant
  • 104
  • 3