Getting speed of the device using GPS in Android

by Krishnaraj Varma on July 11, 2010

in Android

Download Speed Demo (64)

Most of the GPS receivers are capable of calculating speed of the device. All most all the GPS enabled phones expose the speed and other information through APIs. In Android we can specify whether we need the speed information while searching for best GPS provider.

The Criteria class provides a method setSpeedRequired to specify whether the provider should provide speed information. Passing true specify the speed information is required and false specify this information is not required. Please note that all GPS providers do not support this feature.

The getSpeed method of the Location class is used to get the speed information. The hasSpeed method returns true is speed information is available otherwise false. The speed reported in meters/second.

The accuracy of GPS speed information depends on many factors. To get more about the accuracy and how the receivers is calculating the speed follow this link.

Happy GPS coding!

Previous post:

Next post:

Disclaimer: This is a personal weblog. The information in this weblog is provided “AS IS” with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.