1

I am using the fused location provider. I want this provider to have access to all possible sources for optimum accuracy.

My device (Moto G with Android 4.3) has the "Wi-Fi & mobile network location" setting: enter image description here

By default this setting is disabled, as shown in the screenshot above.

  1. Does the value of this setting affect the accuracy of the location given by the fused location provider?

  2. If so then how can I ensure that this setting is enabled? Or at least know that it is disabled?

cja
  • 9,512
  • 21
  • 75
  • 129

1 Answers1

2
  1. Yes the "Wi-Fi & mobile network location" affect the accuracy of the location, on certains location... If this is disabled, sometimes you can be hard to locate because GPS have some trouble to geolocate you at some places (like in a city with a lot of building for example). So the "Wi-Fi & mobile network location" helps.

  2. You can't ensure this settings is enable, but you can know it by code.

Take a look at this code to check if "network" location is available :

What is the simplest and most robust way to get the user's current location on Android?

EDIT :

try {   
    LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    networkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
} catch (Exception ex) {
    // catch Exception
}

To Answer your comments :

The GPS provider is used in the Fuse Location Provider. The documentation of LocationRequest says that : "Applications cannot specify the exact location sources, such as GPS, that are used by the LocationClient." It's the same GPS provider, but not handle by you in this case.

About the Network Provider, I found this in the LocationClient documentation (for the addGeofences method :

"In case network location provider is disabled by the user, the geofence service will stop updating, all registered geofences will be removed and an intent is generated by the provided pending intent."

My guess is, if the Geofence service can't access to this provider if it's disabled by the user, the LocationClient neither.

Community
  • 1
  • 1
Andros
  • 4,069
  • 1
  • 22
  • 30
  • Please provide an example for 2. – cja Jan 13 '14 at 12:09
  • Regarding your link, is android.location.LocationManager.GPS_PROVIDER etc involved in the fused location provider (com.google.android.gms.location)? – cja Jan 13 '14 at 12:13