0

I am working on project where I need to trigger certain task when the user stops driving the car, I am currently using using google play services location APIs in this project , I got latitude,longitude and speed info from the location object from the onLocationChanged() method is there the way to know that user has stopped driving , I think onLocationChanged() call back is invoked only when there is a movement , is there a way to ascertain there is no movement ?

Any help would be appreciated ,I've gone through the forums there answers on detecting movement but no info on detecting when the user has stopped driving

Note: I do not want to use any other library as this would increase the size of the project

1 Answers1

1

you should get user location with a thread/service/whatever you want and check for speed if is 0 (or 0 with some tolerance), the user is stopped

take look at http://mycodingworld1.blogspot.it/2015/12/calculate-speed-from-gps-location.html

also

Determining the speed of a vehicle using GPS in android

Community
  • 1
  • 1