coderslay
coderslay

Reputation: 14370

How to get accuracy of GPS in Android

I need to check the accuracy of GPS... but when i use location.getAccuracy then it doesn not return me any value... Does it take time..If it takes time then how long does it takes?

Upvotes: 10

Views: 20670

Answers (1)

Reno
Reno

Reputation: 33792

In android devices, mainly you can have two sources by which you can get position info : GPS_PROVIDER and NETWORK_PROVIDER

GPS_PROVIDER uses your GPS chipset to get a position fix. This has a greater accuracy.

NETWORK_PROVIDER uses the information from cell-tower to triangulate your location. Hence its accuracy is not as quite good.

You can get your accuracy info from Location.getAccuracy() or from NMEA data.

Does it take time..If it takes time then how long does it takes

Once you've started getting fixes it won't take much time. Time to first fix can be 30 seconds to 15 minutes. It depends on your GPS chipset, terrain conditions, cold/warm start etc.

To choose the best provider read this article

Upvotes: 11

Related Questions