Google’s new Sleep API enables low-power sleep tracking on Android devices.
What you need to know
- Google is making its Sleep API publicly available.
- The API is used to power features like Bedtime mode in Google’s Clock app.
- Developers can now use the Sleep API as part of the latest Google Play Services.
Google has decided to make its Sleep API publicly available to help Android users stay informed about their sleep and allow developers to create great sleep tracking apps that have minimal impact on battery life. Most developers currently use detection algorithms that are inconsistent between apps. When multiple apps check for changes in user activity independently and continuously, your phone’s battery drains faster than usual.
Nick Grayson, Product Manager at Google, wrote in a blog post:
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.
The Sleep API is part of the Android Activity Recognition API, and generates information about the user’s sleep. It utilizes an on-device AI model that relies on the phone’s light and motion sensors as inputs to collect sleep information. The API reports the sleeping information to apps in two ways: a ’sleep confidence‘ at regular intervals of up to 10 minutes and a daily sleep segment reported after it detects a wakeup.
The first third-party app to use the Sleep API is Urbandroid’s Sleep As Android. It is worth noting, however, that apps won’t be able to detect sleep unless you grant the Physical Activity Recognition runtime permission. In the coming weeks, you can expect many more popular sleep tracking apps to start using the Sleep API.
Android Central – Android Forums, News, Reviews, Help and Android Wallpapers