Posted by Nick Grayson, Product Manager

Illustration of phone with moon and Android logo on screen

Android functions ideal when it aids programmers produce applications that individuals enjoy. That’s why we are devoted to offering beneficial APIs like Activity Recognition which, with the customer’s authorization, can discover customer’s tasks (such as whether an individual is cycling or strolling) to aid applications offer contextually mindful experiences.

So a lot of what we do counts on an excellent evening’s remainder. Our phones have actually come to be excellent devices for making even more educated choices concerning our rest. And by being educated concerning rest behaviors, individuals can make much better choices throughout the day concerning rest, which influences points like focus as well as psychological wellness.

In an initiative to aid our individuals remain educated concerning their rest, we are making our Sleep API openly offered.

What is the Sleep API?

The Sleep API is an Android Activity Recognition API that surface areas details concerning the customer’s rest. It can be utilized to power attributes like the Bedtime setting in Clock.

This resting details is reported in 2 methods:

  1. A ‘sleep confidence’, which is reported at a routine period (approximately 10 mins)
  2. A day-to-day rest sector which is reported after a wakeup is discovered

The API makes use of an on-device expert system design that makes use of the tool’s light as well as movement sensing units as inputs.

As with every one of our Activity Recognition APIs, the application needs to be provided the Physical Activity Recognition runtime authorization from the customer to discover rest.

Why is this vital for programmers?

Developers invest beneficial design time to integrate sensing unit signals to figure out when the customer has actually begun or finished tasks like rest. These discovery formulas are irregular in between applications as well as when several applications individually as well as continually look for adjustments in customer task, battery life endures.

The Sleep API is a basic API that streamlines rest discovery handling in a battery-efficient way. For this launch, we are pleased to team up with Urbandroid, the designer of the preferred alarm system application, Sleep As Android

Android logo sleeping

Sleep as Android is a pocket knife for obtaining a much better evening’s remainder. It tracks rest period, uniformity, stages, snoring, as well as extra. Sleep Duration is among one of the most vital criteria to look for making sure an excellent evening’s remainder. The brand-new Sleep API provides us an amazing possibility to track it instantly in one of the most battery effective method you can possibly imagine.

– Sleep as Android Team

When can I begin utilizing this API?

The Sleep API is offered for programmers to make use of currently as component of the most up to date variation of Google Play Services.

This API is one action of our initiatives to aid our individuals obtain a much better evening’s remainder. We eagerly anticipate functioning extra on this API as well as in this field in the future.

If you have an interest in checking out or utilizing this API, look into our API Documentation.