Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder used to create TetheringRequest.
Summary
Public constructors |
Default constructor of Builder.
|
Public constructors
Builder
Builder(type: Int)
Default constructor of Builder.
Parameters |
type |
Int: Value is android.net.TetheringManager#TETHERING_WIFI , 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
setSoftApConfiguration
open fun setSoftApConfiguration(softApConfig: SoftApConfiguration?): TetheringManager.TetheringRequest.Builder
Set the desired SoftApConfiguration for TETHERING_WIFI
. If this is null or not set, then the persistent tethering SoftApConfiguration from android.net.wifi.WifiManager#getSoftApConfiguration() will be used.
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.
Non-system callers using TETHERING_WIFI must specify a SoftApConfiguration.
Requires android.Manifest.permission#TETHER_PRIVILEGED
Parameters |
softApConfig |
SoftApConfiguration?: SoftApConfiguration to use. This value may be null . |
Exceptions |
java.lang.IllegalArgumentException |
if the tethering type isn't TETHERING_WIFI. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[],[],null,["# TetheringManager.TetheringRequest.Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/TetheringManager.TetheringRequest.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.TetheringManager.TetheringRequest.Builder](#) |\n\nBuilder used to create TetheringRequest.\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.Int))`(`type:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Default constructor of Builder. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [TetheringManager.TetheringRequest](/reference/kotlin/android/net/TetheringManager.TetheringRequest) | [build](#build())`()` Build [TetheringRequest](/reference/kotlin/android/net/TetheringManager.TetheringRequest) with the currently set configuration. |\n| open [TetheringManager.TetheringRequest.Builder](#) | [setSoftApConfiguration](#setSoftApConfiguration(android.net.wifi.SoftApConfiguration))`(`softApConfig:` `[SoftApConfiguration](/reference/kotlin/android/net/wifi/SoftApConfiguration)?`)` Set the desired SoftApConfiguration for [TETHERING_WIFI](/reference/kotlin/android/net/TetheringManager#TETHERING_WIFI:kotlin.Int). |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(type: Int)\n```\n\nDefault constructor of Builder.\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `type` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.net.TetheringManager#TETHERING_WIFI](/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 |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun build(): TetheringManager.TetheringRequest\n```\n\nBuild [TetheringRequest](/reference/kotlin/android/net/TetheringManager.TetheringRequest) with the currently set configuration.\n\n| Return ||\n|------------------------------------------------------------------------------------------------------|------------------------------|\n| [TetheringManager.TetheringRequest](/reference/kotlin/android/net/TetheringManager.TetheringRequest) | This value cannot be `null`. |\n\n### setSoftApConfiguration\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setSoftApConfiguration(softApConfig: SoftApConfiguration?): TetheringManager.TetheringRequest.Builder\n```\n\nSet the desired SoftApConfiguration for [TETHERING_WIFI](/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.\n\n\u003cbr /\u003e\n\nIf 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.\n\n\u003cbr /\u003e\n\nNon-system callers using TETHERING_WIFI must specify a SoftApConfiguration. \nRequires android.Manifest.permission#TETHER_PRIVILEGED\n\n| Parameters ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `softApConfig` | [SoftApConfiguration](/reference/kotlin/android/net/wifi/SoftApConfiguration)?: SoftApConfiguration to use. This value may be `null`. |\n\n| Exceptions ||\n|--------------------------------------|---------------------------------------------|\n| `java.lang.IllegalArgumentException` | if the tethering type isn't TETHERING_WIFI. |"]]