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 -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -