Language

PublishConfig.Builder.SetServiceName(String) Method

Definition

Specify the service name of the publish session.

[Android.Runtime.Register("setServiceName", "(Ljava/lang/String;)Landroid/net/wifi/aware/PublishConfig$Builder;", "", ApiSince=26)]
public Android.Net.Wifi.Aware.PublishConfig.Builder? SetServiceName(string serviceName);
[<Android.Runtime.Register("setServiceName", "(Ljava/lang/String;)Landroid/net/wifi/aware/PublishConfig$Builder;", "", ApiSince=26)>]
member this.SetServiceName : string -> Android.Net.Wifi.Aware.PublishConfig.Builder

Parameters

serviceName
String

The service name for the publish session. This value cannot be null.

Returns

The builder to facilitate chaining builder.setXXX(..).setXXX(..).

Attributes

Remarks

Specify the service name of the publish session. The actual on-air value is a 6 byte hashed representation of this string.

The Service Name is a UTF-8 encoded string from 1 to 255 bytes in length. The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric values (A-Z, a-z, 0-9), the hyphen ('-'), the period ('.') and the underscore ('_'). All valid multi-byte UTF-8 characters are acceptable in a Service Name.

For compatibility with devices running Android 11 or earlier, avoid underscores in service names.

Must be called - an empty ServiceName is not valid.

Android reference for android.net.wifi.aware.PublishConfig.Builder.setServiceName.

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