Sleep tracking apps on Android will soon use less energy and have less random problems

Android apps that need to run in the background, like sleep trackers, have been through hard times. They suffer from inconsistent and unreliable limitations of background apps on different versions of Android, which can interfere with how apps work at a very fundamental level. Fortunately, Google is launching a new sleep API integrated into Google Play Services. It looks like you should fix this problem – at least, for sleep tracking apps, anyway.

The API is integrated with the existing activity recognition package, which (if you allow it) can automatically detect what you are doing based on the device’s sensors. That’s how things like Google Fit can determine whether you’re cycling, walking or driving when it comes to monitoring physical activity. Google already uses the Sleep API internally for Google Clock’s bedtime mode.

So what does this change mean to you – isn’t an API a technical thing that you, an end user, don’t have to worry about? Well, it can really have a measurable impact with some great benefits.

See, earlier, these sleep tracking apps had to run their own detection algorithms, watching the device’s sensors with their own trained models and triggers to try to estimate when you’re sleeping. This means that they are running continuously in the background to do these things. As I said before, some smartphone manufacturers adjust Android itself in a way that totally breaks this behavior, and Google has already said it will do nothing to fix it. But this API means that they won’t need it anymore; everything is integrated. Smartphone manufacturers will not interfere with the operation of Play Services because that is something that Google can in reality be upset, so that developers can count on the operation of this new API.

It also means that sleep tracking apps will have less impact on battery life in the future. If Play Services is already doing all of this in the background, having an application running in the background and doing the same things in parallel is redundant and wastes energy. This is simpler and more efficient. Since many of these apps need the phone in their bed next to them to work and how strange and complicated it can be to connect them this way, it means your phone is much more likely to last until morning.

There is one last reason why we think it will make a difference: Urbandroid, the creators of Sleep as Android, are involved. This is a big deal, because Urbandroid is also behind Don’t Kill My App! If they are involved, change is likely to be a good thing. We contacted Urbandroid separately for more information and their opinion on the news, although a statement was included with the Google announcement:

Sleep as Android is a Swiss Army knife for a better night’s sleep. It monitors sleep duration, regularity, phases, snoring and more. Sleep duration is one of the most important parameters to observe to ensure a good night’s sleep. The new sleep API gives us a fantastic opportunity to automatically track you in the most battery-efficient way possible.

It remains to be seen how Google’s new Sleep API will actually work in practice. Many of these sleep tracking apps consider their detection methods to be a kind of trade secret, often an advertised benefit that from them application has on someone else’s. Still, I am optimistic that the Google API should provide developers with high quality data. And for us, consumers, this means better sleep tracking apps with better battery life and less unexplained problems.

Source