DeviceManager

interface DeviceManager

It retrieves information about the devices that provide the health data stored in the Samsung Health app.

For instance, when a user measures their heart rate using the Samsung Health app on their Galaxy Watch paired with an Android phone, the data is automatically transferred from the watch to the phone and stored in the phone's Samsung Health app, with the watch listed as the source device for the data. You can later filter the data by various parameters, such as device ID, device type, and device manufacturer.

For example, to list all watches that provided the data stored in the Samsung Health app, you can use the following code.

val deviceManager = healthDataStore.getDeviceManager()
val devices = deviceManager.getDevices(DeviceGroup.WATCH)
devices.forEach { device ->
    val deviceId = device.id
    val deviceType = device.deviceType
    val deviceManufacturer = device.manufacturer
    val deviceModel = device.model
    val deviceName = device.name
}

Since

1.0.0

Functions

Link copied to clipboard
abstract suspend fun getDevice(deviceId: String): Device?

Retrieves the Device object corresponding to the specified device ID.

Link copied to clipboard
abstract fun getDeviceAsync(deviceId: String): AsyncSingleFuture<Device?>

Retrieves the Device object corresponding to the specified device ID. It works asynchronously using AsyncSingleFuture.

Link copied to clipboard
abstract suspend fun getDeviceBySeed(seed: String): Device?

Retrieves the Device object corresponding to the specified seed.

Link copied to clipboard

Retrieves the Device object corresponding to the specified seed. It works asynchronously using AsyncSingleFuture.

Link copied to clipboard
abstract suspend fun getDevices(deviceType: DeviceType): List<Device>

Retrieves a list of Devices that have provided the data stored in the Samsung Health app among the devices used, corresponding to specific DeviceType.

Link copied to clipboard

Retrieves a list of Devices that have provided the data stored in the Samsung Health app among the devices used, corresponding to specific DeviceType. It works asynchronously using AsyncSingleFuture.

Link copied to clipboard
abstract suspend fun getDevicesByManufacturer(manufacturer: String): List<Device>

Retrieves a list of Devices corresponding to the specific manufacturer that provide the data stored in the Samsung Health app.

Link copied to clipboard

Retrieves a list of Devices corresponding to the specific manufacturer that provide the data stored in the Samsung Health app. It works asynchronously using AsyncSingleFuture.

Link copied to clipboard
abstract suspend fun getDevicesByModel(model: String): List<Device>

Retrieves a list of Devices corresponding to the specific device model that provide the data stored in the Samsung Health app.

Link copied to clipboard

Retrieves a list of Devices corresponding to the specific device model that provide the data stored in the Samsung Health app. It works asynchronously using AsyncSingleFuture.

Link copied to clipboard
abstract suspend fun getLocalDevice(): Device

Retrieves the Device object that the Samsung Health app is running on.

Link copied to clipboard

Retrieves the Device object that the Samsung Health app is running on. It works asynchronously using AsyncSingleFuture.

Link copied to clipboard
abstract suspend fun getOwnDevices(): List<Device>

Retrieves a list of Devices registered by the app that calls it.

Link copied to clipboard

Retrieves a list of Devices registered by the app that calls it. It works asynchronously using AsyncSingleFuture.

Link copied to clipboard
abstract suspend fun registerDevice(request: DeviceRegistrationRequest): String

Registers a device as the source device that provided the health data.

Link copied to clipboard

Registers a device as the source device that provided the health data. It works asynchronously using AsyncSingleFuture.

Preferences Submitted

You have successfully updated your cookie preferences.