4

Can I check if the wireless is enabled, even if not connected to any network. I need wireless enabled to get more accurate gps readings. But I don't need to be concede to any of the networks (It seams that unless wi-fi is active, the device can not use networks for positioning). For data transfer I will use the mobile network.

So, How do I check if wireless is activated?

Ryan
  • 5,456
  • 25
  • 71
  • 129
  • How about this answer? [how to see if wifi is connected in android](http://stackoverflow.com/a/3841407/1513735) – Heskja Jul 14 '12 at 11:56

1 Answers1

5
public boolean isWifiOn() {
     WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
     return wifi.isWifiEnabled();
}
Blackbelt
  • 156,034
  • 29
  • 297
  • 305