Google launches the Android Sleep API, now available for apps

Android has long offered an activity recognition API that processes data from device sensors with battery-efficient machine learning models. Google is now offering an Android Sleep API to allow the creation of more wellness apps.

Much of what we do depends 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 aspects such as concentration and mental health.

Part of the broader Android Activity Recognition API, Google’s new Sleep API analyzes your phone’s light and motion sensors with an AI model on the device to generate two pieces of information:

  • A “sleep confidence”, which is reported at a regular interval (up to 10 minutes)
  • A daily sleep segment, which is reported after an awakening is detected

In offering this new tool, Google wants to prevent developers from “spending valuable engineering time to match the signals from the sensors to determine when the user initiated or ended activities such as sleeping,” noting how:

These detection algorithms are inconsistent across applications, and when multiple applications independently and continuously check for changes in user activity, battery life is affected.

End users will have to grant physical activity awareness runtime permission before applications can gain access to this data.

Google touts features similar to bedtime mode in the Android Clock app and in partnership with the Sleep As Android app for today’s launch:

The new sleep API gives us a fantastic opportunity to automatically track you in the most battery-efficient way possible.

Sleep As Android developers

Available with the latest version of Google Play Services on Android 10 and later, the Sleep API can be used by developers now. Looking to the future, Google is “working more on this API and this area in the future”.

FTC: We use affiliate links for cars that generate revenue. Most.


Check out 9to5Google on YouTube for more news:

Source