Skip to main content

Overview

The Synheart Behavior Kotlin/Android SDK provides real-time behavioral signal inference from digital interactions for native Android applications.

Installation

Add to your build.gradle:

Requirements

  • Android API 21+ (Android 5.0+)
  • Kotlin 1.9.0+
  • Gradle 8.0+

Quick Start

Basic Usage

Real-Time Event Tracking

Session Management

On-Demand Metrics Calculation

Calculate behavioral metrics for a custom time range within a session:
Note: The time range must be within the session’s start and end times. The SDK automatically validates this and will throw an error if the range is out of bounds.

API Reference

SynheartBehavior

Main Methods:

calculateMetricsForTimeRange()

Calculate behavioral metrics for a custom time range within a session. Parameters: Returns: Map<String, Any> - Map containing all behavioral metrics for the specified time range Throws: Exception if time range is out of session bounds or session not found Example:
Properties:

BehaviorConfig

Parameters:

BehaviorEvent

Properties: Event Types:
  • BehaviorEventType.SCROLL - Scroll interactions
  • BehaviorEventType.TAP - Tap interactions
  • BehaviorEventType.SWIPE - Swipe interactions
  • BehaviorEventType.APP_SWITCH - Foreground / background app-switch events
  • BehaviorEventType.NOTIFICATION - Notification events
  • BehaviorEventType.CALL - Call events
  • BehaviorEventType.TYPING - Typing session events (timing only — never characters)
  • BehaviorEventType.CLIPBOARD - Clipboard activity (copy / paste / cut counts only — never content)

BehaviorSession

Properties:

BehaviorSessionSummary

Properties:

BehavioralMetrics

Properties:

Typing: clipboard and correction rates

The typing session summary includes clipboardActivityRate and correctionRate, derived from backspace/copy/paste/cut event counts on the SDK. Use BehaviorEditText (or wire copy/paste/cut callbacks) so copy/paste/cut are reported. Cut is not counted as backspace.

Permissions

Notification Permission

Call Permission

Configuration

Update Configuration at Runtime

Note: Configuration can only be updated when no session is active.

View Attachment

To track gestures on specific views, attach the SDK to them:

Automatic Session Ending

Sessions are automatically ended after 1 minute if the app stays in the background. This prevents sessions from running indefinitely when users switch away from your app.

Resources

For comprehensive documentation, see the full README on GitHub.