Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# android.net.wifi.aware

*** ** * ** ***

Provides classes which allow applications to use Wi-Fi Aware to discover peers and create connections to them.

Using the Wi-Fi Aware APIs, applications can advertise services, discover peers which are advertising services, and connect to them. Wi-Fi Aware is independent of Wi-Fi infrastructure (i.e. a device may or may not be associated with an AP concurrent to using Wi-Fi Aware).

The primary entry point to Wi-Fi Aware capabilities is the `https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager` class, which is acquired by calling `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)`

Some APIs may require the following user permissions:

- `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`
- `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE`
- `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION`

**Note:** Not all Android-powered devices support Wi-Fi Aware functionality. If your application only works with Wi-Fi Aware (i.e. it should only be installed on devices which support Wi-Fi Aware), declare so with a [`<uses-feature>`](https://developer.android.com/guide/topics/manifest/uses-feature-element) element in the manifest file:

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

Alternatively, if you application does not require Wi-Fi Aware but can take advantage of it if available, you can perform the check at run-time in your code using `https://developer.android.com/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String)` with `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_WIFI_AWARE`:

```
    getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_AWARE)
```

## Classes

|---|---|
| [AttachCallback](https://developer.android.com/reference/android/net/wifi/aware/AttachCallback) | Base class for Aware attach callbacks. |
| [AwareDataPathRequest](https://developer.android.com/reference/android/net/wifi/aware/AwareDataPathRequest) | A request to set up a data path for a Wi-Fi Aware network. |
| [AwareDataPathRequest.Builder](https://developer.android.com/reference/android/net/wifi/aware/AwareDataPathRequest.Builder) | A builder class for a Wi-Fi Aware data path request to set up a data path with a peer device. |
| [AwarePairingConfig](https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig) | The config for the Aware Pairing. |
| [AwarePairingConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig.Builder) | Builder used to build `https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig` objects. |
| [AwareResources](https://developer.android.com/reference/android/net/wifi/aware/AwareResources) | The resources of the Aware service. |
| [Characteristics](https://developer.android.com/reference/android/net/wifi/aware/Characteristics) | The characteristics of the Wi-Fi Aware implementation. |
| [DiscoverySession](https://developer.android.com/reference/android/net/wifi/aware/DiscoverySession) | A class representing a single publish or subscribe Aware session. |
| [DiscoverySessionCallback](https://developer.android.com/reference/android/net/wifi/aware/DiscoverySessionCallback) | Base class for Aware session events callbacks. |
| [IdentityChangedListener](https://developer.android.com/reference/android/net/wifi/aware/IdentityChangedListener) | Base class for Aware identity/cluster changes callbacks. |
| [ParcelablePeerHandle](https://developer.android.com/reference/android/net/wifi/aware/ParcelablePeerHandle) | A Parcelable `https://developer.android.com/reference/android/net/wifi/aware/PeerHandle`. |
| [PeerHandle](https://developer.android.com/reference/android/net/wifi/aware/PeerHandle) | Opaque object used to represent a Wi-Fi Aware peer. |
| [PublishConfig](https://developer.android.com/reference/android/net/wifi/aware/PublishConfig) | Defines the configuration of an Aware publish session. |
| [PublishConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/PublishConfig.Builder) | Builder used to build `https://developer.android.com/reference/android/net/wifi/aware/PublishConfig` objects. |
| [PublishDiscoverySession](https://developer.android.com/reference/android/net/wifi/aware/PublishDiscoverySession) | A class representing a Aware publish session. |
| [ServiceDiscoveryInfo](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo) | An object providing information about a Wi-Fi Aware discovery session with a specific peer. |
| [SubscribeConfig](https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig) | Defines the configuration of an Aware subscribe session. |
| [SubscribeConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig.Builder) | Builder used to build `https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig` objects. |
| [SubscribeDiscoverySession](https://developer.android.com/reference/android/net/wifi/aware/SubscribeDiscoverySession) | A class representing a Aware subscribe session. |
| [WifiAwareChannelInfo](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareChannelInfo) | Wi-Fi Aware data-path channel information. |
| [WifiAwareDataPathSecurityConfig](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareDataPathSecurityConfig) | Wi-Fi Aware data-path security config. |
| [WifiAwareDataPathSecurityConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareDataPathSecurityConfig.Builder) | A builder class for a Wi-Fi Aware data-path security config to encrypt an Aware connection. |
| [WifiAwareManager](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager) | This class provides the primary API for managing Wi-Fi Aware operations: discovery and peer-to-peer data connections. |
| [WifiAwareNetworkInfo](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkInfo) | Wi-Fi Aware-specific network information. |
| [WifiAwareNetworkSpecifier](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkSpecifier) | Network specifier object used to request a Wi-Fi Aware network. |
| [WifiAwareNetworkSpecifier.Builder](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkSpecifier.Builder) | A builder class for a Wi-Fi Aware network specifier to set up an Aware connection with a peer. |
| [WifiAwareSession](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareSession) | This class represents a Wi-Fi Aware session - an attachment to the Wi-Fi Aware service through which the app can execute discovery operations. |

-

  ## Classes

  - [AttachCallback](https://developer.android.com/reference/android/net/wifi/aware/AttachCallback)
  - [AwareDataPathRequest](https://developer.android.com/reference/android/net/wifi/aware/AwareDataPathRequest)
  - [AwareDataPathRequest.Builder](https://developer.android.com/reference/android/net/wifi/aware/AwareDataPathRequest.Builder)
  - [AwarePairingConfig](https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig)
  - [AwarePairingConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig.Builder)
  - [AwareResources](https://developer.android.com/reference/android/net/wifi/aware/AwareResources)
  - [Characteristics](https://developer.android.com/reference/android/net/wifi/aware/Characteristics)
  - [DiscoverySession](https://developer.android.com/reference/android/net/wifi/aware/DiscoverySession)
  - [DiscoverySessionCallback](https://developer.android.com/reference/android/net/wifi/aware/DiscoverySessionCallback)
  - [IdentityChangedListener](https://developer.android.com/reference/android/net/wifi/aware/IdentityChangedListener)
  - [ParcelablePeerHandle](https://developer.android.com/reference/android/net/wifi/aware/ParcelablePeerHandle)
  - [PeerHandle](https://developer.android.com/reference/android/net/wifi/aware/PeerHandle)
  - [PublishConfig](https://developer.android.com/reference/android/net/wifi/aware/PublishConfig)
  - [PublishConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/PublishConfig.Builder)
  - [PublishDiscoverySession](https://developer.android.com/reference/android/net/wifi/aware/PublishDiscoverySession)
  - [ServiceDiscoveryInfo](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo)
  - [SubscribeConfig](https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig)
  - [SubscribeConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig.Builder)
  - [SubscribeDiscoverySession](https://developer.android.com/reference/android/net/wifi/aware/SubscribeDiscoverySession)
  - [WifiAwareChannelInfo](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareChannelInfo)
  - [WifiAwareDataPathSecurityConfig](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareDataPathSecurityConfig)
  - [WifiAwareDataPathSecurityConfig.Builder](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareDataPathSecurityConfig.Builder)
  - [WifiAwareManager](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager)
  - [WifiAwareNetworkInfo](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkInfo)
  - [WifiAwareNetworkSpecifier](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkSpecifier)
  - [WifiAwareNetworkSpecifier.Builder](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkSpecifier.Builder)
  - [WifiAwareSession](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareSession)