# 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)

*** ** * ** ***


```
public final class SkinTemperatureRecord implements 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/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/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/androidx/health/connect/client/records/SkinTemperatureRecord#startTime()`\>`https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#endTime()` or `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#deltas()` are not within the record time range or baseline is not within `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Companion#MIN_TEMPERATURE()`, `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Companion#MAX_TEMPERATURE()`. |

## Summary

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

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

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

| ### Public constructors |
|---|
| `https://developer.android.com/reference/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)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html startTime, https://developer.android.com/reference/java/time/ZoneOffset.html startZoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html endTime, https://developer.android.com/reference/java/time/ZoneOffset.html endZoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Delta> deltas, https://developer.android.com/reference/androidx/health/connect/client/units/Temperature baseline, int measurementLocation )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/health/connect/client/units/Temperature` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getBaseline()()` Temperature in `https://developer.android.com/reference/androidx/health/connect/client/units/Temperature` unit. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Delta>` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getDeltas()()` a list of skin temperature `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Delta`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getEndTime()()` End time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getEndZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#endTime()`, or null if unknown. |
| `final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getMeasurementLocation()()` indicates the location on the body from which the temperature reading was taken. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getMetadata()()` set of common metadata associated with the written record. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getStartTime()()` Start time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#getStartZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#startTime()`, or null if unknown. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#toString()()` |

## Constants

### MEASUREMENT_LOCATION_FINGER

```
public static final int MEASUREMENT_LOCATION_FINGER = 1
```

Skin temperature measurement was taken from finger.

### MEASUREMENT_LOCATION_TOE

```
public static final int MEASUREMENT_LOCATION_TOE = 2
```

Skin temperature measurement was taken from toe.

### MEASUREMENT_LOCATION_UNKNOWN

```
public static final int MEASUREMENT_LOCATION_UNKNOWN = 0
```

Use this if the location is unknown.

### MEASUREMENT_LOCATION_WRIST

```
public static final int MEASUREMENT_LOCATION_WRIST = 3
```

Skin temperature measurement was taken from wrist.

## Public fields

### TEMPERATURE_DELTA_AVG

```
public static final @NonNull AggregateMetric<@NonNull TemperatureDelta> TEMPERATURE_DELTA_AVG
```

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

### TEMPERATURE_DELTA_MAX

```
public static final @NonNull AggregateMetric<@NonNull TemperatureDelta> TEMPERATURE_DELTA_MAX
```

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

### TEMPERATURE_DELTA_MIN

```
public static final @NonNull AggregateMetric<@NonNull TemperatureDelta> TEMPERATURE_DELTA_MIN
```

Metric identifier for retrieving the minimum skin temperature delta from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/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)

```
public SkinTemperatureRecord(
    @NonNull Instant startTime,
    ZoneOffset startZoneOffset,
    @NonNull Instant endTime,
    ZoneOffset endZoneOffset,
    @NonNull Metadata metadata,
    @NonNull List<@NonNull SkinTemperatureRecord.Delta> deltas,
    Temperature baseline,
    int measurementLocation
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html startTime` | Start time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html startZoneOffset` | User experienced zone offset at `https://developer.android.com/reference/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. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html endTime` | End time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html endZoneOffset` | User experienced zone offset at `https://developer.android.com/reference/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. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata` | set of common metadata associated with the written record. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Delta> deltas` | a list of skin temperature `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Delta`. If `https://developer.android.com/reference/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. |
| `https://developer.android.com/reference/androidx/health/connect/client/units/Temperature baseline` | Temperature in `https://developer.android.com/reference/androidx/health/connect/client/units/Temperature` unit. Optional field, null by default. Valid range: 0-100 Celsius degrees. |
| `int measurementLocation` | indicates the location on the body from which the temperature reading was taken. Optional field, `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord#MEASUREMENT_LOCATION_UNKNOWN()` by default. Allowed values: `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Companion.SkinTemperatureMeasurementLocation`. Value is one of the following: - `0` - `1` - `2` - `3` <br /> |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getBaseline

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

```
public final Temperature getBaseline()
```

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

### getDeltas

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

```
public final @NonNull List<@NonNull SkinTemperatureRecord.Delta> getDeltas()
```

a list of skin temperature `https://developer.android.com/reference/androidx/health/connect/client/records/SkinTemperatureRecord.Delta`. If `https://developer.android.com/reference/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.

### getEndTime

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

```
public @NonNull Instant getEndTime()
```

End time of the record.

### getEndZoneOffset

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

```
public ZoneOffset getEndZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/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.

### getMeasurementLocation

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

```
public final int getMeasurementLocation()
```

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

### getMetadata

```
public @NonNull Metadata getMetadata()
```

set of common metadata associated with the written record.

### getStartTime

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

```
public @NonNull Instant getStartTime()
```

Start time of the record.

### getStartZoneOffset

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

```
public ZoneOffset getStartZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/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.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```