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

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

iis - ASP.Net Core CreatedAtAction in HttpPost action returns 201 but entire request ends with 500 -