Package-level declarations

Types

Link copied to clipboard

Represents a self-assessed description (look and feel) of the cervical mucus for a user.

Link copied to clipboard
data class KHCyclingPedalingCadenceSample(val revolutionsPerMinute: Double, val time: Instant)

Represents a single measurement of KHRecord.CyclingPedalingCadence.

Link copied to clipboard
interface KHealth

KHealth is a Kotlin Multiplatform wrapper around Android's Health Connect and Apple's HealthKit APIs. It provides a set of convenient properties and methods to perform most common operations easily (like checking/requesting permissions, reading/writing data, and more).

Link copied to clipboard

Automatically initializes KHealthContext with the application context upon app launch.

Link copied to clipboard

Depicts the category of KHRecord.Exercise that the user is performing.

Link copied to clipboard
data class KHHeartRateSample(val beatsPerMinute: Long, val time: Instant)

Represents a single measurement of the heart rate (KHRecord.HeartRate).

Link copied to clipboard

The type of food that the KHRecord.Nutrition object represents.

Link copied to clipboard

Refers to the pattern or characteristics of menstrual bleeding, such as light, moderate, or heavy flow, and its duration and consistency throughout the cycle.

Link copied to clipboard

An ovulation test checks for a rise in a hormone called luteinizing hormone (LH) in your urine, which happens just before ovulation.

Link copied to clipboard
sealed class KHPermission

Depicts an instance of the app's request to the operating system to provide it with the access to read and/or write a particular kind of data from/to the health store.

Link copied to clipboard
data class KHPowerSample(val unit: KHUnit.Power, val value: Double, val time: Instant)

Represents a single measurement of power. For example, using a power meter when exercising on a stationary bike.

Link copied to clipboard
sealed class KHReadRequest<T : KHRecord>

Represents the kind of KHRecord the app wants to read.

Link copied to clipboard
sealed class KHRecord

Represents a readable or writable entity.

Link copied to clipboard

Captures the sleep stage the user entered during a sleep session.

Link copied to clipboard
data class KHSleepStageSample(val stage: KHSleepStage, val startTime: Instant, val endTime: Instant)

Represents a single measurement of KHRecord.SleepSession.

Link copied to clipboard
data class KHSpeedSample(val unit: KHUnit.Velocity, val value: Double, val time: Instant)

Represents a single measurement of the speed, a scalar magnitude.

Link copied to clipboard
sealed class KHUnit

The measurement scale of various types of values.

Link copied to clipboard
sealed class KHWriteResponse

Depicts the kind of response from the health store when a KHRecord is written onto it. The transaction can either Success completely, Fail completely, or Fail partially.

Link copied to clipboard
data class NoWriteAccessException(forPermission: String? = null) : Exception

Functions

Link copied to clipboard
fun Set<KHPermission>.allGranted(vararg permissions: KHPermission): Boolean

Checks whether all requested permissions in permissions are granted in this set.

Link copied to clipboard

Factory function to create a KHealth instance in common code.

Link copied to clipboard
suspend fun KHealth.hasPermission(permission: KHPermission): Boolean

Checks directly on KHealth if a specific permission is granted.

Link copied to clipboard
suspend fun KHealth.hasPermissions(vararg permissions: KHPermission): Boolean

Checks directly on KHealth if all specified permissions are granted.

Link copied to clipboard

Checks whether the given permission is granted in this Set of permissions.

Link copied to clipboard
actual fun KHealth(): KHealth

Creates a KHealth instance on Android using auto-detected application context.

fun KHealth(context: Context): KHealth

Creates a KHealth instance on Android using the provided Context.

Creates a KHealth instance on Android bound to the given ComponentActivity.

actual fun KHealth(): KHealth

Creates a platform-appropriate instance of KHealth.

expect fun KHealth(): KHealth

Creates a platform-appropriate instance of KHealth.

Link copied to clipboard

Checks whether this granted permission satisfies all requested capabilities in requested.