目录

DeviceClient

java.lang.Object

|---com.huawei.wearengine.device.DeviceClient

public final class DeviceClient
extends java.lang.Object

It is the client that is used to operate the device.

Method Summary

Modifier and Type

Method and Description

com.huawei.hmf.tasks.Task<java.lang.Integer>

getAvailableKbytes(Device device) Returns the available storage space (in KB) of a specified device.

com.huawei.hmf.tasks.Task<java.util.List<Device>>

getBondedDevices() Obtains the list of devices that have the app-to-app message communications capability and have been paired with the Huawei Health app.

com.huawei.hmf.tasks.Task<java.util.List<Device>>

getCommonDevice() Obtains the list of devices that have the Wear Engine capabilities and have been paired with the Huawei Health app.

com.huawei.hmf.tasks.Task<java.lang.String>

getHiLinkDeviceId(Device device) Returns the hiLinkDeviceId of the device.

com.huawei.hmf.tasks.Task<java.lang.Boolean>

hasAvailableDevices() Returns whether there is a device that supports Wear Engine and has been connected to the Huawei Health app.

com.huawei.hmf.tasks.Task<java.lang.Integer>

queryDeviceCapability(Device device, int capabilityID) Queries whether a specified device supports a specified capability set.

com.huawei.hmf.tasks.Task<java.lang.String>

getDeviceSn(Device device) Obtains the SN of the paired wearable device.

Method Detail

[h2]getBondedDevices

public com.huawei.hmf.tasks.Task<java.util.List<Device>> getBondedDevices()

It is used to obtain the list of devices that have the app-to-app message communications capability and have been paired with the Huawei Health app.

Returns:

A task is returned. You can call methods such as addOnSuccessListener and addOnFailureListener to check the task execution result.

Since:

API level 0 (SDK 5.0.0.301)

[h2]getCommonDevice

public com.huawei.hmf.tasks.Task<java.util.List<Device>> getCommonDevice()

It is used to obtain the list of devices that have the Wear Engine capabilities and have been paired with the Huawei Health app.

Returns:

A task is returned. You can call methods such as addOnSuccessListener and addOnFailureListener to check the task execution result.

Since:

API level 8 (SDK 5.0.2.306)

[h2]hasAvailableDevices

public com.huawei.hmf.tasks.Task<java.lang.Boolean> hasAvailableDevices()

It is used to return whether there is a device that supports Wear Engine and has been connected to the Huawei Health app.

Returns:

A task is returned. You can call methods such as addOnSuccessListener and addOnFailureListener to check the task execution result.

Since:

API level 0 (SDK 5.0.0.301)

[h2]getHiLinkDeviceId

public com.huawei.hmf.tasks.Task<java.lang.String> getHiLinkDeviceId(Device device)

It is used to return the hiLinkDeviceId of the device.

Parameters:

Parameter Name

Parameter Description

device

Device object specified by your app for communication.

Returns:

A task is returned. You can call methods such as addOnSuccessListener and addOnFailureListener to check the task execution result.

Since:

API level 2 (SDK 5.0.1.300)

[h2]getAvailableKbytes

public com.huawei.hmf.tasks.Task<java.lang.Integer> getAvailableKbytes(Device device)

It is used to return the available storage space (in KB) of a specified device.

Parameters:

Parameter Name

Parameter Description

device

Device object.

Returns:

A task is returned. You can call methods such as addOnSuccessListener and addOnFailureListener to check the task execution result.

Since:

API level 2 (SDK 5.0.1.300)

[h2]queryDeviceCapability

public com.huawei.hmf.tasks.Task<java.lang.Integer> queryDeviceCapability(Device device, int capabilityID)

It is used to query whether a specified device supports a specified capability set.

Returns:

A task is returned. You can call methods such as addOnSuccessListener and addOnFailureListener to check the task execution result.

Since:

API level 10 (SDK 5.0.2.309)

[h2]getDeviceSn

public com.huawei.hmf.tasks.Task<java.lang.String> getDeviceSn(Device device)

It is used to obtain the SN of the paired wearable device.

Returns:

A task is returned. You can call methods such as addOnSuccessListener and addOnFailureListener to check the task execution result.

Since:

API level 11 (SDK 5.0.2.310)