com.neurofit.vitals, Maven com.neurofit:vitals-sdk:1.0.0 (install),
minSdk 28, compileSdk 36, JVM 17, Kotlin 2.1 or newer, explicit API mode. PreviewView, LifecycleOwner,
ComponentActivity and Flow come from api dependencies (versions). The
optional com.neurofit:vitals-sdk-ui module is on Pre-built reading flow.
Java: VitalsSDK members are @JvmStatic, and support.hasTorch() reads the torch flag. events is a Kotlin
Flow, so Java apps use the pre-built flow.
Minor releases may add events, enum cases and error codes: keep an else -> branch in every when over SDK types
(Versioning).
VitalsSDK
activatechecks the key’sappsagainstcontext.packageName(Debug builds, reasons and fixes).requestCameraPermissionis the one call that shows the camera prompt, through a launcher it registers itself. When access is already granted,onResult(true)runs at once.- The callback belongs to the activity instance that asked: a recreation while the dialog shows (a rotation, a
split-screen resize) loses it. Lock the screen that asks and check
hasCameraPermissioninonResume, or use the AndroidXRequestPermissioncontract.
VitalsActivation
equals, hashCode and toString cover warnings, and building one activates nothing. In 1.0.0 the one warning
is a key that does not list your application id, accepted because the app is debuggable
(Debug builds). Java reads it with VitalsSDK.activate(context, key).getWarnings().
DeviceSupport
equals, hashCode and toString cover the three properties. Device support lists the reasons
and what hasTorch means.
VitalsSession
One session runs one reading. Create a new session for each reading screen withVitalsSDK.createSession.
start() throws only its preconditions:
A precondition failure leaves the session idle, so call
start() again once the cause is fixed. After a finished or
stopped session, create a new one. A camera that cannot be opened arrives as Failed(CameraUnavailable) after
start() returns (Starting a session).
VitalsEvent
equals, hashCode and toString, and no copy or componentN. When each
event arrives: Events.
Guidance
WEAK_PULSE_SIGNAL today (Positioning). The core SDK
ships no strings. The UI modules ship English defaults (VitalsStrings).
CancelReason
QUALITY_CHECK_FAILED comes only after MeasurementComplete (Finalizing).
LivePreview and LiveSignalQuality
VitalsResult. equals, hashCode and
toString cover the four properties of LivePreview and the two of LiveSignalQuality. Field meanings:
Live preview.
VitalsResult, SignalQuality and BreathingRateConfidence
VitalsResult is a final class. equals, hashCode and toString cover the eleven properties, and the public
constructor is for your tests and for results restored from your own storage. There is no serializer: store the
canonical keys (Result JSON). Field meanings and tiers: Metrics.
VitalsException
message is a short English sentence for your logs. Match on the subclass, and show your own text to users.
Threading
The collect block runs on the collector’s dispatcher, which is the main thread inlifecycleScope or
LaunchedEffect. VitalsSession.start and VitalsSDK.requestCameraPermission are @MainThread. Every other member
is safe from any thread. Frame processing runs in the background and never blocks the main thread.
ProGuard and R8
The AAR’sconsumer-rules.pro keeps the public API, the top-level package com.neurofit.vitals.* (not .**).
Everything else in the AAR is internal and may be shrunk and renamed. If your build ignores consumer rules, add:
-keepattributes SourceFile,LineNumberTable to your own rules.
Manifest
The AAR’s manifest declaresandroid.permission.CAMERA and marks android.hardware.camera and
android.hardware.camera.flash as required="false", so your app stays installable on devices without them
(deviceSupport reports at runtime). The SDK requests no other permission and does not use INTERNET.
vitals-sdk-ui adds one component, com.neurofit.vitals.ui.VitalsReadingFlowActivity (not exported, portrait), and
no permission.