# TetheringManager.TetheringRequest.Builder

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/net/TetheringManager.TetheringRequest.Builder "View this page in Java")  

```
class Builder
```

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

Builder used to create TetheringRequest.

## Summary

|                                                                                                                      Public constructors                                                                                                                       ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest.Builder#Builder(kotlin.Int))`(`type:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Default constructor of Builder. |

|                                                                                                                                                                                                                                                                                                                    Public methods                                                                                                                                                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[TetheringManager.TetheringRequest](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest)                  | [build](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest.Builder#build())`()` Build[TetheringRequest](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest)with the currently set configuration.                                                                                                                                                                                                         |
| open[TetheringManager.TetheringRequest.Builder](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest.Builder#) | [setSoftApConfiguration](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest.Builder#setSoftApConfiguration(android.net.wifi.SoftApConfiguration))`(`softApConfig:` `[SoftApConfiguration](https://developer.android.com/reference/kotlin/android/net/wifi/SoftApConfiguration)?`)` Set the desired SoftApConfiguration for[TETHERING_WIFI](https://developer.android.com/reference/kotlin/android/net/TetheringManager#TETHERING_WIFI:kotlin.Int). |

## Public constructors

### Builder

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

```
Builder(type: Int)
```

Default constructor of Builder.

|                                                                                                                                                                                                                                                                   Parameters                                                                                                                                                                                                                                                                   ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.net.TetheringManager#TETHERING_WIFI](https://developer.android.com/reference/kotlin/android/net/TetheringManager#TETHERING_WIFI:kotlin.Int), android.net.TetheringManager.TETHERING_USB, android.net.TetheringManager.TETHERING_BLUETOOTH, android.net.TetheringManager.TETHERING_WIFI_P2P, android.net.TetheringManager.TETHERING_NCM, android.net.TetheringManager.TETHERING_ETHERNET, or android.net.TetheringManager.TETHERING_VIRTUAL |

## Public methods

### build

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

```
open fun build(): TetheringManager.TetheringRequest
```

Build[TetheringRequest](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest)with the currently set configuration.

|                                                                             Return                                                                             ||
|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [TetheringManager.TetheringRequest](https://developer.android.com/reference/kotlin/android/net/TetheringManager.TetheringRequest) | This value cannot be`null`. |

### setSoftApConfiguration

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

```
open fun setSoftApConfiguration(softApConfig: SoftApConfiguration?): TetheringManager.TetheringRequest.Builder
```

Set the desired SoftApConfiguration for[TETHERING_WIFI](https://developer.android.com/reference/kotlin/android/net/TetheringManager#TETHERING_WIFI:kotlin.Int). If this is null or not set, then the persistent tethering SoftApConfiguration from android.net.wifi.WifiManager#getSoftApConfiguration() will be used.

<br />

If TETHERING_WIFI is already enabled and a new request is made with a different SoftApConfiguration, the request will be accepted if the device can support an additional tethering Wi-Fi AP interface. Otherwise, the request will be rejected.

<br />

Non-system callers using TETHERING_WIFI must specify a SoftApConfiguration.  
Requires android.Manifest.permission#TETHER_PRIVILEGED

|                                                                                    Parameters                                                                                    ||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `softApConfig` | [SoftApConfiguration](https://developer.android.com/reference/kotlin/android/net/wifi/SoftApConfiguration)?:SoftApConfiguration to use. This value may be`null`. |

|                                    Exceptions                                     ||
|--------------------------------------|---------------------------------------------|
| `java.lang.IllegalArgumentException` | if the tethering type isn't TETHERING_WIFI. |