public class

WifiConfiguration

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

Class Overview

A class representing a configured Wi-Fi network, including the security configuration. Android will not necessarily support all of these security schemes initially.

Summary

Nested Classes
classWifiConfiguration.AuthAlgorithmRecognized IEEE 802.11 authentication algorithms. 
classWifiConfiguration.GroupCipherRecognized group ciphers. 
classWifiConfiguration.KeyMgmtRecognized key management schemes. 
classWifiConfiguration.PairwiseCipherRecognized pairwise ciphers for WPA. 
classWifiConfiguration.ProtocolRecognized security protocols. 
classWifiConfiguration.StatusPossible status of a network configuration. 
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public StringBSSIDWhen set, this network configuration entry should only be used when associating with the AP having the specified BSSID.
public StringSSIDThe network's SSID.
public BitSetallowedAuthAlgorithmsThe set of authentication protocols supported by this configuration.
public BitSetallowedGroupCiphersThe set of group ciphers supported by this configuration.
public BitSetallowedKeyManagementThe set of key management protocols supported by this configuration.
public BitSetallowedPairwiseCiphersThe set of pairwise ciphers for WPA supported by this configuration.
public BitSetallowedProtocolsThe set of security protocols supported by this configuration.
public booleanhiddenSSIDThis is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans.
public intnetworkIdThe ID number that the supplicant uses to identify this network configuration entry.
public StringpreSharedKeyPre-shared key for use with WPA-PSK.
public intpriorityPriority determines the preference given to a network by wpa_supplicant when choosing an access point with which to associate.
public intstatusThe current status of this network configuration entry.
public String[]wepKeysUp to four WEP keys.
public intwepTxKeyIndexDefault WEP key index, ranging from 0 to 3.
Public Constructors
WifiConfiguration()
Public Methods
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

Fields

public String BSSID

Since: API Level 1

When set, this network configuration entry should only be used when associating with the AP having the specified BSSID. The value is a string in the format of an Ethernet MAC address, e.g., XX:XX:XX:XX:XX:XX where each X is a hex digit.

public String SSID

Since: API Level 1

The network's SSID. Can either be an ASCII string, which must be enclosed in double quotation marks (e.g., "MyNetwork", or a string of hex digits,which are not enclosed in quotes (e.g., 01a243f405).

public BitSet allowedAuthAlgorithms

Since: API Level 1

The set of authentication protocols supported by this configuration. See WifiConfiguration.AuthAlgorithm for descriptions of the values. Defaults to automatic selection.

public BitSet allowedGroupCiphers

Since: API Level 1

The set of group ciphers supported by this configuration. See WifiConfiguration.GroupCipher for descriptions of the values. Defaults to CCMP TKIP WEP104 WEP40.

public BitSet allowedKeyManagement

Since: API Level 1

The set of key management protocols supported by this configuration. See WifiConfiguration.KeyMgmt for descriptions of the values. Defaults to WPA-PSK WPA-EAP.

public BitSet allowedPairwiseCiphers

Since: API Level 1

The set of pairwise ciphers for WPA supported by this configuration. See WifiConfiguration.PairwiseCipher for descriptions of the values. Defaults to CCMP TKIP.

public BitSet allowedProtocols

Since: API Level 1

The set of security protocols supported by this configuration. See WifiConfiguration.Protocol for descriptions of the values. Defaults to WPA RSN.

public boolean hiddenSSID

Since: API Level 1

This is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans.

public int networkId

Since: API Level 1

The ID number that the supplicant uses to identify this network configuration entry. This must be passed as an argument to most calls into the supplicant.

public String preSharedKey

Since: API Level 1

Pre-shared key for use with WPA-PSK.

When the value of this key is read, the actual key is not returned, just a "*" if the key has a value, or the null string otherwise.

public int priority

Since: API Level 1

Priority determines the preference given to a network by wpa_supplicant when choosing an access point with which to associate.

public int status

Since: API Level 1

The current status of this network configuration entry.

public String[] wepKeys

Since: API Level 1

Up to four WEP keys. Either an ASCII string enclosed in double quotation marks (e.g., "abcdef" or a string of hex digits (e.g., 0102030405).

When the value of one of these keys is read, the actual key is not returned, just a "*" if the key has a value, or the null string otherwise.

public int wepTxKeyIndex

Since: API Level 1

Default WEP key index, ranging from 0 to 3.

Public Constructors

public WifiConfiguration ()

Since: API Level 1

Public Methods

public String toString ()

Since: API Level 1

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 is equivalent to the following expression:

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

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.