# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# WifiP2pConfig.Builder

`public static final class WifiP2pConfig.Builder`
`extends Object` ``

java.lang.Object
↳ | android.net.wifi.p2p.WifiP2pConfig.Builder

Builder used to build `WifiP2pConfig` objects for creating or joining a group.

## Summary

### Public constructors
`Builder()`

### Public methods
`WifiP2pConfig` | `build()` Build `WifiP2pConfig` given the current requests made on the builder.
`WifiP2pConfig.Builder` | `enablePersistentMode(boolean persistent)` Specify that the group configuration be persisted (i.e.
`WifiP2pConfig.Builder` | `setDeviceAddress(MacAddress deviceAddress)` Specify the peer's MAC address.
`WifiP2pConfig.Builder` | `setGroupOperatingBand(int band)` Specify the band to use for creating the group or joining the group.
`WifiP2pConfig.Builder` | `setGroupOperatingFrequency(int frequency)` Specify the frequency, in MHz, to use for creating the group or joining the group.
`WifiP2pConfig.Builder` | `setNetworkName(String networkName)` Specify the network name, a.k.a.
`WifiP2pConfig.Builder` | `setPassphrase(String passphrase)` Specify the passphrase for creating or joining a group.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    public Builder ()

## Public methods

### build

    public WifiP2pConfig build ()

Build `WifiP2pConfig` given the current requests made on the builder.

Returns
`WifiP2pConfig` | `WifiP2pConfig` constructed based on builder method calls. This value cannot be `null`.

### enablePersistentMode

    public WifiP2pConfig.Builder enablePersistentMode (boolean persistent)

Specify that the group configuration be persisted (i.e. saved). By default the group configuration will not be saved.

Optional. false by default.

Parameters
`persistent` | `boolean`: is this group persistent group.

Returns
`WifiP2pConfig.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`. This value cannot be `null`.

### setDeviceAddress

    public WifiP2pConfig.Builder setDeviceAddress (MacAddress deviceAddress)

Specify the peer's MAC address. If not set, the device will try to find a peer whose SSID matches the network name as specified by `setNetworkName(java.lang.String)`. Specifying null will reset the peer's MAC address to "02:00:00:00:00:00".

Optional. "02:00:00:00:00:00" by default.

Parameters
`deviceAddress` | `MacAddress`: the peer's MAC address. This value may be `null`.

Returns
`WifiP2pConfig.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`.

### setGroupOperatingBand

    public WifiP2pConfig.Builder setGroupOperatingBand (int band)

Specify the band to use for creating the group or joining the group. The band should be `WifiP2pConfig.GROUP_OWNER_BAND_2GHZ`, `WifiP2pConfig.GROUP_OWNER_BAND_5GHZ` or `WifiP2pConfig.GROUP_OWNER_BAND_AUTO`.

When creating a group as Group Owner using `WifiP2pManager#createGroup(WifiP2pManager.Channel, WifiP2pConfig, WifiP2pManager.ActionListener)`, specifying `WifiP2pConfig.GROUP_OWNER_BAND_AUTO` allows the system to pick the operating frequency from all supported bands. Specifying `WifiP2pConfig.GROUP_OWNER_BAND_2GHZ` or `WifiP2pConfig.GROUP_OWNER_BAND_5GHZ` only allows the system to pick the operating frequency in the specified band. If the Group Owner cannot create a group in the specified band, the operation will fail.

When joining a group as Group Client using `WifiP2pManager#connect(WifiP2pManager.Channel, WifiP2pConfig, WifiP2pManager.ActionListener)`, specifying `WifiP2pConfig.GROUP_OWNER_BAND_AUTO` allows the system to scan all supported frequencies to find the desired group. Specifying `WifiP2pConfig.GROUP_OWNER_BAND_2GHZ` or `WifiP2pConfig.GROUP_OWNER_BAND_5GHZ` only allows the system to scan the specified band.

`setGroupOperatingBand(int)` and `setGroupOperatingFrequency(int)` are mutually exclusive. Setting operating band and frequency both is invalid.

Optional. `WifiP2pConfig.GROUP_OWNER_BAND_AUTO` by default.

Parameters
`band` | `int`: the operating band of the group. This should be one of `WifiP2pConfig.GROUP_OWNER_BAND_AUTO`, `WifiP2pConfig.GROUP_OWNER_BAND_2GHZ`, `WifiP2pConfig.GROUP_OWNER_BAND_5GHZ`. Value is `WifiP2pConfig.GROUP_OWNER_BAND_AUTO`, `WifiP2pConfig.GROUP_OWNER_BAND_2GHZ`, or `WifiP2pConfig.GROUP_OWNER_BAND_5GHZ`

Returns
`WifiP2pConfig.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`. This value cannot be `null`.

### setGroupOperatingFrequency

    public WifiP2pConfig.Builder setGroupOperatingFrequency (int frequency)

Specify the frequency, in MHz, to use for creating the group or joining the group.

When creating a group as Group Owner using `WifiP2pManager#createGroup( WifiP2pManager.Channel, WifiP2pConfig, WifiP2pManager.ActionListener)`, specifying a frequency only allows the system to pick the specified frequency. If the Group Owner cannot create a group at the specified frequency, the operation will fail. When not specifying a frequency, it allows the system to pick operating frequency from all supported bands.

When joining a group as Group Client using `WifiP2pManager#connect( WifiP2pManager.Channel, WifiP2pConfig, WifiP2pManager.ActionListener)`, specifying a frequency only allows the system to scan the specified frequency. If the frequency is not supported or invalid, the operation will fail. When not specifying a frequency, it allows the system to scan all supported frequencies to find the desired group.

`setGroupOperatingBand(int)` and `setGroupOperatingFrequency(int)` are mutually exclusive. Setting operating band and frequency both is invalid.

Optional. 0 by default.

Parameters
`frequency` | `int`: the operating frequency of the group.

Returns
`WifiP2pConfig.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`. This value cannot be `null`.

### setNetworkName

    public WifiP2pConfig.Builder setNetworkName (String networkName)

Specify the network name, a.k.a. group name, for creating or joining a group.

A network name shall begin with "DIRECT-xy". x and y are selected from the following character set: upper case letters, lower case letters and numbers. Any byte values allowed for an SSID according to IEEE802.11-2012 [1] may be included after the string "DIRECT-xy" (including none).

Must be called - an empty network name or an network name not conforming to the P2P Group ID naming rule is not valid.

Parameters
`networkName` | `String`: network name of a group. This value cannot be `null`.

Returns
`WifiP2pConfig.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`. This value cannot be `null`.

### setPassphrase

    public WifiP2pConfig.Builder setPassphrase (String passphrase)

Specify the passphrase for creating or joining a group.

The passphrase must be an ASCII string whose length is between 8 and 63.

Must be called - an empty passphrase is not valid.

Parameters
`passphrase` | `String`: the passphrase of a group. This value cannot be `null`.

Returns
`WifiP2pConfig.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`. This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*