The document summarizes key classes and methods in the Android Wifi API:
WifiManager is the primary class for managing WiFi connectivity and provides methods to get lists of configured networks and scan results, as well as connect to networks and get information about the current connection. WifiConfiguration represents a configured WiFi network. WifiInfo describes the state of an active or connecting WiFi network including signal strength and speed. ScanResult contains information about detected access points like SSID, signal level and encryption support.
VMware vSphere 6.0 - Troubleshooting Training - Day 2
Wifi api android
1. WIFI API in Android
●WifiManager
●WifiConfiguration
●WifiInfo
●ScanResult
2. WifiManager
Class Overview
This class provides the primary API for managing
all aspects of Wi-Fi connectivity.
This is the API to use when performing Wi-Fi
specific operations. To perform operations that
pertain to network connectivity at an abstract level,
use ConnectivityManager.
3. WifiManager
It deals with several categories of items:
● The list of configured networks. The list can be viewed and
updated, and attributes of individual entries can be
modified.
● The currently active Wi-Fi network, if any. Connectivity
can be established or torn down, and dynamic information
about the state of the network can be queried.
● Results of access point scans, containing enough
information to make decisions about what access point to
connect to.
● It defines the names of various Intent actions that are
broadcast upon any sort of change in Wi-Fi state.
6. ScanResult
Summary
● public String BSSID
● public String SSID
● public String capabilities
Describes the authentication, key management, and encryption
schemes supported by the access point.
● public int frequency
The frequency in MHz of the channel over which the client is
communicating with the access point.
● public int level
The detected signal level in dBm.
7. WifiInfo
Summary
● private int mRssi;
Received Signal Strength Indicator
● private int mLinkSpeed;
Link speed in Mbps
● private boolean mMeteredHint;
Flag indicating that AP has hinted that upstream connection is
metered, and sensitive to heavy data transfers
8. ScanResult
Class Overview
Describes information about a detected access point.
In addition to the attributes described here, the
supplicant keeps track of quality, noise, and
maxbitrate attributes, but does not currently report
them to external clients.
9. WifiManager
Summary
● List<WifiConfiguration> getConfiguredNetworks()
Return a list of all the networks configured in the supplicant.
● WifiInfo getConnectionInfo()
Return dynamic information about the current Wi-Fi connection,
if any is active.
● List<ScanResult> getScanResults()
Return the results of the latest access point scan.
10. WifiManager
Summary
● startScan()
Request a scan for access points.
● static int calculateSignalLevel(int rssi, int numLevels)
Calculates the level of the signal.
● static int compareSignalLevel(int rssiA, int rssiB)
Compares two signal strengths.