# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# AdvertisingSet

`public final class AdvertisingSet`
`extends Object` ``

java.lang.Object
↳ | android.bluetooth.le.AdvertisingSet

This class provides a way to control single Bluetooth LE advertising instance.

To get an instance of `AdvertisingSet`, call the `BluetoothLeAdvertiser#startAdvertisingSet` method.

See also:

- `AdvertiseData`

## Summary

### Public methods
`void` | `enableAdvertising(boolean enable, int duration, int maxExtendedAdvertisingEvents)` Enables Advertising.
`void` | `setAdvertisingData(AdvertiseData advertiseData)` Set/update data being Advertised.
`void` | `setAdvertisingParameters(AdvertisingSetParameters parameters)` Update advertising parameters associated with this AdvertisingSet.
`void` | `setPeriodicAdvertisingData(AdvertiseData periodicData)` Used to set periodic advertising data, must be called after setPeriodicAdvertisingParameters, or after advertising was started with periodic advertising data set.
`void` | `setPeriodicAdvertisingEnabled(boolean enable)` Used to enable/disable periodic advertising.
`void` | `setPeriodicAdvertisingParameters(PeriodicAdvertisingParameters parameters)` Update periodic advertising parameters associated with this set.
`void` | `setScanResponseData(AdvertiseData scanResponse)` Set/update scan response data.

### 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 methods

### enableAdvertising

    public void enableAdvertising (boolean enable,
                    int duration,
                    int maxExtendedAdvertisingEvents)

Enables Advertising. This method returns immediately, the operation status is delivered through `callback.onAdvertisingEnabled()`.
For apps targeting `Build.VERSION_CODES#R` or lower, this requires the `Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting `Build.VERSION_CODES#S` or or higher, this requires the `Manifest.permission#BLUETOOTH_ADVERTISE` permission which can be gained with `Activity.requestPermissions(String[], int)`.
Requires `Manifest.permission.BLUETOOTH_ADVERTISE`

Parameters
`enable` | `boolean`: whether the advertising should be enabled (true), or disabled (false)
`duration` | `int`: advertising duration, in 10ms unit. Valid range is from 1 (10ms) to 65535 (655,350 ms)
`maxExtendedAdvertisingEvents` | `int`: maximum number of extended advertising events the controller shall attempt to send prior to terminating the extended advertising, even if the duration has not expired. Valid range is from 1 to 255.

### setAdvertisingData

    public void setAdvertisingData (AdvertiseData advertiseData)

Set/update data being Advertised. Make sure that data doesn't exceed the size limit for specified AdvertisingSetParameters. This method returns immediately, the operation status is delivered through `callback.onAdvertisingDataSet()`.

Advertising data must be empty if non-legacy scannable advertising is used.
For apps targeting `Build.VERSION_CODES#R` or lower, this requires the `Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting `Build.VERSION_CODES#S` or or higher, this requires the `Manifest.permission#BLUETOOTH_ADVERTISE` permission which can be gained with `Activity.requestPermissions(String[], int)`.
Requires `Manifest.permission.BLUETOOTH_ADVERTISE`

Parameters
`advertiseData` | `AdvertiseData`: Advertisement data to be broadcasted. Size must not exceed `BluetoothAdapter.getLeMaximumAdvertisingDataLength()`. If the advertisement is connectable, three bytes will be added for flags. If the update takes place when the advertising set is enabled, the data can be maximum 251 bytes long.

### setAdvertisingParameters

    public void setAdvertisingParameters (AdvertisingSetParameters parameters)

Update advertising parameters associated with this AdvertisingSet. Must be called when advertising is not active. This method returns immediately, the operation status is delivered through `callback.onAdvertisingParametersUpdated`.
For apps targeting `Build.VERSION_CODES#R` or lower, this requires the `Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting `Build.VERSION_CODES#S` or or higher, this requires the `Manifest.permission#BLUETOOTH_ADVERTISE` permission which can be gained with `Activity.requestPermissions(String[], int)`.
Requires `Manifest.permission.BLUETOOTH_ADVERTISE`

Parameters
`parameters` | `AdvertisingSetParameters`: advertising set parameters.

### setPeriodicAdvertisingData

    public void setPeriodicAdvertisingData (AdvertiseData periodicData)

Used to set periodic advertising data, must be called after setPeriodicAdvertisingParameters, or after advertising was started with periodic advertising data set. This method returns immediately, the operation status is delivered through `callback.onPeriodicAdvertisingDataSet()`.
For apps targeting `Build.VERSION_CODES#R` or lower, this requires the `Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting `Build.VERSION_CODES#S` or or higher, this requires the `Manifest.permission#BLUETOOTH_ADVERTISE` permission which can be gained with `Activity.requestPermissions(String[], int)`.
Requires `Manifest.permission.BLUETOOTH_ADVERTISE`

Parameters
`periodicData` | `AdvertiseData`: Periodic advertising data. Size must not exceed `BluetoothAdapter.getLeMaximumAdvertisingDataLength()`. If the update takes place when the periodic advertising is enabled for this set, the data can be maximum 251 bytes long.

### setPeriodicAdvertisingEnabled

    public void setPeriodicAdvertisingEnabled (boolean enable)

Used to enable/disable periodic advertising. This method returns immediately, the operation status is delivered through `callback.onPeriodicAdvertisingEnable()`.
For apps targeting `Build.VERSION_CODES#R` or lower, this requires the `Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting `Build.VERSION_CODES#S` or or higher, this requires the `Manifest.permission#BLUETOOTH_ADVERTISE` permission which can be gained with `Activity.requestPermissions(String[], int)`.
Requires `Manifest.permission.BLUETOOTH_ADVERTISE`

Parameters
`enable` | `boolean`: whether the periodic advertising should be enabled (true), or disabled (false).

### setPeriodicAdvertisingParameters

    public void setPeriodicAdvertisingParameters (PeriodicAdvertisingParameters parameters)

Update periodic advertising parameters associated with this set. Must be called when periodic advertising is not enabled. This method returns immediately, the operation status is delivered through `callback.onPeriodicAdvertisingParametersUpdated()`.
For apps targeting `Build.VERSION_CODES#R` or lower, this requires the `Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting `Build.VERSION_CODES#S` or or higher, this requires the `Manifest.permission#BLUETOOTH_ADVERTISE` permission which can be gained with `Activity.requestPermissions(String[], int)`.
Requires `Manifest.permission.BLUETOOTH_ADVERTISE`

Parameters
`parameters` | `PeriodicAdvertisingParameters`

### setScanResponseData

    public void setScanResponseData (AdvertiseData scanResponse)

Set/update scan response data. Make sure that data doesn't exceed the size limit for specified AdvertisingSetParameters. This method returns immediately, the operation status is delivered through `callback.onScanResponseDataSet()`.
For apps targeting `Build.VERSION_CODES#R` or lower, this requires the `Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting `Build.VERSION_CODES#S` or or higher, this requires the `Manifest.permission#BLUETOOTH_ADVERTISE` permission which can be gained with `Activity.requestPermissions(String[], int)`.
Requires `Manifest.permission.BLUETOOTH_ADVERTISE`

Parameters
`scanResponse` | `AdvertiseData`: Scan response associated with the advertisement data. Size must not exceed `BluetoothAdapter#getLeMaximumAdvertisingDataLength`. If the update takes place when the advertising set is enabled, the data can be maximum 251 bytes long.

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