# SkinTemperatureRecord

Artifact: [androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/records/SkinTemperatureRecord.kt+class:androidx.health.connect.client.records.SkinTemperatureRecord) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
class SkinTemperatureRecord : Record
```

<br />

*** ** * ** ***

Captures the skin temperature of a user. Each record can represent a series of measurements of temperature differences.

The ability to insert or read this record type is dependent on the version of HealthConnect installed on the device. To check if available: call `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_SKIN_TEMPERATURE()` as an argument. See further down for an example on how to read skin temperature.

```kotlin
import androidx.health.connect.client.HealthConnectFeatures
import androidx.health.connect.client.permission.HealthPermission
import androidx.health.connect.client.readRecord
import androidx.health.connect.client.records.SkinTemperatureRecord
import androidx.health.connect.client.request.ReadRecordsRequest
import androidx.health.connect.client.time.TimeRangeFilter

if (
    healthConnectClient.features.getFeatureStatus(
        HealthConnectFeatures.FEATURE_SKIN_TEMPERATURE
    ) == HealthConnectFeatures.FEATURE_STATUS_AVAILABLE
) {
    if (
        healthConnectClient.permissionController
            .getGrantedPermissions()
            .contains(HealthPermission.getReadPermission(SkinTemperatureRecord::class))
    ) {
        val response =
            healthConnectClient.readRecords(
                ReadRecordsRequest<SkinTemperatureRecord>(
                    timeRangeFilter = TimeRangeFilter.between(startTime, endTime)
                )
            )
        for (skinTemperatureRecord in response.records) {
            // Process each skin temperature record
        }
    } else {
        // Permission hasn't been granted. Request permission to read skin temperature.
    }
} else {
    // Feature is not available. It is not possible to read skin temperature.
}
```

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#startTime()`\>`https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#endTime()` or `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#deltas()` are not within the record time range or baseline is not within `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Companion#MIN_TEMPERATURE()`, `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Companion#MAX_TEMPERATURE()`. |

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Delta` Represents a skin temperature delta entry of `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord`. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#MEASUREMENT_LOCATION_FINGER() = 1` Skin temperature measurement was taken from finger. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#MEASUREMENT_LOCATION_TOE() = 2` Skin temperature measurement was taken from toe. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#MEASUREMENT_LOCATION_UNKNOWN() = 0` Use this if the location is unknown. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#MEASUREMENT_LOCATION_WRIST() = 3` Skin temperature measurement was taken from wrist. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/TemperatureDelta>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#TEMPERATURE_DELTA_AVG()` Metric identifier for retrieving the average skin temperature delta from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. |
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/TemperatureDelta>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#TEMPERATURE_DELTA_MAX()` Metric identifier for retrieving the maximum skin temperature delta from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. |
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/TemperatureDelta>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#TEMPERATURE_DELTA_MIN()` Metric identifier for retrieving the minimum skin temperature delta from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#SkinTemperatureRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.records.metadata.Metadata,kotlin.collections.List,androidx.health.connect.client.units.Temperature,kotlin.Int)( startTime: https://developer.android.com/reference/java/time/Instant.html, startZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?, endTime: https://developer.android.com/reference/java/time/Instant.html, endZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?, metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata, deltas: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Delta>, baseline: https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Temperature?, measurementLocation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Temperature?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#baseline()` Temperature in `https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Temperature` unit. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Delta>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#deltas()` a list of skin temperature `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Delta`. |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#endTime()` End time of the record. |
| `open https://developer.android.com/reference/java/time/ZoneOffset.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#endZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#endTime()`, or null if unknown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#measurementLocation()` indicates the location on the body from which the temperature reading was taken. |
| `open https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#metadata()` set of common metadata associated with the written record. |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#startTime()` Start time of the record. |
| `open https://developer.android.com/reference/java/time/ZoneOffset.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#startZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#startTime()`, or null if unknown. |

## Constants

### MEASUREMENT_LOCATION_FINGER

```
const val MEASUREMENT_LOCATION_FINGER = 1: Int
```

Skin temperature measurement was taken from finger.

### MEASUREMENT_LOCATION_TOE

```
const val MEASUREMENT_LOCATION_TOE = 2: Int
```

Skin temperature measurement was taken from toe.

### MEASUREMENT_LOCATION_UNKNOWN

```
const val MEASUREMENT_LOCATION_UNKNOWN = 0: Int
```

Use this if the location is unknown.

### MEASUREMENT_LOCATION_WRIST

```
const val MEASUREMENT_LOCATION_WRIST = 3: Int
```

Skin temperature measurement was taken from wrist.

## Public companion properties

### TEMPERATURE_DELTA_AVG

```
val TEMPERATURE_DELTA_AVG: AggregateMetric<TemperatureDelta>
```

Metric identifier for retrieving the average skin temperature delta from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_SKIN_TEMPERATURE()` as the argument.

### TEMPERATURE_DELTA_MAX

```
val TEMPERATURE_DELTA_MAX: AggregateMetric<TemperatureDelta>
```

Metric identifier for retrieving the maximum skin temperature delta from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_SKIN_TEMPERATURE()` as the argument.

### TEMPERATURE_DELTA_MIN

```
val TEMPERATURE_DELTA_MIN: AggregateMetric<TemperatureDelta>
```

Metric identifier for retrieving the minimum skin temperature delta from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_SKIN_TEMPERATURE()` as the argument.

## Public constructors

### SkinTemperatureRecord

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
SkinTemperatureRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    metadata: Metadata,
    deltas: List<SkinTemperatureRecord.Delta>,
    baseline: Temperature? = null,
    measurementLocation: Int = MEASUREMENT_LOCATION_UNKNOWN
)
```

| Parameters |
|---|---|
| `startTime: https://developer.android.com/reference/java/time/Instant.html` | Start time of the record. |
| `startZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?` | User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#startTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent. |
| `endTime: https://developer.android.com/reference/java/time/Instant.html` | End time of the record. |
| `endZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?` | User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#endTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent. |
| `metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata` | set of common metadata associated with the written record. |
| `deltas: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Delta>` | a list of skin temperature `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Delta`. If `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#baseline()` is set, these values are expected to be relative to it. Otherwise, they are deltas against an unspecified starting baseline. |
| `baseline: https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Temperature? = null` | Temperature in `https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Temperature` unit. Optional field, null by default. Valid range: 0-100 Celsius degrees. |
| `measurementLocation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = MEASUREMENT_LOCATION_UNKNOWN` | indicates the location on the body from which the temperature reading was taken. Optional field, `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#MEASUREMENT_LOCATION_UNKNOWN()` by default. Allowed values: `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Companion.SkinTemperatureMeasurementLocation`. Value is one of the following: - `0` - `1` - `2` - `3` <br /> |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### baseline

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val baseline: Temperature?
```

Temperature in `https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Temperature` unit. Optional field, null by default. Valid range: 0-100 Celsius degrees.

### deltas

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val deltas: List<SkinTemperatureRecord.Delta>
```

a list of skin temperature `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Delta`. If `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#baseline()` is set, these values are expected to be relative to it. Otherwise, they are deltas against an unspecified starting baseline.

### endTime

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val endTime: Instant
```

End time of the record.

### endZoneOffset

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val endZoneOffset: ZoneOffset?
```

User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#endTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.

### measurementLocation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val measurementLocation: Int
```

indicates the location on the body from which the temperature reading was taken. Optional field, `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#MEASUREMENT_LOCATION_UNKNOWN()` by default. Allowed values: `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord.Companion.SkinTemperatureMeasurementLocation`.

Value is one of the following:

- `0`
- `1`
- `2`
- `3`

<br />

### metadata

```
open val metadata: Metadata
```

set of common metadata associated with the written record.

### startTime

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val startTime: Instant
```

Start time of the record.

### startZoneOffset

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val startZoneOffset: ZoneOffset?
```

User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/SkinTemperatureRecord#startTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.