SleepStages
Stay organized with collections
Save and categorize content based on your preferences.
Constants representing different sleep stages, such as light sleep, deep sleep. For a Session
with
type FitnessActivities.SLEEP
,
Sleep activities can be stored and read in sleep
segment
data type, for the same time range, to provide a a more detail breakdown
of a user's sleep stages in one sleep session.
Constant Summary
int |
AWAKE
|
The user is in an awake period in the middle of
sleep session. |
int |
OUT_OF_BED
|
The user is out of their bed in the middle of a
sleep session. |
int |
SLEEP
|
The user is sleeping. |
int |
SLEEP_DEEP
|
The user is in a deep sleep cycle. |
int |
SLEEP_LIGHT
|
The user is in a light sleep cycle. |
int |
SLEEP_REM
|
The user is in a REM sleep cycle. |
Inherited Method Summary
From class java.lang.Object
Constants
public static final int
AWAKE
The user is in an awake period in the middle of sleep session.
Constant Value:
1
public static final int
OUT_OF_BED
The user is out of their bed in the middle of a sleep session.
Constant Value:
3
public static final int
SLEEP
public static final int
SLEEP_DEEP
The user is in a deep sleep cycle.
Constant Value:
5
public static final int
SLEEP_LIGHT
The user is in a light sleep cycle.
Constant Value:
4
public static final int
SLEEP_REM
The user is in a REM sleep cycle.
Constant Value:
6
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eSleepStages\u003c/code\u003e class provides constants representing different sleep stages like light, deep, REM sleep, awake, and out-of-bed states during a sleep session.\u003c/p\u003e\n"],["\u003cp\u003eThese constants can be used with \u003ccode\u003eFitnessActivities.SLEEP\u003c/code\u003e sessions and \u003ccode\u003eTYPE_SLEEP_SEGMENT\u003c/code\u003e data type for detailed sleep analysis.\u003c/p\u003e\n"],["\u003cp\u003eEach sleep stage is represented by a unique integer constant (e.g., \u003ccode\u003eAWAKE\u003c/code\u003e, \u003ccode\u003eSLEEP_DEEP\u003c/code\u003e, \u003ccode\u003eSLEEP_REM\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSleepStages\u003c/code\u003e class inherits methods from the \u003ccode\u003ejava.lang.Object\u003c/code\u003e class, like \u003ccode\u003eequals\u003c/code\u003e, \u003ccode\u003ehashCode\u003c/code\u003e, and \u003ccode\u003etoString\u003c/code\u003e.\u003c/p\u003e\n"]]],["`SleepStages` defines constants for different sleep stages within a sleep session, recorded in `sleep segment` data types for `FitnessActivities.SLEEP` sessions. Key stages include `AWAKE` (1), `OUT_OF_BED` (3), `SLEEP` (2), `SLEEP_DEEP` (5), `SLEEP_LIGHT` (4), and `SLEEP_REM` (6). These constants represent user states during sleep, allowing detailed tracking of sleep patterns. They can be used for sleep analysis and a more detail breakdown of the user sleep.\n"],null,["# SleepStages\n\npublic final class **SleepStages** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nConstants representing different sleep stages, such as light sleep, deep sleep. For a\n[Session](/android/reference/com/google/android/gms/fitness/data/Session) with\ntype [FitnessActivities.SLEEP](/android/reference/com/google/android/gms/fitness/FitnessActivities#SLEEP),\nSleep activities can be stored and read in [sleep\nsegment](/android/reference/com/google/android/gms/fitness/data/DataType#TYPE_SLEEP_SEGMENT) data type, for the same time range, to provide a a more detail breakdown\nof a user's sleep stages in one sleep session. \n\n### Constant Summary\n\n|-----|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| int | [AWAKE](/android/reference/com/google/android/gms/fitness/data/SleepStages#AWAKE) | The user is in an awake period in the middle of sleep session. |\n| int | [OUT_OF_BED](/android/reference/com/google/android/gms/fitness/data/SleepStages#OUT_OF_BED) | The user is out of their bed in the middle of a sleep session. |\n| int | [SLEEP](/android/reference/com/google/android/gms/fitness/data/SleepStages#SLEEP) | The user is sleeping. |\n| int | [SLEEP_DEEP](/android/reference/com/google/android/gms/fitness/data/SleepStages#SLEEP_DEEP) | The user is in a deep sleep cycle. |\n| int | [SLEEP_LIGHT](/android/reference/com/google/android/gms/fitness/data/SleepStages#SLEEP_LIGHT) | The user is in a light sleep cycle. |\n| int | [SLEEP_REM](/android/reference/com/google/android/gms/fitness/data/SleepStages#SLEEP_REM) | The user is in a REM sleep cycle. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final int\n**AWAKE**\n\nThe user is in an awake period in the middle of sleep session. \nConstant Value: 1 \n\n#### public static final int\n**OUT_OF_BED**\n\nThe user is out of their bed in the middle of a sleep session. \nConstant Value: 3 \n\n#### public static final int\n**SLEEP**\n\nThe user is sleeping. \nConstant Value: 2 \n\n#### public static final int\n**SLEEP_DEEP**\n\nThe user is in a deep sleep cycle. \nConstant Value: 5 \n\n#### public static final int\n**SLEEP_LIGHT**\n\nThe user is in a light sleep cycle. \nConstant Value: 4 \n\n#### public static final int\n**SLEEP_REM**\n\nThe user is in a REM sleep cycle. \nConstant Value: 6"]]