title: Is it alive? server connection on Xamarin, C#
body: <p>I wold like to do a <em>is it alive?</em> for check for my server connection on Xamarin.Forms. If the connection breaks, it will show an alert message. When the connection is restore the alert message will desapier.</p>
  <p>I have a http get request who checks the connection but I don't know how code the rest of the code. I need a fuction who will running on the backgound checking the connection on all the pages of my app.</p>
  <p>This is my request:</p>
  <pre><code>    public async void Alive() {
          try {
              Uri uri = new Uri(Settings.basePath + &quot;/alive&quot;);
              return await client.GetAsync(uri);
          } catch {
              return null;
          }
      }
  </code></pre>
  <p>How could I do this?</p>