Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
The builder for creating new DiscoveryRequest
objects.
Summary
Public constructors |
Creates a new default Builder object with given service type.
|
Public constructors
Builder
Builder(serviceType: String)
Creates a new default Builder
object with given service type.
Parameters |
serviceType |
String: This value cannot be null . |
Exceptions |
java.lang.IllegalArgumentException |
if serviceType is null or an empty string |
Public methods
setNetwork
fun setNetwork(network: Network?): DiscoveryRequest.Builder
Sets the Network
on which the discovery queries should be sent.
Parameters |
network |
Network?: the discovery network or null if the query should be sent on all supported networks |
setSubtype
fun setSubtype(subtype: String?): DiscoveryRequest.Builder
Sets the optional subtype of the services to be discovered. If a non-empty subtype
is specified, it must start with underscore ('_') and have the trailing "._sub" removed. Otherwise, android.net.nsd.NsdManager#discoverServices will fail with android.net.nsd.NsdManager#FAILURE_BAD_PARAMETER. For example, subtype
should be "_printer" for DNS name "_printer._sub._http._tcp". In this case, only services with this subtype
will be queried, rather than all services of the base service type. Note that a non-empty service type must be specified with #setServiceType if a non-empty subtype is specified by this method.
Parameters |
subtype |
String?: This value may be null . |
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 2024-06-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-18 UTC."],[],[]]