android - React on no movement for longer time -
i react on situation, android smartphone didn't move longer time. this, created service, implements sensoreventlistener.
how can reach, service something, if smartphone didn't move since, example, 10 minutes? how can decide, if changes significant or not? how fail measurements? ideas?
@override public void onsensorchanged(sensorevent event) { if (event.sensor.gettype() == sensor.type_accelerometer) { if (changes significant) { lastchangestimestamp = system.currenttimemillis(); values = event.values; } else if (changes not significant , last significant changes 10 minutes ago) { dosomething(); } } }
Comments
Post a Comment