title: Retrieve IP address of device
body: <p>I am using Xamarin.Android and wrote the following code:</p>
  
  <pre><code>public TextView text;
  text = FindViewById&lt;TextView&gt;(Resource.Id.viewIP);
  foreach (IPAddress adress in Dns.GetHostAddresses(Dns.GetHostName()))
  {
      text.Text = "IP Adress: " + adress;
  }
  </code></pre>
  
  <p>However, when I open the application it shuts down immediately. Am I using the correct way of getting the IP address' of the device?</p>