Language

NsdServiceInfo.Hostname Property

Definition

Get the hostname.

public string? Hostname { [Android.Runtime.Register("getHostname", "()Ljava/lang/String;", "", ApiSince=36)] get; }
[<get: Android.Runtime.Register("getHostname", "()Ljava/lang/String;", "", ApiSince=36)>]
member this.Hostname : string

Property Value

The hostname without the .local. suffix, or null if no hostname is available.

Attributes

Remarks

Get the hostname.

When a service is resolved through NsdManager#resolveService or NsdManager#registerServiceInfoCallback, this returns the hostname of the resolved service. Starting with T SDK extension 22, the registration callback also returns the hostname used for advertising. In other callback cases, this will be null. The top level domain ".local." is omitted. For example, this returns "MyHost" when the service's hostname is "MyHost.local.".

Java documentation for android.net.nsd.NsdServiceInfo.getHostname().

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