I'm trying to check if there's a connected Wifi connection on the HTC
Hero. However, the WifiInfo object is reporting a connection
(including SSID and MAC address) even when WiFi is turned off.
public boolean isHighSpeedConnection()
{
TelephonyManager telMan = (TelephonyManager)getSystemService
(Context.TELEPHONY_SERVICE);
WifiManager wifiMan = (WifiManager)getSystemService
(Context.WIFI_SERVICE);
// Check for connected WiFi network - if so, return true.
WifiInfo wifiInfo = wifiMan.getConnectionInfo();
if (wifiInfo.getNetworkId() != -1)
{
if (Config.LOGD) Log.d(TAG, "WiFi Connected (" +
wifiInfo.getSSID
() + ")");
return true;
}
return false;
}
This always returns true, and will provide the SSID of the access
point last connected to. I'm absolutely stumped on how to fix this
problem and would really appreciate any suggestions.
Cheers,
Dave.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---