WIFI API in Android


●WifiManager
●WifiConfiguration

●WifiInfo

●ScanResult
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.
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.
WifiConfiguration
Class Overview
A class representing a configured Wi-Fi network,
including the security configuration.
WifiInfo
Class Overview
Describes the state of any Wifi connection that is
active or is in the process of being set up.
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.
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
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.
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.
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.

Wifi api android

  • 1.
    WIFI API inAndroid ●WifiManager ●WifiConfiguration ●WifiInfo ●ScanResult
  • 2.
    WifiManager Class Overview This classprovides 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.
  • 4.
    WifiConfiguration Class Overview A classrepresenting a configured Wi-Fi network, including the security configuration.
  • 5.
    WifiInfo Class Overview Describes thestate of any Wifi connection that is active or is in the process of being set up.
  • 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 informationabout 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.