Hi all,
I tried UrsAI2KeepAlive extension and it's working fine using Pedometer (i.e.), but when trying to use it with Accelerometer sensor then it's not working. I mean, when the app is in background (kept alive by the UrsAI2KeepAlive extension), Accelerometer events seem to not work. My app's goal is to generate an alarm sound (text-to-speech) when mobile is being shaken (Accelerometer zAccel > threshold).
Welcome to the community
Probably it is the alarm sound, which does not work in the background? Did you try to store the zAccel values in TinyDB to find out, if the Accelerometer works in the background?
You also can try to remove battery optimization in the settings of the app to see if this makes a difference. .
Hi Taifun, thanks for your answer!
Alarm sound works with Pedometer events, so I guess this is not the problem.
I've checked that Accelerometer.AccelerationChange Event doesn't work in background.