WifiP2pDnsSdServiceRequestpublic class WifiP2pDnsSdServiceRequest extends WifiP2pServiceRequest A class for creating a Bonjour service discovery request for use with
{@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest}
{@see WifiP2pManager}
{@see WifiP2pServiceRequest}
{@see WifiP2pUpnpServiceRequest} |
Constructors Summary |
---|
private WifiP2pDnsSdServiceRequest(String query)This constructor is only used in newInstance().
super(WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR, query);
| private WifiP2pDnsSdServiceRequest()This constructor is only used in newInstance().
super(WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR, null);
| private WifiP2pDnsSdServiceRequest(String dnsQuery, int dnsType, int version)
super(WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR, WifiP2pDnsSdServiceInfo.createRequest(
dnsQuery,
dnsType,
version));
|
Methods Summary |
---|
public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest | newInstance()Create a service discovery request to search all Bonjour services.
return new WifiP2pDnsSdServiceRequest();
| public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest | newInstance(java.lang.String serviceType)Create a service discovery to search for Bonjour services with the specified
service type.
if (serviceType == null) {
throw new IllegalArgumentException("service type cannot be null");
}
return new WifiP2pDnsSdServiceRequest(serviceType + ".local.",
WifiP2pDnsSdServiceInfo.DNS_TYPE_PTR,
WifiP2pDnsSdServiceInfo.VERSION_1);
| public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest | newInstance(java.lang.String instanceName, java.lang.String serviceType)Create a service discovery request to get the TXT data from the specified
Bonjour service.
if (instanceName == null || serviceType == null) {
throw new IllegalArgumentException(
"instance name or service type cannot be null");
}
String fullDomainName = instanceName + "." + serviceType + ".local.";
return new WifiP2pDnsSdServiceRequest(fullDomainName,
WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT,
WifiP2pDnsSdServiceInfo.VERSION_1);
|
|