On smartphones, sleep tracking was traditionally a process initiated by a button tap, or by a hard timed trigger. Sleep as Android is different (read more here) – the app offers smart ways to track your sleep automatically similarly to what wearables and smart bands do — using your phone’s activity recognition system.
To configure the way how automatic sleep tracking should occur for you, go to Settings > Sleep tracking > Automatic sleep tracking
NOTE: If you do not see this option your phone probably does not support activity tracking in background.
Sleep time estimate
Settings > Sleep tracking > Sleep time estimate
Sleep time estimate uses Google Activity Transition API to check when you have most probably been asleep. No direct sleep tracking occurs with Sleep time estimate, so you’ll only get sleep duration tracked.
Every day when you didn’t track your sleep, you’ll receive a notification with a sleep time estimate.
You can configure the feature to just notify you with the Add action or make the app save sleep automatically to your sleep history.
Automatic start of tracking
Settings > Sleep tracking > Start sleep tracking
After fall asleep
Settings > Sleep tracking > Start sleep tracking > After fall asleep
Automatic start after fall asleep is a breakthrough method invented by Urbandroid which uses Google’s Activity Transition API as a base to detect when you’ve gone to bed to start sleep tracking.
How it works?
First, we need to find intervals when it is most probable that you’d be sleeping. By default, the interval we use is 8PM to 7AM, but this will shift over time to reflect your habits.
Because the algorithm learns from your typical patterns it is a good idea to help it from time to time and if you have the chance press the moon button just to give it an extra hint to improve accuracy.
There are several factors that play into how the intervals are found out:
a) Your activity
Google’s Activity Transition API
b) Your sleep history
We’re looking for regularities – for example “when do you usually go to sleep on Tuesdays”.
c) Your alarm
Setting an alarm gives the app a very important hint on when you might be sleeping. We subtract your ideal sleep time from your alarm time and check whether this time is +-4 hours from the interval suggested by the other factors.
We expect your sleep to be somewhere in this interval +/- an hour or two.
So when we have found out the most probable sleep interval, we can zoom in and look at your activity with a little more precision to find when exactly do you go to sleep.
Every 15 minutes during the previously detected “probable sleep interval”, we check the state of your phone in the Google Transition API, and if we detect a still state, we start a sleep tracking service, using whatever sensors you have configured (accelerometer, sonar, wearables, …).
Also every 15 minutes we do corrections based on your activity and either stop the current sleep tracking without saving or add awake intervals if we already track for long enough.
Automatic tracking attempts are stopped quickly (~half a minute) after we recognized you are probably still awake if one of the following holds:
- Awake-like activity on the phone sensor
- Your phone has screen on, is in upright orientation probably hold in hands as there is a subtle shake
- Awake-like activity on the watch sensor if smart watch is connected and in reach
- Noise recording (and snoring detection) is enabled and talking is detected
CAUTION: When using Sonar automatic sleep tracking (after fall asleep) only starts when the phone is charging. The reason for this is battery consumption which is usually high with sonar.
This way we get a pretty precise figures about your sleep even you did not manually initiated sleep tracking.
Settings > Sleep tracking > Start sleep tracking > Bedtime
The At bedtime is not that smart as After fall asleep. This option is useful for people with a fixed sleeping schedule who always go to sleep at the defined bedtime (your Alarm time – Ideal sleep duration).
Tracking is started at the same time bedtime notification is shown. If Bedtime notification is disabled tracking is started exactly at the actual bedtime minute.
Before smart period
Settings > Sleep tracking > Start sleep tracking > Smart period
The aim of this option is to start sleep tracking only to track the last sleep phase in order to wake you app using smart wake up in the best moment of your sleep. This is useful for people who do not what a full night’s sleep tracking but are just interested in the wake up experience. This approach will minimize resource consumption by sleep tracking.