Android Debugging InetAddress.isReachable
<p>I am trying to figure out how to tell if a particular ipaddress is available in my android app during debugging ( I haven't tried this on an actual device ).</p>

<p>From reading it appears that InetAddress.isReachable should do this for me.</p>

<p>Initially I thought that I could code something like:</p>

<p>InetAddress address = InetAddress.getByAddress( new byte[] { (byte) 192, (byte) 168, (byte) 254, (byte) 10 );
success = address.isReachable( 3000 );</p>

<p>This returns false even though I am reasonably sure it is a reachable address.</p>

<p>I found that if I changed this to 127, 0, 0, 1 it returned success.</p>

<p>My next attempt was same code, but I used the address I got from a ping of www.google.com ( 72.167.164.64 as of this writing ).  No success.</p>

<p>So then I tried a further example:</p>

<pre><code>int timeout = 2000;
InetAddress[] addresses = InetAddress.getAllByName("www.google.com");
for (InetAddress address : addresses)
{
    if ( address.isReachable(timeout))
    {
       success = true; // just set a break point here
    }
}
</code></pre>

<p>I am relatively new to Java and Android so I suspect I am missing something, but I can't find anything that would indicate what that is.</p>
