com.samsung.android.sdk.healthdata

Interface HealthConstants.SleepStage

  • All Superinterfaces:
    HealthConstants.Common, HealthConstants.SessionMeasurement
    Enclosing class:
    HealthConstants


    public static interface HealthConstants.SleepStage
    extends HealthConstants.SessionMeasurement
    This interface defines the detailed sleep stage for the specified sleep data.

    Stages of sleep

    During sleep, the user's body alternates between two types of sleep: NREM (non-rapid eye movement) and REM (rapid eye movement) sleep.

    NREM sleep consists of the following stages: - Light: In light sleep, the user transits from wakefulness to sleep. The user's breading and heart rate become regular and the user's body temperature drops. - Deep: In deep sleep, the user becomes less responsive to the user's surroundings. The user's breathing slows and his/her muscles are more relaxed. This is the stage when the user's body restores and recharges itself.

    In REM sleep, the user's body is relaxed and immobile while the user's brain becomes more active and re-energizes itself for the next day. This is the stage when the majority of the user's dreams occur.

    Awake includes the times you wake up briefly and the periods the user is restless during a sleep.

    Sleep and Sleep Stage

    HealthConstants.Sleep includes only the start and end time of the user's sleep. SleepStage gives detailed sleep stage information with several sections for the specified Sleep data. The sleep stage can be presented as the following figure.

    Sleep #1

    Sleep data is saved as "Sleep #1" if HealthConstants.Sleep is used only.

    Sleep #2

    Otherwise, "Sleep #2" data that is composed of HealthConstants.Sleep and HealthConstants.SleepStage.
    It shows:

    • The user goes to bed at 23:30.
    • The his/her sleep stage is SLEEP_LIGHT for 23:30 ~ 00:40 of the next day.
    • The his/her sleep stage is SLEEP_DEEP for 00:40 ~ 02:00.
    • The his/her sleep stage is SLEEP_REM for 02:00 ~ 05:10.
    • The his/her sleep stage is SLEEP_AWAKE for 05:10 ~ 06:30.
    • He/she awakes at 06:30.

    Properties

    Properties of the following extending interfaces are available for this data type.

    Sleep stage data has the following properties.
    See more common properties by spreading this section out.

      Property name Description
      HealthConstants.SleepStage.DEVICE_UUID [Mandatory]
      Device identifier which provides the health data
      HealthConstants.SleepStage.START_TIME [Mandatory]
      UTC milliseconds when the measurement is started
      HealthConstants.SleepStage.END_TIME [Mandatory]
      UTC milliseconds after the measurement has ended
      HealthConstants.SleepStage.TIME_OFFSET [Mandatory]
      Time offset in milliseconds which considers the time zone and daylight saving time
      HealthConstants.SleepStage.SLEEP_ID [Mandatory]
      The specified sleep data's ID
      HealthConstants.SleepStage.STAGE [Mandatory]
      Sleep stage
      HealthConstants.SleepStage.CUSTOM Custom info which is formatted with JSON and compressed data

    Data Permission

    The user's consent is required to read or write this data type. HealthPermissionManager.requestPermissions() displays a data permission UI to the user.
    See Permission Manager and request data permission.
    Since:
    1.2.0
    See Also:
    HealthConstants.Sleep
    • Field Detail

      • SLEEP_ID

        static final String SLEEP_ID
        The specified sleep data's ID.

        Set this property with UUID of HealthConstants.Sleep.
        It's the ID of "Sleep #2" data in the example figure.

        • Mandatory
        • Type: String
        • Value length: 10 ~ 36

        Since:
        1.2.0
        See Also:
        Constant Field Values
      • STAGE_AWAKE

        static final int STAGE_AWAKE
        Awaken stage of sleep.
        STAGE_AWAKE includes the times you wake up briefly and the periods the user is restless during a sleep.
        Its constant value is 40001.
        Since:
        1.2.0
        See Also:
        STAGE, Constant Field Values
      • STAGE_LIGHT

        static final int STAGE_LIGHT
        Light stage of sleep.
        In STAGE_LIGHT, the user transits from wakefulness to sleep. The user's breading and heart rate become regular and the user's body temperature drops.
        Its constant value is 40002.
        Since:
        1.2.0
        See Also:
        STAGE, Constant Field Values
      • STAGE_DEEP

        static final int STAGE_DEEP
        Deep stage of sleep.
        In STAGE_DEEP, the user becomes less responsive to the user's surroundings. The user's breathing slows and his/her muscles are more relaxed. This is the stage when the user's body restores and recharges itself.
        Its constant value is 40003.
        Since:
        1.2.0
        See Also:
        STAGE, Constant Field Values
      • STAGE_REM

        static final int STAGE_REM
        REM (Rapid Eye Movement) stage of sleep.
        In STAGE_REM, the user's body is relaxed and immobile while the user's brain becomes more active and re-energizes itself for the next day. This is the stage when the majority of the user's dreams occur.
        Its constant value is 40004.
        Since:
        1.2.0
        See Also:
        STAGE, Constant Field Values
      • HEALTH_DATA_TYPE

        static final String HEALTH_DATA_TYPE
        Data type name for sleep stage data.
        Use "com.samsung.health.sleep_stage" to add permission to the manifest file.
        Since:
        1.2.0
        See Also:
        Constant Field Values