java.lang.Object |---com.huawei.wearengine.device.DeviceClient public final class DeviceClient extends java.lang.Object |
用于对设备进行操作的客户端。
Modifier and Type | Method and Description |
|---|---|
com.huawei.hmf.tasks.Task<java.lang.Integer> | getAvailableKbytes(Device device) 返回指定设备的可用存储空间千字节数(Kbytes) |
com.huawei.hmf.tasks.Task<java.util.List<Device>> | getBondedDevices() 获取已经和运动健康App配对的具有应用间消息通信能力的设备列表。 |
com.huawei.hmf.tasks.Task<java.util.List<Device>> | getCommonDevice() 获取已经和运动健康App配对的具有Wear Engine能力的设备列表。 |
com.huawei.hmf.tasks.Task<java.lang.String> | getHiLinkDeviceId(Device device) 返回设备的hiLinkDeviceId。 |
com.huawei.hmf.tasks.Task<java.lang.Boolean> | hasAvailableDevices() 返回是否有支持WearEngine且处于连接状态的设备。 |
com.huawei.hmf.tasks.Task<java.lang.Integer> | queryDeviceCapability(Device device, int capabilityID) 查询指定设备是否支持指定能力集。 |
com.huawei.hmf.tasks.Task<java.lang.String> | getDeviceSn(Device device) 获取已配对穿戴设备的序列号。 |
public com.huawei.hmf.tasks.Task<java.util.List<Device>> getBondedDevices()
获取已经和运动健康App配对的具有应用间消息通信能力的设备列表。
Returns:
返回一个任务,开发者可以调用任务的addOnSuccessListener和addOnFailureListener等方法来检查任务执行的结果
Since:
API level 0 (SDK 5.0.0.301)
public com.huawei.hmf.tasks.Task<java.util.List<Device>> getCommonDevice()
获取已经和运动健康App配对的具有Wear Engine能力的设备列表。
Returns:
返回一个任务,开发者可以调用任务的addOnSuccessListener和addOnFailureListener等方法来检查任务执行的结果
Since:
API level 8 (SDK 5.0.2.306)
public com.huawei.hmf.tasks.Task<java.lang.Boolean> hasAvailableDevices()
返回是否有支持WearEngine且处于连接状态的设备。
Returns:
返回一个任务,开发者可以调用任务的addOnSuccessListener和addOnFailureListener等方法来检查任务执行的结果
Since:
API level 0 (SDK 5.0.0.301)
public com.huawei.hmf.tasks.Task<java.lang.String> getHiLinkDeviceId(Device device)
返回设备的hiLinkDeviceId。
Parameters:
Parameter Name | Parameter Description |
|---|---|
device | 三方应用指定的需要通信的设备对象 |
Returns:
返回一个任务,开发者可以调用任务的addOnSuccessListener和addOnFailureListener等方法来检查任务执行的结果
Since:
API level 2 (SDK 5.0.1.300)
public com.huawei.hmf.tasks.Task<java.lang.Integer> getAvailableKbytes(Device device)
返回指定设备的可用存储空间千字节数(Kbytes)
Parameters:
Parameter Name | Parameter Description |
|---|---|
device | 设备对象 |
Returns:
返回一个任务,开发者可以调用任务的addOnSuccessListener和addOnFailureListener等方法来检查任务执行的结果
Since:
API level 2 (SDK 5.0.1.300)
public com.huawei.hmf.tasks.Task<java.lang.Integer> queryDeviceCapability(Device device, int capabilityID)
查询指定设备是否支持指定能力集。
Returns:
返回一个任务,开发者可以调用任务的addOnSuccessListener和addOnFailureListener等方法来检查任务执行的结果
Since:
API level 10 (SDK 5.0.2.309)
public com.huawei.hmf.tasks.Task<java.lang.String> getDeviceSn(Device device)
获取已配对穿戴设备的序列号。
Returns:
返回一个任务,开发者可以调用任务的addOnSuccessListener和addOnFailureListener等方法来检查任务执行的结果
Since:
API level 11 (SDK 5.0.2.310)