public class

WifiInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.net.wifi.WifiInfo

Class Overview

Describes the state of any Wifi connection that is active or is in the process of being set up.

Summary

Constants
String LINK_SPEED_UNITS Link speed in Mbps
[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Methods
String getBSSID()
Return the basic service set identifier (BSSID) of the current access point.
static NetworkInfo.DetailedState getDetailedStateOf(SupplicantState suppState)
Map a supplicant state into a fine-grained network connectivity state.
boolean getHiddenSSID()
int getIpAddress()
int getLinkSpeed()
Returns the current link speed in LINK_SPEED_UNITS.
String getMacAddress()
int getNetworkId()
Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant.
int getRssi()
Returns the received signal strength indicator of the current 802.11 network.
String getSSID()
Returns the service set identifier (SSID) of the current 802.11 network.
SupplicantState getSupplicantState()
Return the detailed state of the supplicant's negotiation with an access point, in the form of a SupplicantState object.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final String LINK_SPEED_UNITS

Link speed in Mbps

Constant Value: "Mbps"

Public Methods

public String getBSSID ()

Return the basic service set identifier (BSSID) of the current access point. The BSSID may be null if there is no network currently connected.

Returns
  • the BSSID, in the form of a six-byte MAC address: XX:XX:XX:XX:XX:XX

public static NetworkInfo.DetailedState getDetailedStateOf (SupplicantState suppState)

Map a supplicant state into a fine-grained network connectivity state.

Parameters
suppState the supplicant state
Returns

public boolean getHiddenSSID ()

Returns
  • true if this network does not broadcast its SSID, so an SSID-specific probe request must be used for scans.

public int getIpAddress ()

public int getLinkSpeed ()

Returns the current link speed in LINK_SPEED_UNITS.

Returns
  • the link speed.
See Also

public String getMacAddress ()

public int getNetworkId ()

Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant. This method returns the ID for the currently connected network.

Returns
  • the network ID, or -1 if there is no currently connected network

public int getRssi ()

Returns the received signal strength indicator of the current 802.11 network.

This is not normalized, but should be!

Returns
  • the RSSI, in the range ??? to ???

public String getSSID ()

Returns the service set identifier (SSID) of the current 802.11 network. If the SSID is an ASCII string, it will be returned surrounded by double quotation marks.Otherwise, it is returned as a string of hex digits. The SSID may be null if there is no network currently connected.

Returns
  • the SSID

public SupplicantState getSupplicantState ()

Return the detailed state of the supplicant's negotiation with an access point, in the form of a SupplicantState object.

Returns

public String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's hashCode(), that is, it is equivalent to the following expression:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a printable representation of this object.