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

Popular posts from this blog

ssh - Vagrant Windows - ssh_exchange_identification: read: Connection reset by peer -

gcc - Neither ld wrap nor LD_PRELOAD working to intercept system call -

maven - jacoco coverage per test setup -