title: Getting wifi broadcast address in Android wifi hotspot
body: <p>I'm developing an app that uses wifi to broadcast UDP messages between all the mobiles that are in the same network that have my app.</p>
  
  <p>I managed to send/receive packets from many cellphones having an external AP, that's my router.</p>
  
  <p>But given the case that there's no AP, I want users to be able to use their phone's Wifi Hotspot feature so they can still use my aplication. So one of the cellphones would be the wifi hotspot, and all the others would connect to that.</p>
  
  <p>I require users to connect to a wifi by they own. Either to an external AP or to the said hotspot. Then when my application starts, it checks whether the phone is connected to a wifi network, calling the WifiManager.isWifiEnabled() and NetworkInfo.isConnected().</p>
  
  <p>The problem is that if I call these functions in the cellphone that's using hotspot, the function isConnected() will return false. And I can't get the broadcast address using WifiManager.getDhcpInfo().
  The other phones that are connected to the hotspot they do work perfectly. But the hotspot cellphone can't send any broadcast, since WifiManager is disabled.</p>
  
  <p>So, my question would be "Is there any way to check if a cellphone is currently being a wifi hotspot? And if so, is there any way I can get its broadcast address?"</p>