title: How to detect slow internet connection in android app
body: <p>I want to detect if a phone has a slow internet connection or high-speed internet.</p>
  <p>Now they have deprecated <code>NetworkInfo</code> and suggesting that we should use <code>ConnectivityManager#getNetworkCapabilities</code>  using this I am able to get the signal strength but not able to figure out how to use integer value returned by <code>networkCapabilities.getSignalStrength()</code></p>
  <p>It is returning an Integer value I am getting these values (-39, -71, -31).
  My question is how should we define that signal strength is good/poor.</p>
  <p>Here is my code to get Signal Strength:</p>
  <pre><code>ConnectivityManager cm = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
          Network activeNetwork = cm.getActiveNetwork();
          NetworkCapabilities networkCapabilities = cm.getNetworkCapabilities(activeNetwork);
          int signalStrength = networkCapabilities.getSignalStrength();
  </code></pre>