Language

NsdManager.RegisterService Method

Definition

Overloads

Name Description
RegisterService(AdvertisingRequest, IExecutor, NsdManager+IRegistrationListener)

Register a service to be discovered by other services.

RegisterService(NsdServiceInfo, NsdProtocol, NsdManager+IRegistrationListener)

Register a service to be discovered by other services.

RegisterService(NsdServiceInfo, NsdProtocol, IExecutor, NsdManager+IRegistrationListener)

Register a service to be discovered by other services.

RegisterService(AdvertisingRequest, IExecutor, NsdManager+IRegistrationListener)

Register a service to be discovered by other services.

[Android.Runtime.Register("registerService", "(Landroid/net/nsd/AdvertisingRequest;Ljava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$RegistrationListener;)V", "", ApiSince=36)]
public void RegisterService(Android.Net.Nsd.AdvertisingRequest advertisingRequest, Java.Util.Concurrent.IExecutor executor, Android.Net.Nsd.NsdManager.IRegistrationListener listener);
[<Android.Runtime.Register("registerService", "(Landroid/net/nsd/AdvertisingRequest;Ljava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$RegistrationListener;)V", "", ApiSince=36)>]
member this.RegisterService : Android.Net.Nsd.AdvertisingRequest * Java.Util.Concurrent.IExecutor * Android.Net.Nsd.NsdManager.IRegistrationListener -> unit

Parameters

advertisingRequest
AdvertisingRequest

service being registered. This value cannot be null.

executor
IExecutor

Executor to run listener callbacks with. This value cannot be null.

listener
NsdManager.IRegistrationListener

The listener notifies of a successful registration and is used to unregister this service through a call on unregisterService(RegistrationListener). Cannot be null.

Attributes

Remarks

Register a service to be discovered by other services.

The function call immediately returns after sending a request to register service to the framework. The application is notified of a successful registration through the callback RegistrationListener.onServiceRegistered or a failure through RegistrationListener.onRegistrationFailed.

The application should call unregisterService(RegistrationListener) when the service registration is no longer required, and/or whenever the application is stopped.

Android reference for android.net.nsd.NsdManager.registerService.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RegisterService(NsdServiceInfo, NsdProtocol, NsdManager+IRegistrationListener)

Register a service to be discovered by other services.

[Android.Runtime.Register("registerService", "(Landroid/net/nsd/NsdServiceInfo;ILandroid/net/nsd/NsdManager$RegistrationListener;)V", "")]
public void RegisterService(Android.Net.Nsd.NsdServiceInfo? serviceInfo, Android.Net.Nsd.NsdProtocol protocolType, Android.Net.Nsd.NsdManager.IRegistrationListener? listener);
[<Android.Runtime.Register("registerService", "(Landroid/net/nsd/NsdServiceInfo;ILandroid/net/nsd/NsdManager$RegistrationListener;)V", "")>]
member this.RegisterService : Android.Net.Nsd.NsdServiceInfo * Android.Net.Nsd.NsdProtocol * Android.Net.Nsd.NsdManager.IRegistrationListener -> unit

Parameters

serviceInfo
NsdServiceInfo

The service being registered

protocolType
NsdProtocol

The service discovery protocol

listener
NsdManager.IRegistrationListener

The listener notifies of a successful registration and is used to unregister this service through a call on #unregisterService. Cannot be null. Cannot be in use for an active service registration.

Attributes

Remarks

Java documentation for android.net.nsd.NsdManager.registerService(android.net.nsd.NsdServiceInfo, int, android.net.nsd.RegistrationListener).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RegisterService(NsdServiceInfo, NsdProtocol, IExecutor, NsdManager+IRegistrationListener)

Register a service to be discovered by other services.

[Android.Runtime.Register("registerService", "(Landroid/net/nsd/NsdServiceInfo;ILjava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$RegistrationListener;)V", "", ApiSince=33)]
public void RegisterService(Android.Net.Nsd.NsdServiceInfo serviceInfo, Android.Net.Nsd.NsdProtocol protocolType, Java.Util.Concurrent.IExecutor executor, Android.Net.Nsd.NsdManager.IRegistrationListener listener);
[<Android.Runtime.Register("registerService", "(Landroid/net/nsd/NsdServiceInfo;ILjava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$RegistrationListener;)V", "", ApiSince=33)>]
member this.RegisterService : Android.Net.Nsd.NsdServiceInfo * Android.Net.Nsd.NsdProtocol * Java.Util.Concurrent.IExecutor * Android.Net.Nsd.NsdManager.IRegistrationListener -> unit

Parameters

serviceInfo
NsdServiceInfo

The service being registered. This value cannot be null.

protocolType
NsdProtocol

The service discovery protocol

executor
IExecutor

Executor to run listener callbacks with. This value cannot be null.

listener
NsdManager.IRegistrationListener

The listener notifies of a successful registration and is used to unregister this service through a call on unregisterService(RegistrationListener). Cannot be null.

Attributes

Remarks

Register a service to be discovered by other services.

The function call immediately returns after sending a request to register service to the framework. The application is notified of a successful registration through the callback RegistrationListener.onServiceRegistered or a failure through RegistrationListener.onRegistrationFailed.

The application should call unregisterService(RegistrationListener) when the service registration is no longer required, and/or whenever the application is stopped.

Android reference for android.net.nsd.NsdManager.registerService.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to