Sleep tracking apps on Android will soon consume less power and have fewer random issues

Android apps that need to run in the background, such as sleep trackers, have struggled. They have to contend with inconsistent and unreliable background app restrictions in various Android versions, which can interfere with the operation of the apps at a very fundamental level. Fortunately, Google is implementing a brand new Sleep API built directly into Google Play services. Sounds like it should fix that problem – at least for sleep tracking apps.

The API is built into the existing Activity Recognition suite, which (if you allow it) can automatically pick up the things you do based on the device sensors. That’s how things like Google Fit can determine whether you’re cycling, walking, or driving when it comes to tracking physical activity. Google is already using the Sleep API internally for the Google Clock bedtime mode.

So what does this change mean for you? Isn’t an API something technical that you as an end user don’t have to worry about? Well, it may have a measurable impact with some big benefits.

See, previously these sleep tracking apps had to run their own detection algorithms, watch device sensors with their own trained models and triggers to try to estimate when you sleep. That means that they are continuously active in the background to do those things. As I mentioned before, some smartphone makers are tweaking Android themselves in a way that cuts down on this behavior, and Google has already said it won’t really do anything about that. But this API means they don’t have to do that anymore; it’s all just built in. Smartphone manufacturers won’t mess with how Play Services works, because that’s something Google could do really worry so developers can trust this new API to work.

It also means that sleep tracking apps will make less of a dent in your battery life in the future. If Play Services is already doing all of these things in the background, there is no need to run an app in the background and do the same things in parallel and waste energy. This is easier and more efficient. Since many of these apps require the phone on your bed next to you to work, and since it can be tricky and confused to connect them that way, it means your phone will likely last until morning.

There’s one last reason we think this will make a difference: Urbandroid, the makers of Sleep as Android, are involved. That’s a big deal because Urbandroid is also behind Don’t Kill My App! And they’ve tracked the effect that background “optimizations” of apps have on developers. If they are involved, chances are change is a good thing. We contacted Urbandroid separately for more information and also for their take on the news, although a statement was attached to Google’s announcement:

Sleep as Android is a Swiss army knife for a better night’s sleep. It tracks sleep duration, regularity, phases, snoring and more. Sleep duration is one of the most important parameters to watch out for for a good night’s sleep. The new Sleep API gives us a fantastic opportunity to automatically track it in the most battery-efficient way you can imagine.

It remains to be seen how Google’s new Sleep API will perform in practice. Many of these sleep tracking apps consider their detection methods a trade secret, often an advertised benefit that their app has more than anyone else’s. Still, I’m optimistic that Google’s API should provide quality data to developers. And for us as consumers, that means better sleep tracking apps, longer battery life, and fewer unexplained problems.

Source