文档管理中心
我的
                                                                         关于近距离通信服务不再支持新的开发者注册的通知

    尊敬的开发者,您好!

    由于业务调整,我们将于2024年9月10日起不再支持新的开发者注册近距离通信服务,已开通近距离通信服务项目的开发者不受影响,仍可继续使用近距离通信服务,如有变更,我们会另行通知。感谢您的支持!

API参考近距离通信服务Androidcom.huawei.hms.nearby.messageClass SummaryMessagePicker

MessagePicker

展开

Class Info

public class MessagePicker implements Parcelable

定义消息过滤条件,在获取消息get过程中,只有符合此条件定义的目标消息会触发MessageHandler中的函数回调。

如果有多个过滤条件,不同条件间为逻辑或关系,符合任意一条条件的消息即会触发回调。

Nested Class Summary

展开

Qualifier and Type

Class Name and Description

static final class

MessagePicker.Builder

MessagePicker的构造类。

Public Field Summary

展开

Qualifier and Type

Field and Description

static final Parcelable.Creator<MessagePicker>

CREATOR

实现Parcelable接口必须提供的实例。

static final MessagePicker

INCLUDE_ALL_TYPES

此过滤条件为获取当前App所属开发者联盟项目下所有已发布的消息(包括App发布的消息和Beacon消息)。

Public Method Summary

展开

Qualifier and Type

Method Name and Description

int

describeContents()

返回当前Parcelable对象描述。

boolean

equals(Object object)

判断其他对象是否与本实例相同。

List<IBeaconInfo>

getBeaconInfo()

获取过滤条件内的iBeacon列表。

List<UidInstance>

getEddystoneUid()

获取过滤条件内的EddyStone UID列表。

boolean

getIncludeAll()

是否获取所有类型的消息。

List<NamespaceType>

getMsgType()

获取过滤条件内的域名及类型列表。

int

hashCode()

获取哈希值。

String

toString()

把对象转化成可读的字符串。

void

writeToParcel(Parcel dest, int flags)

序列化打包。

Public Fields

CREATOR

展开

Fields

public static final Parcelable.Creator<MessagePicker> CREATOR

实现Parcelable接口必须提供的实例。

INCLUDE_ALL_TYPES

展开

Fields

public static final MessagePicker INCLUDE_ALL_TYPES

此过滤条件为获取当前App所属开发者联盟项目下所有已发布的消息(包括App发布的消息和Beacon消息)。

Constant Value:"INCLUDE_ALL_TYPES"

Public Methods

describeContents

展开

Method

public int describeContents()

返回当前Parcelable对象描述。

Returns

展开

Type

Description

int

当前Parcelable对象描述。返回值如下:

  • 0:普通Parcelable对象。
  • 1:包含文件描述符的Parcelable对象。

equals

展开

Method

public boolean equals(Object object)

判断其他对象是否与本实例相同。

Parameters

展开

Name

Description

object

其他对象。

Returns

展开

Type

Description

boolean

  • true:相同。
  • false:不相同。

getBeaconInfo

展开

Method

public List<IBeaconInfo> getBeaconInfo()

获取过滤条件内的iBeacon列表。

Returns

展开

Type

Description

List<IBeaconInfo>

返回需过滤的IBeacon信标信息列表。

getEddystoneUid

展开

Method

public List<UidInstance> getEddystoneUid()

获取过滤条件内的EddyStone UID列表。

Returns

展开

Type

Description

List<UidInstance>

返回需过滤的EddyStone UID信标信息列表。

getIncludeAll

展开

Method

public boolean getIncludeAll()

是否获取所有类型的消息。

Returns

展开

Type

Description

boolean

  • true:是。
  • false:不是。

getMsgType

展开

Method

public List<NamespaceType> getMsgType()

获取过滤条件内的域名及类型列表。

Returns

展开

Type

Description

List<NamespaceType>

返回需过滤的域名及类型列表。

hashCode

展开

Method

public int hashCode()

获取哈希值。

Returns

展开

Type

Description

int

当前对象的哈希值。

toString

展开

Method

public String toString()

把对象转化成可读的字符串。

Returns

展开

Type

Description

String

MessagePicker对象的可读字符串。

writeToParcel

展开

Method

public void writeToParcel(Parcel dest, int flags)

序列化打包,把值写入dest容器。

Parameters

展开

Name

Description

dest

对象被写入的Parcel。

flags

写入方式,取值如下:

  • 0。
  • PARCELABLE_WRITE_RETURN_VALUE(详情查看Parcelable接口类)。