I am creating an app which send GPS coordinates once location is change. I need to send data only when the vehicle is moving. How can I get to know this. I got two options
onLocationChanged, getSpeed();
What is the best way to do this?
onLocationChanged
is probably your best bet. This can be quite heavy on the battery, so be careful with your frequency. If im not mistaken, the accelerometer is used to detect movement along 3 axis, like device rotation. A moving car doesnt sound like an apporpriate use case.