Health Connect Diagnostics
A snapshot of Health Connect diagnostic information for debugging purposes.
Obtain an instance via com.advantahealth.api.health.AFHealthTracking.getHealthConnectDiagnostics.
Sample usage:
lifecycleScope.launch {
val diagnostics = AFHealthTracking.getHealthConnectDiagnostics()
Log.d("HealthConnect", "Status: ${diagnostics.sdkStatus}")
Log.d("HealthConnect", "Granted: ${diagnostics.grantedPermissions}")
Log.d("HealthConnect", "Background read granted: ${diagnostics.backgroundReadAvailable}")
if (diagnostics.sdkStatus == HealthConnectAvailabilityStatus.PROVIDER_UPDATE_REQUIRED) {
// Show update prompt to the user
}
}Constructors
Properties
Whether the background-read permission has been granted.
The device Android API level.
Set of currently granted Health Connect permission strings.
Whether the history-read permission has been granted.
true when the SDK is HealthConnectAvailabilityStatus.AVAILABLE.
Whether Health Connect is a built-in framework module (Android 14+).
Set of required permission strings that have NOT been granted yet.
The Health Connect provider package name used for the check.
Installed version code of the Health Connect provider, or null if not installed.
Installed version name of the Health Connect provider, or null if not installed.
Current SDK availability status.