Android Pebble Accelerometer - setting alarm if there is no movement

80 Views Asked by At

I am currently working on an Android application that should set an alarm if there is no movement for 20 seconds.

But I totally have no idea how to solve that problem and I am looking for some ideas how to solve it?! If I am right the Pebble is only sending data if there are movements.

I would be very greatful to get some tips for solving my problem.

Thanks.

1

There are 1 best solutions below

0
The Resetter On

Your requirement appears straightforward enough.

You set a timer for 'x' seconds, then if the timer expires, you can set the alarm.

If, however, there is movement, you can reset the timer for another 'x' seconds in the acceleration callback. If there is constant movement, then the timer will never expire, so no alarm.

Hope this helps.