Announcement: Low-Power Sleep Tracking on Android
That’s why we are dedicated to providing useful APIs like Activity Recognition which, with the user’s permission, can detect user’s activities (such as whether a user is biking or walking) to help apps provide contextually aware experiences.
So much of what we do relies on a good night's rest. Our phones have become great tools for making more informed decisions about our sleep. And by being informed about sleep habits, people can make better decisions throughout the day about sleep, which affects things like concentration and mental health.
In an effort to help our users stay informed about their sleep, we are making our Sleep API publicly available.
Source: Google enables low-power sleep tracking on AndroidThe Sleep API, once permitted by users, can use on-device artificial intelligence that uses the device’s light and motion sensors. Apps using the API will be able to use information such as device motion and ambient light level to tell whether a user has gone to sleep. The API also uses daily sleep segments which are reported whenever a wake-up is detected.
The Sleep API is now available for use as part of the latest version of Google Play Services. If you’re a developer you should head over to the API’s documentation to learn more about implementing it into your project.