Pregunta

I am an iOS developer learning Android, so please bear with me. On iOS when getting location updates we have to be sure to filter those and throw out invalid locations. We check for things like outdated locations based on timestamp, inaccurate locations, etc.

Is there a preferred way to do this on Android or is this even needed? So far I am just checking that the location I got is not nil:

// All my other code to start my LocationManager
...

@Override
 public void onLocationChanged(Location location)
 {
    if (location != null)
    {

        // Do stuff here

    }
 }
¿Fue útil?

Solución

It's not needed. However, I also encourage you to look at the new Location Services APIs offered in Google Play Services (http://developer.android.com/google/play-services/location.html)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top