Google recently released Sleep API for developers to determine the user’s sleep status and feed it back to the application. In this way, it is not necessary for App developers to develop the sleep detection function by themselves, just call the API directly.
The sleep API has been officially pushed and is included in the latest update of Google Play Google services. According to Google’s official description, Sleep API is a simple service that performs sleep state detection in a power-saving way and is part of Google’s motion recognition API.
Google declared that sleep quality is very important to users. By using smartphones to record sleep habits, it can help people better plan their daily lives and remind users to pay attention to health.
Sleep API will use the device learning module of the smartphone to determine the user’s sleep state by collecting data such as light sensors and acceleration sensors. Google said that the data given by this API is more reliable, more power-efficient, and more compatible than third-party App self-developed tools.
Sleep API provides two reporting methods:
- Report sleep status every 10 minutes
- Report after detecting user wake up
(Source)