Search code examples
androidgps

Android GPS accuracy indicator


I'd like to have an indicator of GPS accuracy like Runkeeper it shows some bars. So when you have good GPS signals the indicator is full and when it is not, the bars are not full, kind of like your WIFI icon.

So let's say it has 3 bars .... 3 bars = Good, 2 bars = Average, 1 bar = Poor, 0 bar = no GPS.

Could I based on the location.getAcurracy() to draw those bars? If so, what acurracy would equal to 3 bars, etc ...

Thanks!


Solution

  • The location.getAccuracy() describes the deviation in meters. So, the smaller the number, the better the accuracy.

    If this location does not have an accuracy, then 0.0 is returned.

    So you can keep it

    0.0 as No Gps signal

    1-25 - 4 bars

    26-50 - 3 bars

    51-75 - 2 bars

    75-100 - 1 bar