SmartSpectra SDK
Android

Quick Start

Get started with the SmartSpectra Android SDK — Kotlin, min SDK 28.

This repo contains two build guides that produce similar user end states:

The only difference in builds is that the API key build gets up and running very fast, but hard-codes your API key. The OAuth build is more suitable for production deployments because it avoids hard-coding your API key.

Scope

These quickstarts intentionally request only:

  • SmartSpectraConfig.breathingMetrics
  • SmartSpectraConfig.cardioMetrics
  • MetricType.EXPRESSIONS

Please see the detailed documents for additional features.

Important Implementation Rules

Start by creating a new Android app project named Cool Vitals with package name com.example.coolvitals.

The Quick Start is intended so that the developer can replace app/src/main/java/com/example/coolvitals/MainActivity.kt as a full file.

  • Use SmartSpectraSdk.shared.
  • Use PreviewView with sdk.config.previewSurfaceProvider for native CameraX preview.
  • Disable bitmap preview frames with sdk.config.imageOutputEnabled = false.
  • Buffer trace samples locally before drawing charts.
  • Keep camera permission in the activity flow with ActivityResultContracts.RequestPermission().

Choose Your Guide

Use Option 1: API Key for the fastest manual setup.

Use Option 2: OAuth if you need OAuth.

Either way, an AI assistant connected to the SmartSpectra MCP Server can do the account side for you — fetch your API key, or register your package name and signing certificate fingerprint and download presage_services.xml.

LLM Insights

See LLM Insights for natural-language analysis of the measured vitals.

Logging

SDK log verbosity defaults to warnings and errors only. To change it, set logLevel on the config you pass to initialize:

val config = SmartSpectraConfig().apply {
    logLevel = SmartSpectraLogLevel.INFO
}
SmartSpectraSdk.initialize(context, config)

Levels are cumulative — DEBUG, INFO, WARNING (default), ERROR, NONE. The setting covers both the SDK's Kotlin-side logging and the native engine. DEBUG cannot restore debug-only statements compiled out of the release engine binary.

Supported Platforms

PlatformNotes
Google Pixel 3 / 3 XLTested on Pixel 9, 10
Samsung Galaxy S21Tested on A16, S21, Galaxy Flip 6
Motorola Edge 30 Ultra

For support: contact support@presagetech.com or submit a GitHub issue.

On this page