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

# Builder

*** ** * ** ***

```
class Builder
```

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

Builder for creating instances of `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel`.

## Summary

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

| Public methods ||
|---|---|
| [UwbComplexChannel](https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel) | `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel.Builder#build()()` Builds and returns a new instance of `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel`. |
| [UwbComplexChannel.Builder](https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel.Builder#setChannel(kotlin.Int)(channel: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the channel for the ranging device. |
| [UwbComplexChannel.Builder](https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel.Builder#) | `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel.Builder#setPreambleIndex(kotlin.Int)(preambleIndex: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the preamble index for the ranging device as defined in See [UWB_PREAMBLE_CODE_INDEX_9](https://groups.firaconsortium.org/wg/members/document/1949> FiRa UCI Spec.</a>} <p> PRF (Pulse Repetition Frequency) is selected based on the preamble index set here. <p> Defaults to a random BPRF preamble index. One among <code><a docref=), `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel#UWB_PREAMBLE_CODE_INDEX_10:kotlin.Int`, `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel#UWB_PREAMBLE_CODE_INDEX_11:kotlin.Int` or `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel#UWB_PREAMBLE_CODE_INDEX_12:kotlin.Int`. |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### build

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

```
fun build(): UwbComplexChannel
```

Builds and returns a new instance of `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel`.

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

### setChannel

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

```
fun setChannel(channel: Int): UwbComplexChannel.Builder
```

Sets the channel for the ranging device.

Defaults to `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel#UWB_CHANNEL_5:kotlin.Int`

| Parameters ||
|---|---|
| `channel` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The channel number to be set. |

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

### setPreambleIndex

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

```
fun setPreambleIndex(preambleIndex: Int): UwbComplexChannel.Builder
```

Sets the preamble index for the ranging device as defined in See [UWB_PREAMBLE_CODE_INDEX_9](https://groups.firaconsortium.org/wg/members/document/1949> FiRa UCI
Spec.</a>}
<p> PRF (Pulse Repetition Frequency) is selected based on the preamble index set here.

<p> Defaults to a random BPRF preamble index.
One among <code><a docref=), `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel#UWB_PREAMBLE_CODE_INDEX_10:kotlin.Int`, `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel#UWB_PREAMBLE_CODE_INDEX_11:kotlin.Int` or `https://developer.android.com/reference/kotlin/android/ranging/uwb/UwbComplexChannel#UWB_PREAMBLE_CODE_INDEX_12:kotlin.Int`. For better performance always use a random preamble index for each ranging session.

| Parameters ||
|---|---|
| `preambleIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The preamble index to be set. |

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