title: check for poor internet connectivity android studio
body: <p>I am using reward ad video in my app. When there is no internet connection, I check it using this function and do not show the ad. </p>
  
  <pre><code>public final boolean isInternetOn() {
      ConnectivityManager connectivityManager
              = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
      NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
      return activeNetworkInfo != null &amp;&amp; activeNetworkInfo.isConnected();
  }
  </code></pre>
  
  <p>But the problem is, when there is poor connection it takes so much time to show the ad and ad is not shown many times. I want to check for poor connectivity and if connection is poor don't show the ad and show alert for poor connection. How to achieve this?</p>