# MindfulnessSessionRecord

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/MindfulnessSessionRecord.kt+class:androidx.health.connect.client.records.MindfulnessSessionRecord) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
class MindfulnessSessionRecord : Record
```

<br />

*** ** * ** ***

Captures any mindfulness session a user does. This can be mindfulness sessions like meditation, breathing.

Each record needs a start time and end time. Records don't need to be back-to-back or directly after each other, there can be gaps in between.

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_MINDFULNESS_SESSION()` as an argument.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_SESSION_TYPE_BREATHING() = 2` Guided breathing mindfulness session. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_SESSION_TYPE_MEDITATION() = 1` Meditation mindfulness session. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_SESSION_TYPE_MOVEMENT() = 4` Stretches/movement mindfulness session. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_SESSION_TYPE_MUSIC() = 3` Music/soundscapes mindfulness session. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_SESSION_TYPE_UNGUIDED() = 5` Unguided mindfulness session. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_SESSION_TYPE_UNKNOWN() = 0` Can be used to represent any generic mindfulness session that does not fall into a specific category. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://developer.android.com/reference/java/time/Duration.html>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_DURATION_TOTAL()` Metric identifier to retrieve the total mindfulness session duration 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/MindfulnessSessionRecord#MindfulnessSessionRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.records.metadata.Metadata,kotlin.Int,kotlin.String,kotlin.String)( 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, mindfulnessSessionType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, notes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/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/MindfulnessSessionRecord#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/MindfulnessSessionRecord#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#toString()()` |

| ### Public properties |
|---|---|
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#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/MindfulnessSessionRecord#endZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#endTime()`, or null if unknown. |
| `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/MindfulnessSessionRecord#metadata()` Set of common metadata associated with the written record. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#mindfulnessSessionType()` Type of mindfulness session (e.g. meditation, breathing, including unknown type). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#notes()` Additional notes for the session. |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#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/MindfulnessSessionRecord#startZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#title()` Title of the session. |

## Constants

### MINDFULNESS_SESSION_TYPE_BREATHING

```
const val MINDFULNESS_SESSION_TYPE_BREATHING = 2: Int
```

Guided breathing mindfulness session.

### MINDFULNESS_SESSION_TYPE_MEDITATION

```
const val MINDFULNESS_SESSION_TYPE_MEDITATION = 1: Int
```

Meditation mindfulness session.

### MINDFULNESS_SESSION_TYPE_MOVEMENT

```
const val MINDFULNESS_SESSION_TYPE_MOVEMENT = 4: Int
```

Stretches/movement mindfulness session.

### MINDFULNESS_SESSION_TYPE_MUSIC

```
const val MINDFULNESS_SESSION_TYPE_MUSIC = 3: Int
```

Music/soundscapes mindfulness session.

### MINDFULNESS_SESSION_TYPE_UNGUIDED

```
const val MINDFULNESS_SESSION_TYPE_UNGUIDED = 5: Int
```

Unguided mindfulness session.

### MINDFULNESS_SESSION_TYPE_UNKNOWN

```
const val MINDFULNESS_SESSION_TYPE_UNKNOWN = 0: Int
```

Can be used to represent any generic mindfulness session that does not fall into a specific category. Any unknown new value definition will also fall automatically into `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/MindfulnessSessionRecord#MINDFULNESS_SESSION_TYPE_UNKNOWN()`.

Use this type if the mindfulness session type is unknown.

## Public companion properties

### MINDFULNESS_DURATION_TOTAL

```
val MINDFULNESS_DURATION_TOTAL: AggregateMetric<Duration>
```

Metric identifier to retrieve the total mindfulness session duration 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_MINDFULNESS_SESSION()` as the argument.

## Public constructors

### MindfulnessSessionRecord

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

```
MindfulnessSessionRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    metadata: Metadata,
    mindfulnessSessionType: Int,
    title: String? = null,
    notes: String? = null
)
```

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### 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/IntervalRecord#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

```
open val metadata: Metadata
```

Set of common metadata associated with the written record.

### mindfulnessSessionType

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

```
val mindfulnessSessionType: Int
```

Type of mindfulness session (e.g. meditation, breathing, including unknown type).

Value is one of the following:

- `2`
- `1`
- `4`
- `3`
- `5`
- `0`

<br />

### notes

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

```
val notes: String?
```

Additional notes for the session.

### 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/IntervalRecord#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.

### title

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

```
val title: String?
```

Title of the session.