We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesWear EngineAPIs for Android Phones (JAVA)com.huawei.wearengine.p2pClassMessage.Builder

Message.Builder

java.lang.Object

|---com.huawei.wearengine.p2p.Message.Builder

Collapse
Word wrap
Dark theme
Copy code
  1. public static class Message.Builder
  2. extends java.lang.Object

It is the building class in Message.

Method Summary

Expand

Modifier and Type

Method and Description

Message

build() Indicates the builder for Message.

Message.Builder

setDescription(java.lang.String description) Sets description.

Message.Builder

setPayload(byte[] sourceData) Sets the data to be transmitted.

Message.Builder

setPayload(java.io.File sourceFile) Sets the file to be transferred.

Constructor Detail

Builder

public Builder()

Since:

API level 0 (SDK 5.0.0.301)

Method Detail

setPayload

public Message.Builder setPayload(byte[] sourceData)

It is used to set the data to be transmitted.

Parameters:

Expand

Parameter Name

Parameter Description

sourceData

Data to be transmitted.

Returns:

Built object in Message.

Since:

API level 0 (SDK 5.0.0.301)

setPayload

public Message.Builder setPayload(java.io.File sourceFile)

It is used to set the files to be transferred.

Parameters:

Expand

Parameter Name

Parameter Description

sourceFile

File to be transferred.

Returns:

Built object in Message.

Since:

API level 0 (SDK 5.0.0.301)

setDescription

public Message.Builder setDescription(java.lang.String description)

It is used to set the description of a file.

This API takes effect only when a file is being sent and does not need to be called when a message is being sent. Even if Description has been set for sending a message, the value of Description cannot be obtained using getDescription when the message is being sent.

Parameters:

Expand

Parameter Name

Parameter Description

description

Description to be set.

Returns:

Built object in Message.

Since:

API level 0 (SDK 5.0.0.301)

build

public Message build()

It indicates the builder for Message.

Returns:

Message

Since:

API level 0 (SDK 5.0.0.301)