title: Xamarin check internet connection
body: <p>I have to check internet connection in my application, fallowing this <a href="https://stackoverflow.com/questions/1560788/how-to-check-internet-access-on-android-inetaddress-never-times-out">answer</a>
  I have added lines to my manifest file. However I have an issue with <code>getSystemServiceMethod</code> it is not defined in my case, context does not contain such a method. </p>
  
  <p>As well I`ve been trying to do something like this:</p>
  
  <pre><code>public static bool isInternetOn()
  {
      ConnectivityManager connectivityManager = (ConnectivityManager)Context.ConnectivityService;
      NetworkInfo networkInfo = connectivityManager.ActiveNetworkInfo;
      bool isWifi = networkInfo.Type == ConnectivityType.Wifi; // wifi check
      return networkInfo.IsConnected;
  }
  </code></pre>
  
  <p>But it throws an exception. How could I fix this issue and check whether the phone has access to the internet. </p>