Android Wellness framework documentation ‐ 15th September, 2025 - scopetech/Mobile-Public GitHub Wiki
Wellness SDK Documentation - v1.1.4 (13 Oct, 2025)
This document describes how ScopeTechnology framework "Wellness" works and how to integrate into your application. While the target audience is coders/developers, it brings better understanding for those who are not too tech-savvy as well.
1. Installation Guide
Following instructions will allow you to integrate our SDK into your application. Additionally, here is the demo sample app that you can follow while going through this document.
1.1. Overview
Wellness-Android enables developers to:
-
Launch a scanner screen with a camera feed to capture and analyze vital signs.
-
Receive updates through callback methods for vital signs, measurements, and images.
-
Manage and retrieve stored measurements using an integrated database.
1.2. Requirements
SDKs:
- Minimum SDK: Android 8.1 (API 27)
Permissions:
[!IMPORTANT] Mandatory permissions.
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="true"/>
<uses-feature android:name="android.hardware.camera.front" android:required="true"/>
[!IMPORTANT] Mandatory gradle settings.
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
Make sure you request Camera permission from the user before starting the measurements.
1.3. Integration
The library (SDK) is published on a private maven repository. Before you follow integration steps, make sure Scope Technologies has invited user (your GitHub dev account) to the repository with correct access. After that, developer will need to create GitHub personal access token (classic) with read permission to GitHub packages.
Step 1. Configure gradle.properties file
github_username=<GITHUB_USERNAME>
github_key=<PERSONAL_ACCESS_TOKEN>
Step 2. Add repository to your project in gradle.build (top-level) file
repositories {
maven {
url "https://maven.pkg.github.com/scopetech/Frameworks-Mobile"
credentials {
username = github_username
password = github_key
}
}
}
Step 3. Add dependecies to your project in gradle.build (module-level) file
implementation 'com.scopetechnology:wellness:1.1.4'
or it is part of consolidated SDK dependency:
implementation 'com.scopetechnology:sdk:1.0.5'
[!IMPORTANT] Always confirm that you are using latest version.
2. Wellness Initialization
2.1. Configuration
2.1.1. Initial Configuration
Before moving forward, make sure your ConnectedCar tenant settings have configured WellnessLicenseKey. If it is not configured, please contact Scope Support. On mobile app it can be received using BasePortalApi call:
BasePortalApi.getMobileSettings().result?.let { response ->
val licenseKey = response.wellnessLicenseKey
}
Once you have the KEY, you can use WellnessManager that handles - storing and retrieving the license key securely. It is suggested to call configure() in your Application class.
WellnessManager.retrieveInstance(applicationContext).configure(licenseKey)
To retrieve current key use:
WellnessManager.retrieveInstance(requireContext()).getLicenseKey()
To remove license key from the device, for instance, if user logs out:
WellnessManager.retrieveInstance(applicationContext).logout()
[!IMPORTANT] class WellnessActivity : WellnessBaseActivity()
Wellness framework handles the most of the work-load, so make sure you inherit the WellnessBaseActivity in your Activity.
You will now receive updates on following callbacks:
onVitalSign() = The vital sign results provided at the end of the measurement include both the vital sign values and the vital sign confidence levels.
onImage() = Receiving ImageData that needs to be passed down to Wellness SDK - we will calculate the validity of the image and handle the face detection logic.
onMeasurementSaved() = Measurements have been store locally in the SDK that you can later access to show history data.
onError() = Error type with reason what caused it.
onStop() = Make sure you call terminateSession() to clear up resources.
2.1.2. Demographics data
To make sure measurements are accurate, we need to provide demographics data. For privacy reasons, this data is only stored as long as the SDK is running. It is never sent to any 3rd party platforms. Usually this data would be gathered at onboarding flow once.
[!IMPORTANT] Use HealthUserData class
@Parcelize
data class HealthUserData(
var gender: GenderType = GenderType.MALE,
var smokerType: SmokerType = SmokerType.UNSPECIFIED,
var age: Int = DEFAULT_SUBJECT_AGE,
var height: Int = 175,
var weight: Int = 70
) : Parcelable
@Parcelize
enum class GenderType : Parcelable {
MALE,
FEMALE,
UNSPECIFIED
}
@Parcelize
enum class SmokerType : Parcelable {
SMOKER,
NON_SMOKER,
UNSPECIFIED
}
Once the HealthUserData object is filled with data, you should use
fun createIntent(context: Context, healthUserData: HealthUserData): Intent {
return Intent(context, WellnessActivity::class.java).apply {
putExtra(EXTRA_HEALTH_USER_DATA, healthUserData)
}
}
3. Retrieving past measurements
3.1. GetMeasurementsUseCase
To retrieve a list of all measurements done use:
val measurementRepository = MeasurementRepositoryImpl(
database = WellnessRoomDatabase.getInstance(app.applicationContext)
)
val getMeasurementUseCase = GetMeasurementsUseCase(measurementRepository)
viewModelScope.launch {
getMeasurementUseCase().collect { measurements ->
_allMeasurements.postValue(measurements)
}
}
This will return overall data for each measurement as:
data class Measurement(
val id: String,
val dateInMillis: String,
val wellnessScore: Int,
val heartRate: Int,
val breathingRate: Int,
val bloodOxygen: Int
)
3.2. GetMeasurementDetailsUseCase
If you decide to present a list of historical measurements, you might one to get more detailed information for each measurement. In this case, all you need to do is pass measurementId and use GetMeasurementDetailsUseCase.
val measurementRepository = MeasurementRepositoryImpl(
database = WellnessRoomDatabase.getInstance(app.applicationContext)
)
val getMeasurementDetailsUseCase = GetMeasurementDetailsUseCase(measurementRepository)
viewModelScope.launch {
measurementId?.let {
_measurementDetailsState.postValue(
_measurementDetailsState.value?.copy(
isLoading = false,
details = getMeasurementDetailsUseCase(measurementId = it).toMeasurementDetails(
context = app.applicationContext,
subjectAge = subjectAge
)
)
)
}
}
This will return overall data for each measurement as:
data class MeasurementDetails(
val id: String,
val name: String,
val shortDescription: String,
val longDescription: String,
val value: String,
private val subjectAge: Int
)
It also includes a lot of formatting helper functions that you can easily access based on your needs.