Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid GPS drifting in android?

Tags:

android

gps

I want to develop the application with current location plotting on the google map. Here i am getting the location details through onLocationChanged of LocationManager(GPS PROVIDER & NETWORK PROVIDER). I am able to get the location details. But sometimes, The gps drift is received(i.e., Showing my current location in some other place). how to avoid this type of drifting.

like image 892
Jayaprakash Marshal Avatar asked Mar 08 '26 08:03

Jayaprakash Marshal


1 Answers

You can avoid drifiting, by ignoring locations when location.speed is near standstill.

Otherwise you cannot, GPS is the best location technic, it sometimes drift, there is nothing better. There are some technics to avoid incaurate GPS like waiting after intializig GPS for some seconds, and don't us ethe froist few locations, or to check the value of horicontalAccuracyEstimation.

Further your expression "showing my location on some other place" is not very descriptive, You should add how many meters the location (or map) is wrong,

Beeing outdoors in cities a dispalcement of 30m or even more can happen, this is nothing unusual.

like image 161
AlexWien Avatar answered Mar 10 '26 09:03

AlexWien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!