How to collect Sleep Cycle/Sleep Stages in standalone WearOS application?

109 views Asked by At

My task: collecting information about sleep stages (AWAKE, SLEEPING, DEEP and etc.) in a standalone WearOS application.

We currently use Health Services to collect information about steps, distance, and calories. I didn't find any information about collecting sleep information in the official documentation for Health Services.

  1. Can Health Services be used to collect sleep information?

I found information about sleep stages on Health Connect. Here is how you can read and write this information.

  1. Can I use Health Connect in my WearOS app?

  2. Is it necessary to analyze some parameters to determine the stage of sleep? How to do this automatically?

And my common question: How to collect Sleep Cycle/Sleep Stages in standalone WearOS application?

1

There are 1 answers

0
Breana On
  1. Health Services can be used to detect UserActivityState, which can tell you if a user is asleep. It doesn't provide details on sleep stages.

  2. Health Connect cannot be used in a standalone Wear OS app and is specific to a mobile device. To have Health Connect interaction with a Wear OS app, it would need to be facilitated through an accompanying mobile app.

  3. Additional parameters would be needed to assess sleep stages