Added in API level 1

android.net.wifi


Provides classes to manage Wi-Fi functionality on the device.

The Wi-Fi APIs provide a means by which applications can communicate with the lower-level wireless stack that provides Wi-Fi network access. Almost all information from the device supplicant is available, including the connected network's link speed, IP address, negotiation state, and more, plus information about other networks that are available. Some other API features include the ability to scan, add, save, terminate and initiate Wi-Fi connections.

Some APIs may require the following user permissions:

Note: Not all Android-powered devices provide Wi-Fi functionality. If your application uses Wi-Fi, declare so with a <uses-feature> element in the manifest file:

 <manifest ...>
     <uses-feature android:name="android.hardware.wifi" />
     ...
 </manifest>
 

Interfaces

WifiManager.LocalOnlyConnectionFailureListener Interface for local-only connection failure listener. 
WifiManager.SuggestionConnectionStatusListener Interface for suggestion connection status listener. 
WifiManager.SuggestionUserApprovalStatusListener Interface for network suggestion user approval status change listener. 

Classes

EasyConnectStatusCallback Easy Connect (DPP) Status Callback. 
MloLink Data structure class representing a Wi-Fi Multi-Link Operation (MLO) link This is only used by 802.11be capable devices 
ScanResult Describes information about a detected access point. 
ScanResult.InformationElement information elements from beacon. 
SoftApConfiguration Configuration for a soft access point (a.k.a. 
WifiAvailableChannel Contains information about a Wifi channel and bitmask of Wifi operational modes allowed on that channel. 
WifiConfiguration This class was deprecated in API level 29. Use WifiNetworkSpecifier.Builder to create NetworkSpecifier and WifiNetworkSuggestion.Builder to create WifiNetworkSuggestion. This class can still be used with privileged APIs such as WifiManager#addNetwork(WifiConfiguration). 
WifiConfiguration.AuthAlgorithm Recognized IEEE 802.11 authentication algorithms. 
WifiConfiguration.GroupCipher Recognized group ciphers. 
WifiConfiguration.GroupMgmtCipher Recognized group management ciphers. 
WifiConfiguration.KeyMgmt Recognized key management schemes. 
WifiConfiguration.PairwiseCipher Recognized pairwise ciphers for WPA. 
WifiConfiguration.Protocol Recognized security protocols. 
WifiConfiguration.Status Possible status of a network configuration. 
WifiEnterpriseConfig Enterprise configuration details for Wi-Fi. 
WifiEnterpriseConfig.Eap The Extensible Authentication Protocol method used 
WifiEnterpriseConfig.Phase2 The inner authentication method used 
WifiInfo Describes the state of any Wi-Fi connection that is active or is in the process of being set up. 
WifiInfo.Builder Builder for WifiInfo 
WifiManager This class provides the primary API for managing all aspects of Wi-Fi connectivity. 
WifiManager.AddNetworkResult Provides the results of a call to WifiManager.addNetworkPrivileged(android.net.wifi.WifiConfiguration) 
WifiManager.InterfaceCreationImpact Class describing an impact of interface creation - returned by WifiManager.reportCreateInterfaceImpact(int, boolean, java.util.concurrent.Executor, java.util.function.BiConsumer)
WifiManager.LocalOnlyHotspotCallback Callback class for applications to receive updates about the LocalOnlyHotspot status. 
WifiManager.LocalOnlyHotspotReservation LocalOnlyHotspotReservation that contains the SoftApConfiguration for the active LocalOnlyHotspot request. 
WifiManager.MulticastLock Allows an application to receive Wifi Multicast packets. 
WifiManager.ScanResultsCallback Abstract class for scan results callback. 
WifiManager.SubsystemRestartTrackingCallback Abstract callback class for applications to receive updates about the Wi-Fi subsystem restarting. 
WifiManager.WifiLock Allows an application to keep the Wi-Fi radio awake. 
WifiManager.WpsCallback This class was deprecated in API level 28. This is deprecated 
WifiNetworkSpecifier Network specifier object used to request a Wi-Fi network. 
WifiNetworkSpecifier.Builder Builder used to create WifiNetworkSpecifier objects. 
WifiNetworkSuggestion The Network Suggestion object is used to provide a Wi-Fi network for consideration when auto-connecting to networks. 
WifiNetworkSuggestion.Builder Builder used to create WifiNetworkSuggestion objects. 
WifiSsid Representation of a Wi-Fi Service Set Identifier (SSID). 
WpsInfo A class representing Wi-Fi Protected Setup  

Enums

SupplicantState From defs.h in wpa_supplicant