Get Device Provider Status

b.well Health SDK for Android

Retrieving Device Provider Status

Overview

The getDeviceProviderStatus method in the b.well SDK performs a lightweight, database-only check of whether a given connection is currently connected, without making an external network call to the provider itself.

Method Signature

suspend fun getDeviceProviderStatus(connectionId: String): BWellResult<DeviceProviderStatus>
  • connectionId: The identifier of the connection to check.
  • BWellResult<DeviceProviderStatus>: Contains connected, a boolean indicating whether the connection is active.

Example Usage

val result = BWellSdk.device.getDeviceProviderStatus(connectionId)
if (result.success() && result is BWellResult.SingleResource) {
    val isConnected = result.data?.connected
}

Best Practices

  • Use this method for quick UI status checks; it does not verify connectivity with the provider itself.
  • Ensure connectionId is non-blank before calling — a blank value returns an error result.

Did this page help you?