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

# Builder

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/ranging/oob/OobInitiatorRangingConfig.Builder "View this page in Java")

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.ranging.oob.OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) |

Builder class for creating instances of `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#Builder()()` <br /> |

| Public methods ||
|---|---|
| [OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#addDeviceHandle(android.ranging.oob.DeviceHandle)(deviceHandle: https://developer.android.com/reference/kotlin/android/ranging/oob/DeviceHandle)` Adds a DeviceHandle to the list of devices for the ranging session. |
| [OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#addDeviceHandles(kotlin.collections.MutableList)(deviceHandles: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/ranging/oob/DeviceHandle!>)` Adds a list of DeviceHandle to the list of devices for the ranging session. |
| [OobInitiatorRangingConfig](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#build()()` Builds an instance of `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig` with the provided parameters. |
| [OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#setFastestRangingInterval(java.time.Duration)(intervalMs: https://developer.android.com/reference/kotlin/java/time/Duration.html#)` Sets the fastest ranging interval in milliseconds. |
| [OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#setRangingMode(kotlin.Int)(rangingMode: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the ranging mode for the session. |
| [OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#setRangingTechnologyFilter(kotlin.collections.MutableSet)(rangingTechnologies: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html!>)` Sets a filter for the ranging technologies that can be used for the session. |
| [OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#setSecurityLevel(kotlin.Int)(securityLevel: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the security level for the ranging session. |
| [OobInitiatorRangingConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#setSlowestRangingInterval(java.time.Duration)(intervalMs: https://developer.android.com/reference/kotlin/java/time/Duration.html#)` Sets the slowest ranging interval in milliseconds. |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### addDeviceHandle

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

```
fun addDeviceHandle(deviceHandle: DeviceHandle): OobInitiatorRangingConfig.Builder
```

Adds a DeviceHandle to the list of devices for the ranging session.

| Parameters ||
|---|---|
| `deviceHandle` | [DeviceHandle](https://developer.android.com/reference/kotlin/android/ranging/oob/DeviceHandle): The DeviceHandle to add. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` | The Builder instance. This value cannot be `null`. |

### addDeviceHandles

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

```
fun addDeviceHandles(deviceHandles: MutableList<DeviceHandle!>): OobInitiatorRangingConfig.Builder
```

Adds a list of DeviceHandle to the list of devices for the ranging session.

| Parameters ||
|---|---|
| `deviceHandles` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[DeviceHandle](https://developer.android.com/reference/kotlin/android/ranging/oob/DeviceHandle)!\>: The list of DeviceHandles to add. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` | The Builder instance. This value cannot be `null`. |

### build

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

```
fun build(): OobInitiatorRangingConfig
```

Builds an instance of `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig` with the provided parameters.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig` | A new OobInitiatorRangingConfig instance. This value cannot be `null`. |

### setFastestRangingInterval

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

```
fun setFastestRangingInterval(intervalMs: Duration): OobInitiatorRangingConfig.Builder
```

Sets the fastest ranging interval in milliseconds.

| Parameters ||
|---|---|
| `intervalMs` | [Duration](https://developer.android.com/reference/kotlin/java/time/Duration.html#): The fastest interval in milliseconds. Defaults to 100ms. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` | The Builder instance, for chaining calls. This value cannot be `null`. |

### setRangingMode

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

```
fun setRangingMode(rangingMode: Int): OobInitiatorRangingConfig.Builder
```

Sets the ranging mode for the session.

| Parameters ||
|---|---|
| `rangingMode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The ranging mode to set. Defaults to `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#RANGING_MODE_AUTO:kotlin.Int` Value is one of the following: - `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#RANGING_MODE_AUTO:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#RANGING_MODE_HIGH_ACCURACY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#RANGING_MODE_HIGH_ACCURACY_PREFERRED:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#RANGING_MODE_FUSED:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` | The Builder instance. This value cannot be `null`. |

### setRangingTechnologyFilter

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

```
fun setRangingTechnologyFilter(rangingTechnologies: MutableSet<Int!>): OobInitiatorRangingConfig.Builder
```

Sets a filter for the ranging technologies that can be used for the session.

If this set is empty (the default), the system will attempt to use any available and suitable ranging technology. If the set is non-empty, the system will restrict its choice of technology to those specified in this set.

| Parameters ||
|---|---|
| `rangingTechnologies` | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!\>: A `https://developer.android.com/reference/kotlin/java/util/Set.html#` of Ranging Technology integers. Must not be null. To indicate no preference (allow any technology), pass an empty set. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` | this `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` instance. This value cannot be `null`. |

### setSecurityLevel

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

```
fun setSecurityLevel(securityLevel: Int): OobInitiatorRangingConfig.Builder
```

Sets the security level for the ranging session.

| Parameters ||
|---|---|
| `securityLevel` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The security level to set. Defaults to `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#SECURITY_LEVEL_BASIC:kotlin.Int` Value is one of the following: - `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#SECURITY_LEVEL_BASIC:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig#SECURITY_LEVEL_SECURE:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` | The Builder instance. This value cannot be `null`. |

### setSlowestRangingInterval

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

```
fun setSlowestRangingInterval(intervalMs: Duration): OobInitiatorRangingConfig.Builder
```

Sets the slowest ranging interval in milliseconds.

| Parameters ||
|---|---|
| `intervalMs` | [Duration](https://developer.android.com/reference/kotlin/java/time/Duration.html#): The slowest interval in milliseconds. Defaults to 5000ms. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/ranging/oob/OobInitiatorRangingConfig.Builder#` | The Builder instance, for chaining calls. This value cannot be `null`. |