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.
- 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.
Can I use Health Connect in my WearOS app?
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?
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.
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.
Additional parameters would be needed to assess sleep stages