# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# AdvertisingSetParameters.Builder

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

java.lang.Object
↳ | android.bluetooth.le.AdvertisingSetParameters.Builder

Builder class for `AdvertisingSetParameters`.

## Summary

### Public constructors
`Builder()`

### Public methods
`AdvertisingSetParameters` | `build()` Build the `AdvertisingSetParameters` object.
`AdvertisingSetParameters.Builder` | `setAnonymous(boolean isAnonymous)` Set whether advertiser address should be ommited from all packets.
`AdvertisingSetParameters.Builder` | `setConnectable(boolean connectable)` Set whether the advertisement type should be connectable or non-connectable.
`AdvertisingSetParameters.Builder` | `setIncludeTxPower(boolean includeTxPower)` Set whether TX power should be included in the extended header.
`AdvertisingSetParameters.Builder` | `setInterval(int interval)` Set advertising interval.
`AdvertisingSetParameters.Builder` | `setLegacyMode(boolean isLegacy)` When set to true, advertising set will advertise 4.x Spec compliant advertisements.
`AdvertisingSetParameters.Builder` | `setPrimaryPhy(int primaryPhy)` Set the primary physical channel used for this advertising set.
`AdvertisingSetParameters.Builder` | `setScannable(boolean scannable)` Set whether the advertisement type should be scannable.
`AdvertisingSetParameters.Builder` | `setSecondaryPhy(int secondaryPhy)` Set the secondary physical channel used for this advertising set.
`AdvertisingSetParameters.Builder` | `setTxPowerLevel(int txPowerLevel)` Set the transmission power level for the advertising.

### 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 AdvertisingSetParameters build ()

Build the `AdvertisingSetParameters` object.

Returns
`AdvertisingSetParameters` |

Throws
`IllegalStateException` | if invalid combination of parameters is used.

### setAnonymous

    public AdvertisingSetParameters.Builder setAnonymous (boolean isAnonymous)

Set whether advertiser address should be ommited from all packets. If this mode is used, periodic advertising can't be enabled for this set. This is used only if legacy mode is not used.

Parameters
`isAnonymous` | `boolean`: whether anonymous advertising should be used.

Returns
`AdvertisingSetParameters.Builder` |

### setConnectable

    public AdvertisingSetParameters.Builder setConnectable (boolean connectable)

Set whether the advertisement type should be connectable or non-connectable. Legacy advertisements can be both connectable and scannable. Non-legacy advertisements can be only scannable or only connectable.

Parameters
`connectable` | `boolean`: Controls whether the advertisement type will be connectable (true) or non-connectable (false).

Returns
`AdvertisingSetParameters.Builder` |

### setIncludeTxPower

    public AdvertisingSetParameters.Builder setIncludeTxPower (boolean includeTxPower)

Set whether TX power should be included in the extended header. This is used only if legacy mode is not used.

Parameters
`includeTxPower` | `boolean`: whether TX power should be included in extended header

Returns
`AdvertisingSetParameters.Builder` |

### setInterval

    public AdvertisingSetParameters.Builder setInterval (int interval)

Set advertising interval.

Parameters
`interval` | `int`: Bluetooth LE Advertising interval, in 0.625ms unit. Valid range is from 160 (100ms) to 16777215 (10,485.759375 s). Recommended values are: `AdvertisingSetParameters.INTERVAL_LOW`, `AdvertisingSetParameters#INTERVAL_MEDIUM`, or `AdvertisingSetParameters#INTERVAL_HIGH`.

Returns
`AdvertisingSetParameters.Builder` |

Throws
`IllegalArgumentException` | If the interval is invalid.

### setLegacyMode

    public AdvertisingSetParameters.Builder setLegacyMode (boolean isLegacy)

When set to true, advertising set will advertise 4.x Spec compliant advertisements.

Parameters
`isLegacy` | `boolean`: whether legacy advertising mode should be used.

Returns
`AdvertisingSetParameters.Builder` |

### setPrimaryPhy

    public AdvertisingSetParameters.Builder setPrimaryPhy (int primaryPhy)

Set the primary physical channel used for this advertising set. This is used only if legacy mode is not used. Use `BluetoothAdapter#isLeCodedPhySupported` to determine if LE Coded PHY is supported on this device.

Parameters
`primaryPhy` | `int`: Primary advertising physical channel, can only be `BluetoothDevice.PHY_LE_1M` or `BluetoothDevice#PHY_LE_CODED`.

Returns
`AdvertisingSetParameters.Builder` |

Throws
`IllegalArgumentException` | If the primaryPhy is invalid.

### setScannable

    public AdvertisingSetParameters.Builder setScannable (boolean scannable)

Set whether the advertisement type should be scannable. Legacy advertisements can be both connectable and scannable. Non-legacy advertisements can be only scannable or only connectable.

Parameters
`scannable` | `boolean`: Controls whether the advertisement type will be scannable (true) or non-scannable (false).

Returns
`AdvertisingSetParameters.Builder` |

### setSecondaryPhy

    public AdvertisingSetParameters.Builder setSecondaryPhy (int secondaryPhy)

Set the secondary physical channel used for this advertising set. This is used only if legacy mode is not used. Use `BluetoothAdapter#isLeCodedPhySupported` and `BluetoothAdapter#isLe2MPhySupported` to determine if LE Coded PHY or 2M PHY is supported on this device.

Parameters
`secondaryPhy` | `int`: Secondary advertising physical channel, can only be one of `BluetoothDevice.PHY_LE_1M`, `BluetoothDevice#PHY_LE_2M` or `BluetoothDevice.PHY_LE_CODED`.

Returns
`AdvertisingSetParameters.Builder` |

Throws
`IllegalArgumentException` | If the secondaryPhy is invalid.

### setTxPowerLevel

    public AdvertisingSetParameters.Builder setTxPowerLevel (int txPowerLevel)

Set the transmission power level for the advertising.

Parameters
`txPowerLevel` | `int`: Transmission power of Bluetooth LE Advertising, in dBm. The valid range is [-127, 1] Recommended values are: `AdvertisingSetParameters#TX_POWER_ULTRA_LOW`, `AdvertisingSetParameters#TX_POWER_LOW`, `AdvertisingSetParameters#TX_POWER_MEDIUM`, or `AdvertisingSetParameters#TX_POWER_HIGH`.

Returns
`AdvertisingSetParameters.Builder` |

Throws
`IllegalArgumentException` | If the `txPowerLevel` is invalid.

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