Before I go into location based mode I check for existence of any location providers by calling
List<String> android.location.LocationManager.getProviders(boolean enabledOnly) //enabledOnly = true
and checking the size of the resulting list.
Now I tested my App on a HTC Desire with Android 2.2. The system settings don't allow any location tracking (GPS and mobile is turned off).
However, the list get returned has 1 entry, whose value is "passive". What is it? Can I work with it? The provider seems to be slow / not working.
The passive location provider will provide you with location data when other apps that have requested location updates get their data. So if no other app on the phone is getting location updates, you won't get them either.
passive –> (CellID, WiFi MACID) #A special location provider for receiving locations without actually initiating a location fix. This provider can be used to passively receive location updates when other applications or services request them without actually requesting the locations yourself.
The fused location provider is a location API in Google Play services that intelligently combines different signals to provide the location information that your app needs.
LocationProvider is the super class for location providers. A location provider provides the information of the geographical location of the device. This information is stored in the Location class. For accessing the location based services Android provide different classes that are available in android.
From the Android API reference:
A special location provider for receiving locations without actually initiating a location fix. This provider can be used to passively receive location updates when other applications or services request them without actually requesting the locations yourself. This provider will return locations generated by other providers.
So no, it's not likely to do you any good if there are no other location providers available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With