Overview
The Synheart Behavior Kotlin/Android SDK provides real-time behavioral signal inference from digital interactions for native Android applications.Installation
Add to yourbuild.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: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:
BehaviorConfig
Parameters:
BehaviorEvent
Properties:
Event Types:
BehaviorEventType.SCROLL- Scroll interactionsBehaviorEventType.TAP- Tap interactionsBehaviorEventType.SWIPE- Swipe interactionsBehaviorEventType.APP_SWITCH- Foreground / background app-switch eventsBehaviorEventType.NOTIFICATION- Notification eventsBehaviorEventType.CALL- Call eventsBehaviorEventType.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 includesclipboardActivityRate 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
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
- JitPack: synheart-behavior-kotlin
- Repository: synheart-behavior-kotlin
- Full README: View on GitHub