In one app I get accelerator sensor value each 30 sec in the background. Since Android M introduced Doze mode, in Doze mode all alarm won't work exactly except setAlarmClock()
. But if setAlarmClock()
with short time will disable Doze and make user angry with alarm icon.
setExactAndAllowWhileIdle()
is not the solution because it is 15 min exact.
I believe with Google Play service they can archive this in Fit API without setAlarmClock()
, collect accelerator sensor value and count user step (offline).