Google is committed to advancing racial equity for Black communities. See how.

ScanResult

public final class ScanResult
extends Object implements Parcelable

java.lang.Object
   ↳ android.net.wifi.ScanResult


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.

Summary

Nested classes

class ScanResult.InformationElement

information elements from beacon. 

Constants

int CHANNEL_WIDTH_160MHZ

AP Channel bandwidth is 160 MHZ

int CHANNEL_WIDTH_20MHZ

AP Channel bandwidth is 20 MHZ

int CHANNEL_WIDTH_40MHZ

AP Channel bandwidth is 40 MHZ

int CHANNEL_WIDTH_80MHZ

AP Channel bandwidth is 80 MHZ

int CHANNEL_WIDTH_80MHZ_PLUS_MHZ

AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ

int WIFI_STANDARD_11AC

Wi-Fi 802.11ac

int WIFI_STANDARD_11AX

Wi-Fi 802.11ax

int WIFI_STANDARD_11N

Wi-Fi 802.11n

int WIFI_STANDARD_LEGACY

Wi-Fi 802.11a/b/g

int WIFI_STANDARD_UNKNOWN

Wi-Fi unknown standard

Inherited constants

Fields

public String BSSID

The address of the access point.

public static final Creator<ScanResult> CREATOR

Implement the Parcelable interface

public String SSID

The network name.

public String capabilities

Describes the authentication, key management, and encryption schemes supported by the access point.

public int centerFreq0

Not used if the AP bandwidth is 20 MHz If the AP use 40, 80 or 160 MHz, this is the center frequency (in MHz) if the AP use 80 + 80 MHz, this is the center frequency of the first segment (in MHz)

public int centerFreq1

Only used if the AP bandwidth is 80 + 80 MHz if the AP use 80 + 80 MHz, this is the center frequency of the second segment (in MHz)

public int channelWidth

AP Channel bandwidth; one of CHANNEL_WIDTH_20MHZ, CHANNEL_WIDTH_40MHZ, CHANNEL_WIDTH_80MHZ, CHANNEL_WIDTH_160MHZ or CHANNEL_WIDTH_80MHZ_PLUS_MHZ.

public int frequency

The primary 20 MHz 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, also known as the RSSI.

public CharSequence operatorFriendlyName

Indicates Passpoint operator name published by access point.

public long timestamp

timestamp in microseconds (since boot) when this result was last seen.

public CharSequence venueName

Indicates venue name (such as 'San Francisco Airport') published by access point; only available on Passpoint network and if published by access point.

Public constructors

ScanResult(ScanResult source)

copy constructor

ScanResult()

Construct an empty scan result.

Public methods

List<ScanResult.InformationElement> getInformationElements()

Get all information elements found in the beacon.

int getWifiStandard()

return the AP wifi standard.

boolean is80211mcResponder()
boolean isPasspointNetwork()
String toString()

Returns a string representation of the object.

Inherited methods

Constants

CHANNEL_WIDTH_160MHZ

Added in API level 23
public static final int CHANNEL_WIDTH_160MHZ

AP Channel bandwidth is 160 MHZ

Constant Value: 3 (0x00000003)

CHANNEL_WIDTH_20MHZ

Added in API level 23
public static final int CHANNEL_WIDTH_20MHZ

AP Channel bandwidth is 20 MHZ

Constant Value: 0 (0x00000000)

CHANNEL_WIDTH_40MHZ

Added in API level 23
public static final int CHANNEL_WIDTH_40MHZ

AP Channel bandwidth is 40 MHZ

Constant Value: 1 (0x00000001)

CHANNEL_WIDTH_80MHZ

Added in API level 23
public static final int CHANNEL_WIDTH_80MHZ

AP Channel bandwidth is 80 MHZ

Constant Value: 2 (0x00000002)

CHANNEL_WIDTH_80MHZ_PLUS_MHZ

Added in API level 23
public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ

AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ

Constant Value: 4 (0x00000004)

WIFI_STANDARD_11AC

Added in API level 30
public static final int WIFI_STANDARD_11AC

Wi-Fi 802.11ac

Constant Value: 5 (0x00000005)

WIFI_STANDARD_11AX

Added in API level 30
public static final int WIFI_STANDARD_11AX

Wi-Fi 802.11ax

Constant Value: 6 (0x00000006)

WIFI_STANDARD_11N

Added in API level 30
public static final int WIFI_STANDARD_11N

Wi-Fi 802.11n

Constant Value: 4 (0x00000004)

WIFI_STANDARD_LEGACY

Added in API level 30
public static final int WIFI_STANDARD_LEGACY

Wi-Fi 802.11a/b/g

Constant Value: 1 (0x00000001)

WIFI_STANDARD_UNKNOWN

Added in API level 30
public static final int WIFI_STANDARD_UNKNOWN

Wi-Fi unknown standard

Constant Value: 0 (0x00000000)

Fields

BSSID

Added in API level 1
public String BSSID

The address of the access point.

CREATOR

Added in API level 30
public static final Creator<ScanResult> CREATOR

Implement the Parcelable interface

SSID

Added in API level 1
public String SSID

The network name.

capabilities

Added in API level 1
public String capabilities

Describes the authentication, key management, and encryption schemes supported by the access point.

centerFreq0

Added in API level 23
public int centerFreq0

Not used if the AP bandwidth is 20 MHz If the AP use 40, 80 or 160 MHz, this is the center frequency (in MHz) if the AP use 80 + 80 MHz, this is the center frequency of the first segment (in MHz)

centerFreq1

Added in API level 23
public int centerFreq1

Only used if the AP bandwidth is 80 + 80 MHz if the AP use 80 + 80 MHz, this is the center frequency of the second segment (in MHz)

frequency

Added in API level 1
public int frequency

The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point.

level

Added in API level 1
public int level

The detected signal level in dBm, also known as the RSSI.

Use WifiManager.calculateSignalLevel(int) to convert this number into an absolute signal level which can be displayed to a user.

operatorFriendlyName

Added in API level 23
public CharSequence operatorFriendlyName

Indicates Passpoint operator name published by access point.

timestamp

Added in API level 17
public long timestamp

timestamp in microseconds (since boot) when this result was last seen.

venueName

Added in API level 23
public CharSequence venueName

Indicates venue name (such as 'San Francisco Airport') published by access point; only available on Passpoint network and if published by access point.

Public constructors

ScanResult

Added in API level 30
public ScanResult (ScanResult source)

copy constructor

Parameters
source ScanResult: This value cannot be null.

ScanResult

Added in API level 30
public ScanResult ()

Construct an empty scan result.

Public methods

getInformationElements

Added in API level 30
public List<ScanResult.InformationElement> getInformationElements ()

Get all information elements found in the beacon.

Returns
List<ScanResult.InformationElement> This value cannot be null.

getWifiStandard

Added in API level 30
public int getWifiStandard ()

return the AP wifi standard.

Returns
int Value is WIFI_STANDARD_UNKNOWN, WIFI_STANDARD_LEGACY, WIFI_STANDARD_11N, WIFI_STANDARD_11AC, or WIFI_STANDARD_11AX

is80211mcResponder

Added in API level 23
public boolean is80211mcResponder ()

Returns
boolean

isPasspointNetwork

Added in API level 23
public boolean isPasspointNetwork ()

Returns
boolean

toString

Added in API level 1
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.