Stay organized with collections
Save and categorize content based on your preferences.
NetworkSpecifier
abstract class NetworkSpecifier
Describes specific properties of a requested network for use in a NetworkRequest
. This as an abstract class. Applications shouldn't instantiate this class by themselves, but can obtain instances of subclasses of this class via other APIs.
Summary
Public constructors |
Create a placeholder object.
|
Public constructors
NetworkSpecifier
NetworkSpecifier()
Create a placeholder object. Please use subclasses of this class in a NetworkRequest
to request a network.
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,["# NetworkSpecifier\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nNetworkSpecifier\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/NetworkSpecifier \"View this page in Java\") \n\n```\nabstract class NetworkSpecifier\n```\n\n|---|-----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.NetworkSpecifier](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [EthernetNetworkSpecifier](/reference/kotlin/android/net/EthernetNetworkSpecifier), [L2capNetworkSpecifier](/reference/kotlin/android/net/L2capNetworkSpecifier), [TelephonyNetworkSpecifier](/reference/kotlin/android/net/TelephonyNetworkSpecifier), [WifiAwareNetworkSpecifier](/reference/kotlin/android/net/wifi/aware/WifiAwareNetworkSpecifier), [WifiNetworkSpecifier](/reference/kotlin/android/net/wifi/WifiNetworkSpecifier) |-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------| | [EthernetNetworkSpecifier](/reference/kotlin/android/net/EthernetNetworkSpecifier) | A [NetworkSpecifier](#) used to identify ethernet interfaces. | | [L2capNetworkSpecifier](/reference/kotlin/android/net/L2capNetworkSpecifier) | A [NetworkSpecifier](#) used to identify an L2CAP network over BLE. | | [TelephonyNetworkSpecifier](/reference/kotlin/android/net/TelephonyNetworkSpecifier) | NetworkSpecifier object for cellular network request. | | [WifiAwareNetworkSpecifier](/reference/kotlin/android/net/wifi/aware/WifiAwareNetworkSpecifier) | Network specifier object used to request a Wi-Fi Aware network. | | [WifiNetworkSpecifier](/reference/kotlin/android/net/wifi/WifiNetworkSpecifier) | Network specifier object used to request a Wi-Fi network. | |\n\nDescribes specific properties of a requested network for use in a [NetworkRequest](/reference/kotlin/android/net/NetworkRequest). This as an abstract class. Applications shouldn't instantiate this class by themselves, but can obtain instances of subclasses of this class via other APIs.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------|---|\n| [NetworkSpecifier](#NetworkSpecifier())`()` Create a placeholder object. |\n\nPublic constructors\n-------------------\n\n### NetworkSpecifier\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nNetworkSpecifier()\n```\n\nCreate a placeholder object. Please use subclasses of this class in a [NetworkRequest](/reference/kotlin/android/net/NetworkRequest) to request a network."]]