Get Device Providers
b.well Health SDK for Android
Retrieving Device Providers
Overview
The getDeviceProviders method in the b.well SDK retrieves the list of health data providers available for connection, along with each provider's connection status.
Method Signature
suspend fun getDeviceProviders(): BWellResult<DeviceProviderList>BWellResult<DeviceProviderList>: Containsproviders, a list of availableDeviceProviderentries.
Data Class: DeviceProvider
slug: Unique identifier for the provider.name: Human readable name of the provider.type: Either"cloud"(OAuth-based) or"mobile"(on-device sync).connected: Whether the current user already has an active connection to this provider.logoUrl: URL to the provider's logo image, if available.
Example Usage
val result = BWellSdk.device.getDeviceProviders()
if (result.success() && result is BWellResult.SingleResource) {
val providers = result.data?.providers.orEmpty()
// Display the list of providers, using `slug` to initiate a connection
}Best Practices
- Use
slugfrom aDeviceProviderentry as theconnectionId/sourceIdfor subsequent connection calls. - Re-fetch this list periodically, as provider availability can change.
Updated 13 days ago
Did this page help you?
