Accuracy of GPS coordinates found in Android

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I m working on a project which requires constant location updates of my android phone. It works alright but, is highly inaccurate. Indoors i was getting accuracy of fetched location (via getAccuracy()) to be around 60(which as far as i know is in meters), where as i want accuracy to be in (at max) 2-3 meters. Firstly, Is t possible to obtain accuracy of (2-3 meters) constantly? If Yes, how?

Follow is the code piece i m using to fetch user location.

    public boolean getLocation(Context context, LocationResult result)
{
    //I use LocationResult callback class to pass location value from MyLocation to user code.
        locationResult = result;

    if(lm==null)
        lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);

    //exceptions will be thrown if provider is not permitted.
    try{gps_enabled=lm.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception ex){}
    try{network_enabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception ex){}

    //don t start listeners if no provider is enabled
    if(!gps_enabled && !network_enabled)
        return false;

    if(gps_enabled)
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps);
    if(network_enabled)
        lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListenerNetwork);
    timer1=new Timer();
    timer1.schedule(new GetLastLocation(), 10000);
    return true;
}

I was also getting another issue, with my device constantly placed at a static location, the distance between two successive GPS Location fetched is highly unreliable, it changes from 0.0 meters to 16meters, which means that my device is constantly moving.

If any of you have any idea about this preferably how to achieve accuracy please help me.

Thanks

Answers

Instead of using solely mintime and mindistance, you might get better results by passing in a Criteria object with

ACCURACY_FINE
POWER_HIGH

Your individual phone and physical environment will obviously impact the readings. You will likely overall get better results allowing the system to do some of the work for you by not specifying the exact location provider with the following call and criteria.

http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/11895314/accuracy-of-gps-coordinates-found-in-android

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils