title: How can I get netmask from Android device?
body: <p>I need to get the netmask and ip from the Android so I can calculate all the IP's within my subnet range.</p>
  
  <p>I've been searching and so far I've found this:
  <a href="https://stackoverflow.com/questions/5387036/how-to-get-gateway-and-subnet-mask-details-in-android-programmatically">Programmatically getting the gateway and subnet mask details</a></p>
  
  <p>The problem is that it doesn't work for all devices. For instance, it doesn't work in the emulator (any Android version) and it doesn't work either in my Archos 7HT with Android 1.5.
  It returns 0 for netmask and gateway.</p>
  
  <p>Is there any way to do it? Is there any system file which I could read that contains this info?? (something like this: <a href="http://www.flattermann.net/2011/02/android-howto-find-the-hardware-mac-address-of-a-remote-host/" rel="nofollow noreferrer">http://www.flattermann.net/2011/02/android-howto-find-the-hardware-mac-address-of-a-remote-host/</a>).</p>
  
  <p>In my advanced wifi settings I can see these settings, so there must be a way to retrieve them...</p>
  
  <p>Thanks.</p>