Dave, I noticed the same that the wifi connection manager returns wifi connection information also if you are not registered on wifi anymore. It might be that the API description is not correct (or the implementation ....).
If you use the API connection.getActiveNetworkInfo().getTypeName()); from the ConnectivityManger you can find out from which type your current connection is. Then call the corresponding connection manager (mobile or wifi) and get the networkInfo. -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 23, 10:42 am, David Horn <[email protected]> wrote: > 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 -~----------~----~----~----~------~----~------~--~---

