java.lang.Object | |
↳ | android.net.NetworkRequest.Builder |
Builder used to create NetworkRequest
objects. Specify the Network features
needed in terms of NetworkCapabilities
features
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor for Builder.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add the given capability requirement to this builder.
| |||||||||||
Adds the given transport requirement to this builder.
| |||||||||||
Build
NetworkRequest give the current set of capabilities.
| |||||||||||
Removes (if found) the given capability from this builder instance.
| |||||||||||
Removes (if found) the given transport from this builder instance.
| |||||||||||
Sets the optional bearer specific network specifier.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Add the given capability requirement to this builder. These represent
the requested network's required capabilities. Note that when searching
for a network to satisfy a request, all capabilities requested must be
satisfied. See NetworkCapabilities
for NET_CAPABILITIY_*
definitions.
capability | The NetworkCapabilities.NET_CAPABILITY_* to add. |
---|
builder.addCapability(...).addCapability();
.
Adds the given transport requirement to this builder. These represent
the set of allowed transports for the request. Only networks using one
of these transports will satisfy the request. If no particular transports
are required, none should be specified here. See NetworkCapabilities
for TRANSPORT_*
definitions.
transportType | The NetworkCapabilities.TRANSPORT_* to add. |
---|
Build NetworkRequest
give the current set of capabilities.
Removes (if found) the given capability from this builder instance.
capability | The NetworkCapabilities.NET_CAPABILITY_* to remove. |
---|
Removes (if found) the given transport from this builder instance.
transportType | The NetworkCapabilities.TRANSPORT_* to remove. |
---|
Sets the optional bearer specific network specifier. This has no meaning if a single transport is also not specified, so calling this without a single transport set will generate an exception, as will subsequently adding or removing transports after this is set.
The interpretation of thisString
is bearer specific and bearers that use
it should document their particulars. For example, Bluetooth may use some sort of
device id while WiFi could used ssid and/or bssid. Cellular may use carrier spn.networkSpecifier | An String of opaque format used to specify the bearer
specific network specifier where the bearer has a choice of
networks.
|
---|