lightbulb_outline Please take our October 2018 developer survey. Start survey

WifiP2pDnsSdServiceRequest

public class WifiP2pDnsSdServiceRequest
extends WifiP2pServiceRequest

java.lang.Object
   ↳ android.net.wifi.p2p.nsd.WifiP2pServiceRequest
     ↳ android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest


A class for creating a Bonjour service discovery request for use with WifiP2pManager.addServiceRequest(WifiP2pManager.Channel, WifiP2pServiceRequest, WifiP2pManager.ActionListener) and WifiP2pManager.removeServiceRequest(WifiP2pManager.Channel, WifiP2pServiceRequest, WifiP2pManager.ActionListener)

Summary

Inherited constants

Public methods

static WifiP2pDnsSdServiceRequest newInstance()

Create a service discovery request to search all Bonjour services.

static WifiP2pDnsSdServiceRequest newInstance(String serviceType)

Create a service discovery to search for Bonjour services with the specified service type.

static WifiP2pDnsSdServiceRequest newInstance(String instanceName, String serviceType)

Create a service discovery request to get the TXT data from the specified Bonjour service.

Inherited methods

Public methods

newInstance

added in API level 16
public static WifiP2pDnsSdServiceRequest newInstance ()

Create a service discovery request to search all Bonjour services.

Returns
WifiP2pDnsSdServiceRequest service request for Bonjour.

newInstance

added in API level 16
public static WifiP2pDnsSdServiceRequest newInstance (String serviceType)

Create a service discovery to search for Bonjour services with the specified service type.

Parameters
serviceType String: service type. Cannot be null
"_afpovertcp._tcp."(Apple File Sharing over TCP)
"_ipp._tcp" (IP Printing over TCP)
"_http._tcp" (http service)

Returns
WifiP2pDnsSdServiceRequest service request for DnsSd.

newInstance

added in API level 16
public static WifiP2pDnsSdServiceRequest newInstance (String instanceName, 
                String serviceType)

Create a service discovery request to get the TXT data from the specified Bonjour service.

Parameters
instanceName String: instance name. Cannot be null.
"MyPrinter"

serviceType String: service type. Cannot be null.
e.g)
"_afpovertcp._tcp"(Apple File Sharing over TCP)
"_ipp._tcp" (IP Printing over TCP)

Returns
WifiP2pDnsSdServiceRequest service request for Bonjour.