Skip to main content

Overview

The Synheart Session Kotlin SDK provides a native SessionEngine that captures heart rate data, computes session metrics on-device, and optionally fuses behavioral signals alongside HR data. The engine is timer-driven, emitting session frames at configurable intervals and delivering a session summary when complete. The SDK supports pluggable BiosignalProvider (for HR sources) and BehaviorProvider (for behavioral signals) via reflection-based wrappers.

Installation

Maven Central

Local Module

Requirements

  • Android API 21+
  • Kotlin 1.9+

Quick Start

Mock Mode (Development)

Real BLE Heart Rate Data

Health Connect Heart Rate Data

Session Configuration

SessionConfig

ComputeProfile

Session Events

The engine callback receives Map<String, Any> dictionaries with a "type" key.

session_started

session_frame

Contains flat metrics computed over the sliding window:

biosignal_frame

Emitted when includeRawSamples = true. Contains raw biosignal samples for live display:

session_summary

session_error

Error codes:

Behavioral Signals

The SessionEngine accepts an optional BehaviorProvider that fuses behavioral data into session frames.

Mock Behavior (Development)

Production (via synheart-behavior)

The "behavior" key is only present in frames when a BehaviorProvider is configured and returns data.

Architecture

Custom Provider

Any class implementing BiosignalProvider can drive the session engine:

API Reference

SessionEngine

Resources