Saturday, February 2, 2013

Get Android WiFi Status in Android

Pass WifiManager to be able to obtain the state information of Wifi, these information are enclosed in WifiInfo, can obtain material state information from inside WifiInfo.
The means that obtains WifiManager is:
WifiManager WifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
The snippet that obtains WifiInfo is:

WifiInfo Info = WifiManager.getConnectionInfo();

The Wifi state information that can obtain has:

  • SSID;
  • BSSID;
  • MacAddress;
  • HiddenSSID;
  • IpAddress;
  • LinkSpped;
  • NetWorkId;
  • Rssi;
  • SupplicantState;

About detailed information, referenced Android SDK! : )

No comments:

Post a Comment