WifiConfiguration
public
class
WifiConfiguration
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.net.wifi.WifiConfiguration |
A class representing a configured Wi-Fi network, including the security configuration.
Summary
Nested classes | |
|---|---|
class |
WifiConfiguration.AuthAlgorithm
Recognized IEEE 802.11 authentication algorithms. |
class |
WifiConfiguration.GroupCipher
Recognized group ciphers. |
class |
WifiConfiguration.KeyMgmt
Recognized key management schemes. |
class |
WifiConfiguration.PairwiseCipher
Recognized pairwise ciphers for WPA. |
class |
WifiConfiguration.Protocol
Recognized security protocols. |
class |
WifiConfiguration.Status
Possible status of a network configuration. |
Inherited constants |
|---|
Fields | |
|---|---|
public
String |
BSSID
When set, this network configuration entry should only be used when associating with the AP having the specified BSSID. |
public
String |
FQDN
Fully qualified domain name of a Passpoint configuration |
public
String |
SSID
The network's SSID. |
public
BitSet |
allowedAuthAlgorithms
The set of authentication protocols supported by this configuration. |
public
BitSet |
allowedGroupCiphers
The set of group ciphers supported by this configuration. |
public
BitSet |
allowedKeyManagement
The set of key management protocols supported by this configuration. |
public
BitSet |
allowedPairwiseCiphers
The set of pairwise ciphers for WPA supported by this configuration. |
public
BitSet |
allowedProtocols
The set of security protocols supported by this configuration. |
public
WifiEnterpriseConfig |
enterpriseConfig
The enterprise configuration details specifying the EAP method, certificates and other settings associated with the EAP. |
public
boolean |
hiddenSSID
This is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans. |
public
boolean |
isHomeProviderNetwork
Flag indicating if this network is provided by a home Passpoint provider or a roaming Passpoint provider. |
public
int |
networkId
The ID number that the supplicant uses to identify this network configuration entry. |
public
String |
preSharedKey
Pre-shared key for use with WPA-PSK. |
public
int |
priority
This field was deprecated in API level 26. This field does not exist anymore. |
public
String |
providerFriendlyName
Name of Passpoint credential provider |
public
long[] |
roamingConsortiumIds
Roaming Consortium Id list for Passpoint credential; identifies a set of networks where Passpoint credential will be considered valid |
public
int |
status
The current status of this network configuration entry. |
public
String[] |
wepKeys
This field was deprecated in API level 28. Due to security and performance limitations, use of WEP networks is discouraged. |
public
int |
wepTxKeyIndex
This field was deprecated in API level 28. Due to security and performance limitations, use of WEP networks is discouraged. |
Public constructors | |
|---|---|
WifiConfiguration()
|
|
Public methods | |
|---|---|
ProxyInfo
|
getHttpProxy()
Returns the HTTP proxy used by this object. |
boolean
|
isPasspoint()
Identify if this configuration represents a Passpoint network |
void
|
setHttpProxy(ProxyInfo httpProxy)
Set the |
String
|
toString()
Returns a string representation of the object. |
Inherited methods | |
|---|---|
Fields
BSSID
public String BSSID
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.
FQDN
public String FQDN
Fully qualified domain name of a Passpoint configuration
SSID
public String SSID
The network's SSID. Can either be a UTF-8 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).
allowedAuthAlgorithms
public BitSet allowedAuthAlgorithms
The set of authentication protocols supported by this configuration.
See WifiConfiguration.AuthAlgorithm for descriptions of the values.
Defaults to automatic selection.
allowedGroupCiphers
public BitSet allowedGroupCiphers
The set of group ciphers supported by this configuration.
See WifiConfiguration.GroupCipher for descriptions of the values.
Defaults to CCMP TKIP WEP104 WEP40.
allowedKeyManagement
public BitSet allowedKeyManagement
The set of key management protocols supported by this configuration.
See WifiConfiguration.KeyMgmt for descriptions of the values.
Defaults to WPA-PSK WPA-EAP.
allowedPairwiseCiphers
public BitSet allowedPairwiseCiphers
The set of pairwise ciphers for WPA supported by this configuration.
See WifiConfiguration.PairwiseCipher for descriptions of the values.
Defaults to CCMP TKIP.
allowedProtocols
public BitSet allowedProtocols
The set of security protocols supported by this configuration.
See WifiConfiguration.Protocol for descriptions of the values.
Defaults to WPA RSN.
enterpriseConfig
public WifiEnterpriseConfig enterpriseConfig
The enterprise configuration details specifying the EAP method, certificates and other settings associated with the EAP.
hiddenSSID
public boolean hiddenSSID
This is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans.
isHomeProviderNetwork
public boolean isHomeProviderNetwork
Flag indicating if this network is provided by a home Passpoint provider or a roaming
Passpoint provider. This flag will be true if this network is provided by
a home Passpoint provider and false if is provided by a roaming Passpoint provider
or is a non-Passpoint network.
networkId
public int networkId
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.
preSharedKey
public String preSharedKey
Pre-shared key for use with WPA-PSK. Either an ASCII string enclosed in
double quotation marks (e.g., "abcdefghij" for PSK passphrase or
a string of 64 hex digits for raw PSK.
priority
public int priority
This field was deprecated
in API level 26.
This field does not exist anymore.
Priority determines the preference given to a network by wpa_supplicant
when choosing an access point with which to associate.
providerFriendlyName
public String providerFriendlyName
Name of Passpoint credential provider
roamingConsortiumIds
public long[] roamingConsortiumIds
Roaming Consortium Id list for Passpoint credential; identifies a set of networks where Passpoint credential will be considered valid
status
public int status
The current status of this network configuration entry.
See also:
wepKeys
public String[] wepKeys
This field was deprecated
in API level 28.
Due to security and performance limitations, use of WEP networks
is discouraged.
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).
wepTxKeyIndex
public int wepTxKeyIndex
This field was deprecated
in API level 28.
Due to security and performance limitations, use of WEP networks
is discouraged.
Default WEP key index, ranging from 0 to 3.
Public constructors
Public methods
getHttpProxy
public ProxyInfo getHttpProxy ()
Returns the HTTP proxy used by this object.
| Returns | |
|---|---|
ProxyInfo |
a httpProxy representing the proxy specified by this
WifiConfiguration, or null if no proxy is specified.
|
isPasspoint
public boolean isPasspoint ()
Identify if this configuration represents a Passpoint network
| Returns | |
|---|---|
boolean |
|
setHttpProxy
public void setHttpProxy (ProxyInfo httpProxy)
Set the ProxyInfo for this WifiConfiguration. This method should only be used by a
device owner or profile owner. When other apps attempt to save a WifiConfiguration
with modified proxy settings, the methods WifiManager.addNetwork(WifiConfiguration) and
WifiManager.updateNetwork(WifiConfiguration) fail and return -1.
| Parameters | |
|---|---|
httpProxy |
ProxyInfo: ProxyInfo representing the httpProxy to be used by this
WifiConfiguration. Setting this to null will explicitly set no
proxy, removing any proxy that was previously set. |
| Throws | |
|---|---|
IllegalArgumentException |
for invalid httpProxy |
toString
public String toString ()
Returns a string representation of the object. In general, the
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| Returns | |
|---|---|
String |
a string representation of the object. |
Classes
- ScanResult
- WifiConfiguration
- WifiConfiguration.AuthAlgorithm
- WifiConfiguration.GroupCipher
- WifiConfiguration.KeyMgmt
- WifiConfiguration.PairwiseCipher
- WifiConfiguration.Protocol
- WifiConfiguration.Status
- WifiEnterpriseConfig
- WifiEnterpriseConfig.Eap
- WifiEnterpriseConfig.Phase2
- WifiInfo
- WifiManager
- WifiManager.LocalOnlyHotspotCallback
- WifiManager.LocalOnlyHotspotReservation
- WifiManager.MulticastLock
- WifiManager.WifiLock
- WifiManager.WpsCallback
- WpsInfo
Enums