Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#nestedclasses) \| [Constants](https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#constants) \| [Inherited Constants](https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#inhconstants) \| [Fields](https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#lfields) \| [Ctors](https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#pubctors) \| [Methods](https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#inhmethods)

# WifiP2pConfig

*** ** * ** ***

` public class WifiP2pConfig `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.wifi.p2p.WifiP2pConfig |

<br />

*** ** * ** ***

A class representing a Wi-Fi P2p configuration for setting up a connection
**See also:**

- `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig.Builder` Builder used to build `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig` objects for creating or joining a group. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP` IP provisioning via IPv4 DHCP, when joining a group as a group client. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL` IP provisioning via IPv6 link-local, when joining a group as a group client. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_2GHZ` Allow the system to pick the operating frequency from the 2.4 GHz band. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_5GHZ` Allow the system to pick the operating frequency from the 5 GHz band. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_6GHZ` Allow the system to pick the operating frequency from the 6 GHz band. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_AUTO` Allow the system to pick the operating frequency from all supported bands. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_AUTO` The system can choose an appropriate owner intent value, to be filled in the field `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#groupOwnerIntent`. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MAX` The most inclination to be a group owner, to be filled in the field `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#groupOwnerIntent`. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MIN` The least inclination to be a group owner, to be filled in the field `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#groupOwnerIntent`. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#P2P_VERSION_1` P2P Protocol version 1 |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#P2P_VERSION_2` P2P Protocol version 2 |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#PCC_MODE_CONNECTION_TYPE_LEGACY_ONLY` Legacy connection type. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#PCC_MODE_CONNECTION_TYPE_LEGACY_OR_R2` Wi-Fi Direct R1/R2 compatible mode connection type. |
| `int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#PCC_MODE_CONNECTION_TYPE_R2_ONLY` This configuration allows only Wi-Fi Direct R2 supported devices to establish connection. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig>` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#CREATOR` Implement the Parcelable interface |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#deviceAddress` The device MAC address uniquely identifies a Wi-Fi p2p device |
| ` public int` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#groupOwnerIntent` This is an integer value between `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MIN` and `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MAX` where `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MIN` indicates the least inclination to be a group owner and `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MAX` indicates the highest inclination to be a group owner. |
| ` public https://developer.android.com/reference/android/net/wifi/WpsInfo` | `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#wps` Wi-Fi Protected Setup information |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#WifiP2pConfig()() ` |
| ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#WifiP2pConfig(android.net.wifi.p2p.WifiP2pConfig)(https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig source) ` copy constructor |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#describeContents()() ` Implement the Parcelable interface |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getGroupClientIpProvisioningMode()() ` Get the IP provisioning mode when joining a group as a group client. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getGroupOwnerBand()() ` Get the required band for the group owner. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getGroupOwnerVersion()() ` Get the P2P Group Owner version. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getNetworkId()() ` Get the network ID of this P2P configuration. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getNetworkName()() ` Get the network name of this P2P configuration, or null if unset. |
| ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pPairingBootstrappingConfig` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getPairingBootstrappingConfig()() ` Get the pairing bootstrapping configuration , or null if unset. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getPairingDiscoveryChannelFrequencyMhz()() ` Get the discovery channel frequency in MHz for pairing, or 0 if unset. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getPassphrase()() ` Get the passphrase of this P2P configuration, or null if unset. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#getPccModeConnectionType()() ` Get the PCC Mode connection type. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#isAuthorizeConnectionFromPeerEnabled()() ` Query to check if the configuration is for authorizing a connection request from the peer device. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#setGroupOwnerVersion(int)(int version) ` Set the P2P Group Owner version. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Implement the Parcelable interface |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP

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

```
public static final int GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP
```

IP provisioning via IPv4 DHCP, when joining a group as a group client.

<br />

Constant Value: 0 (0x00000000)

### GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL

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

```
public static final int GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL
```

IP provisioning via IPv6 link-local, when joining a group as a group client.

<br />

Constant Value: 1 (0x00000001)

### GROUP_OWNER_BAND_2GHZ

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

```
public static final int GROUP_OWNER_BAND_2GHZ
```

Allow the system to pick the operating frequency from the 2.4 GHz band.

<br />

Constant Value: 1 (0x00000001)

### GROUP_OWNER_BAND_5GHZ

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

```
public static final int GROUP_OWNER_BAND_5GHZ
```

Allow the system to pick the operating frequency from the 5 GHz band.

<br />

Constant Value: 2 (0x00000002)

### GROUP_OWNER_BAND_6GHZ

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

```
public static final int GROUP_OWNER_BAND_6GHZ
```

Allow the system to pick the operating frequency from the 6 GHz band.

<br />

Constant Value: 3 (0x00000003)

### GROUP_OWNER_BAND_AUTO

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

```
public static final int GROUP_OWNER_BAND_AUTO
```

Allow the system to pick the operating frequency from all supported bands.

<br />

Constant Value: 0 (0x00000000)

### GROUP_OWNER_INTENT_AUTO

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

```
public static final int GROUP_OWNER_INTENT_AUTO
```

The system can choose an appropriate owner intent value, to be filled in the field `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#groupOwnerIntent`.

<br />

Constant Value: -1 (0xffffffff)

### GROUP_OWNER_INTENT_MAX

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

```
public static final int GROUP_OWNER_INTENT_MAX
```

The most inclination to be a group owner, to be filled in the field `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#groupOwnerIntent`.

<br />

Constant Value: 15 (0x0000000f)

### GROUP_OWNER_INTENT_MIN

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

```
public static final int GROUP_OWNER_INTENT_MIN
```

The least inclination to be a group owner, to be filled in the field `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#groupOwnerIntent`.

<br />

Constant Value: 0 (0x00000000)

### P2P_VERSION_1

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

```
public static final int P2P_VERSION_1
```

P2P Protocol version 1

<br />

Constant Value: 0 (0x00000000)

### P2P_VERSION_2

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

```
public static final int P2P_VERSION_2
```

P2P Protocol version 2

<br />

Constant Value: 1 (0x00000001)

### PCC_MODE_CONNECTION_TYPE_LEGACY_ONLY

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

```
public static final int PCC_MODE_CONNECTION_TYPE_LEGACY_ONLY
```

Legacy connection type.

Group Owner: Configured to support WPA2-Personal connections.

Group Client: Configured to connect to Group Owner using WPA2-Personal.

<br />

Constant Value: 0 (0x00000000)

### PCC_MODE_CONNECTION_TYPE_LEGACY_OR_R2

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

```
public static final int PCC_MODE_CONNECTION_TYPE_LEGACY_OR_R2
```

Wi-Fi Direct R1/R2 compatible mode connection type.

Group Owner: Configured in WPA3-Personal Compatibility Mode to support WPA3-Personal and WPA2-Personal connections simultaneously.

Group Client: Configured to connect to Group Owner using WPA3-Personal or WPA2-Personal. The system will choose WPA3-Personal if Group Owner support WPA3-Personal.

<br />

Constant Value: 1 (0x00000001)

### PCC_MODE_CONNECTION_TYPE_R2_ONLY

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

```
public static final int PCC_MODE_CONNECTION_TYPE_R2_ONLY
```

This configuration allows only Wi-Fi Direct R2 supported devices to establish connection.

Group Owner: Configured to support WPA3-Personal connections.

Group Client: Configured to connect to Group Owner using WPA3-Personal.

<br />

Constant Value: 2 (0x00000002)

## Fields

### CREATOR

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

```
public static final Creator<WifiP2pConfig> CREATOR
```

Implement the Parcelable interface

<br />

### deviceAddress

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

```
public String deviceAddress
```

The device MAC address uniquely identifies a Wi-Fi p2p device

<br />

### groupOwnerIntent

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

```
public int groupOwnerIntent
```

This is an integer value between `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MIN` and `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MAX` where `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MIN` indicates the least inclination to be a group owner and `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_MAX` indicates the highest inclination to be a group owner. A value of `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_AUTO` indicates the system can choose an appropriate value. By default this field is set to `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_INTENT_AUTO`.   

Value is between 0 and 15 inclusive

<br />

### wps

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

```
public WpsInfo wps
```

Wi-Fi Protected Setup information

<br />

## Public constructors

### WifiP2pConfig

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

```
public WifiP2pConfig ()
```

<br />

<br />

### WifiP2pConfig

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

```
public WifiP2pConfig (WifiP2pConfig source)
```

copy constructor

<br />

| Parameters ||
|---|---|
| `source` | `WifiP2pConfig` <br /> |

## Public methods

### describeContents

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

```
public int describeContents ()
```

Implement the Parcelable interface

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getGroupClientIpProvisioningMode

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

```
public int getGroupClientIpProvisioningMode ()
```

Get the IP provisioning mode when joining a group as a group client. The result will be one of the following: `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP`, `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL`

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL` |

### getGroupOwnerBand

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

```
public int getGroupOwnerBand ()
```

Get the required band for the group owner. The result will be one of the following: `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_AUTO`, `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_2GHZ`, `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_5GHZ`, `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_6GHZ`

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_AUTO` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_2GHZ` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_5GHZ` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#GROUP_OWNER_BAND_6GHZ` |

### getGroupOwnerVersion

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

```
public int getGroupOwnerVersion ()
```

Get the P2P Group Owner version. See also `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#setGroupOwnerVersion(int)`.

<br />

| Returns ||
|---|---|
| `int` | The P2P Group Owner protocol version. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#P2P_VERSION_1` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#P2P_VERSION_2` |

### getNetworkId

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

```
public int getNetworkId ()
```

Get the network ID of this P2P configuration.

<br />

| Returns ||
|---|---|
| `int` | either a non-negative network ID, or one of `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pGroup#NETWORK_ID_PERSISTENT` or `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pGroup#NETWORK_ID_TEMPORARY`. <br /> |

### getNetworkName

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

```
public String getNetworkName ()
```

Get the network name of this P2P configuration, or null if unset.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getPairingBootstrappingConfig

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

```
public WifiP2pPairingBootstrappingConfig getPairingBootstrappingConfig ()
```

Get the pairing bootstrapping configuration , or null if unset.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pPairingBootstrappingConfig` | <br /> |

### getPairingDiscoveryChannelFrequencyMhz

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

```
public int getPairingDiscoveryChannelFrequencyMhz ()
```

Get the discovery channel frequency in MHz for pairing, or 0 if unset.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getPassphrase

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

```
public String getPassphrase ()
```

Get the passphrase of this P2P configuration, or null if unset.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getPccModeConnectionType

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

```
public int getPccModeConnectionType ()
```

Get the PCC Mode connection type.

<br />

| Returns ||
|---|---|
| `int` | One of the `PCC_MODE_CONNECTION_TYPE_*`. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#PCC_MODE_CONNECTION_TYPE_LEGACY_ONLY` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#PCC_MODE_CONNECTION_TYPE_LEGACY_OR_R2` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#PCC_MODE_CONNECTION_TYPE_R2_ONLY` |

### isAuthorizeConnectionFromPeerEnabled

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

```
public boolean isAuthorizeConnectionFromPeerEnabled ()
```

Query to check if the configuration is for authorizing a connection request from the peer device. @see `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig.Builder#setAuthorizeConnectionFromPeerEnabled(boolean)`

<br />

| Returns ||
|---|---|
| `boolean` | true if configured to authorize a connection request from the Peer device, False otherwise. <br /> |

### setGroupOwnerVersion

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

```
public void setGroupOwnerVersion (int version)
```

Set the P2P Group Owner version.

<br />

| Parameters ||
|---|---|
| `version` | `int`: The P2P Group Owner protocol version. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#P2P_VERSION_1` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig#P2P_VERSION_2` |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

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

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Implement the Parcelable interface

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |