Overview

b.well Health SDK for Android

The b.well Kotlin SDK is a native Android library for building healthcare applications that connect to the b.well Connected Health platform. The SDK provides access to patient health data, user management, healthcare provider connections, and clinical workflows through an intuitive Kotlin-first API designed for Android development.

Choose the Kotlin SDK when you:

  • Are building a native Android application
  • Need direct access to b.well's APIs and FHIR-compliant health data
  • Want full control over your application's UI and user experience
  • Have an Android development team

Integration at a Glance

Integrating the b.well Kotlin SDK follows a straightforward pattern:

  1. Add the SDK dependency to your Android project (Gradle)
  2. Initialize the SDK with your client configuration
  3. Authenticate users using OAuth 2.0 token exchange [1]
  4. Access b.well services through SDK methods

The SDK handles token storage, refresh, and request authorization automatically. See the Identity Workflow Guide below for detailed initialization and authentication implementation.


Installation

Add the b.well Maven repository and SDK dependency to your Android project:

Step 1: Add the repository in your settings.gradle.kts:

repositories {
    google()
    mavenCentral()
    maven {
        url = uri("https://artifacts.icanbwell.com/repository/bwell-public/")
    }
}

Step 2: Add the SDK dependency in your app/build.gradle.kts:

dependencies {
    implementation("com.bwell:bwell-sdk-kotlin:1.12.3") // Check for latest version
}

Resources


Workflow & Configuration Guides

The Kotlin SDK provides comprehensive workflow guides organized by functional area. Each guide includes method details, request builders, and code examples.

Workflow GuidesDescription
Identity Workflows*SDK initialization, user authentication with OAuth 2.0 token exchange, and identity verification
User WorkflowsUser profile management including creating, updating, retrieving, and deleting user account data
Device WorkflowsDevice registration and deregistration for push notifications and app management
Consent WorkflowsManaging user consent preferences and retrieving consent records
Connection Search WorkflowsDiscovering and searching for healthcare data sources, providers, and resources
Connection Management WorkflowsEstablishing, managing, and removing connections to external healthcare data sources
Health Data WorkflowsAccessing patient health records including conditions, medications, labs, procedures, and clinical documents
Tasks WorkflowsRetrieving and updating user tasks and task completion status
Event Notification WorkflowsReal-time event handling and notifications for health data updates and user actions
Questionnaire WorkflowsDynamic questionnaire processing, response handling, and submission



SDK Architecture & Key Features

Builder Pattern for FHIR Requests

The SDK implements the builder pattern for constructing requests, simplifying the process of setting up FHIR (Fast Healthcare Interoperability Resources) search parameters. This approach allows you to incrementally set search terms in a readable and maintainable manner—particularly valuable for FHIR resources with numerous optional parameters.

BwellResult<T>: Unified Result Wrapper

All SDK operations return a BwellResult<T> wrapper that provides consistent, structured responses:

sealed class BwellResult<T> {  
    data class SingleResource<T>(  
        val data: T?,  
        val operationOutcome: OperationOutcome  
    ) : BwellResult<T>()  
    
    data class ResourceCollection<T>(  
        val data: List<T>?,  
        val pagingInfo: PagingInfo?,  
        val operationOutcome: OperationOutcome  
    ) : BwellResult<T>()  
}

Components:

  • data - The resource(s) returned from the operation
  • pagingInfo - Pagination details for navigating large data sets (collections only)
  • operationOutcome - Detailed FHIR operation outcomes for error handling and result interpretation

This design ensures every SDK operation returns consistent feedback, simplifying result handling and error management in your application. See SDK API Error Handling for details on interpreting operation outcomes.