Prerequisites
- An Android phone on Android 9 (API 28) or later. The emulator cannot take a reading.
minSdk 28, JVM 17, and Kotlin 2.1 or newer if your app uses Kotlin.- From NEUROFIT: a license key for your application id (Debug builds) and a download token.
- The pre-built flow ships in English (localize it).
Install
settings.gradle.kts
~/.gradle/gradle.properties
app/build.gradle.kts
settings.gradle), write credentials(PasswordCredentials) and content { includeGroup 'com.neurofit' },
with url = 'https://sdk.neurofit.app/maven'. vitals-sdk-ui brings Jetpack Compose (BOM 2026.06.01).
On CI, see Download token. Offline builds, your own repository or a source license:
Install from source or manually.
Camera usage
The AAR declaresCAMERA and marks the camera and flash optional, so there is nothing to add
(Manifest). The SDK needs no other permission.
Activate
Put the key in~/.gradle/gradle.properties as NEUROFIT_VITALS_LICENSE_KEY=<your license key>, out of git, and
pass it to BuildConfig:
app/build.gradle.kts
activate throws LicenseInvalid with a reason (reasons and fixes). A
debuggable build also accepts a key that does not list your application id, then returns and logs a warning,
because release builds refuse that key (Debug builds).
Option A: pre-built reading flow
VitalsReadingFlow composable as a full-screen destination with no app bar:
- The flow checks the device and asks for camera access itself, so you don’t need to request it first.
- One of
onComplete,onCancel,onErrorfires when the user leaves the flow (callbacks and options). - The Activity shows full screen in portrait by itself. The composable locks portrait while shown. On large screens
Android may ignore that lock, so declare
configChangeson the activity that hosts the composable (Orientation and screen).
Option B: your own screens
Ask for camera access, subscribe to events, then callstart()
(Starting a session).
- Views
- Compose
stop() when the screen goes away, lock portrait and keep the screen on
(Orientation and screen). Every event:
Reading lifecycle.
Save the result
result.getHeartRateBpm(), getRmssdMs(), getSdnnMs(), getBreathingRateBrpm() (nullable) and
getBreathingRateConfidence(). Formats and storage: Result JSON. Display rules:
Presenting the numbers.