There are 3 network providers in Android, they are,
1. gps --> (GPS, AGPS)
Named GPS location provider. This provider determines location using satellites. Depending on the conditions, this provider may take some time to return a location fix. Requires android.permission.ACCESS_FINE_LOCATION permission.
2. network --> (AGPS, CellID, WiFi MACID)
Named network location provider. This provider determines location based on the availability of cell towers and WiFi access points. Results are retrieved via network discovery. Requires one of the android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION permissions.
3. passive --> (CellID, WiFi MACID)
A specialized location provider for receiving location without actually performing location refinement. This provider can be used to passively receive location updates when other apps or services request them without actually requesting the location itself. This provider will return a location returned by another provider. Requires the android.permission.ACCESS_FINE_LOCATION permission, although if GPS is not enabled this provider may only return a coarse refinement. This is the reason behind the name of this provider, but there is another reason why the underlying technology of this provider is needed, namely to help both providers above perform approximations to the location refinement value, meaning that both providers above do not need to calculate it from 0.
The following are the differences in the working methods and technologies underlying the three providers above.
| Accuracy | Power Usage | Technology |
|----------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 20ft | High | Autonomous GPS, Provider: gps uses GPS chip on the device line of sight to the satellites need about 7 to get a fix takes a long time to get a fix doesn’t work around tall buildings |
| 200ft | Medium - Low | Assisted GPS (AGPS), Provider: network uses GPS chip on device, as well as assistance from the network (cellular network) to provide a fast initial fix very low power consumption very accurate works without any line of sight to the sky depends on carrier and phone supporting this (even if phone supports it, and network does not then this does not work) |
| 5300ft / 1mile | Low | CellID lookup/WiFi MACID lookup, Provider: network or passive very fast lock, and does not require GPS chip on device to be active requires no extra power at all has very low accuracy; sometimes can have better accuracy in populated and well mapped areas that have a lot of WiFi access points, and people who share their location with Google |
There's no good way to know exactly what Android will use, because all phones are different. For example, on the VZW network, the LG Ally does NOT have AGPS! The Droid 2 has all the providers (AGPS, GPS, CellID, etc). On the ATT network, almost all phones tend to have AGPS enabled by default, etc. It varies by network, by coverage area, and by country, and by device. Also, on VZW, the passive provider ends up using Verizon's Location Services, which is very inaccurate (less than 1 mile accurate).
How to think about it?
The most important thing to remember is that some carriers have a level of service, even in situations where users have the worst devices, and the worst network service. It’s great that you can get low battery life and 20-foot accuracy, when conditions are really good. However, you can’t plan for that, and you can’t count on it. Not in 2010 anyway.
Here is a screenshot of RainOrShine, showing the accuracy of the “network” providers. Our Dynamic Shift algorithm handles switching between different providers during a session, and also maintains frequently changing accuracy over time, within a session.
How does it look on a real device?
This is a screenshot from a Droid 2, showing the location provider settings:
When only "use wireless networks" is checked, then the CellID/MACID lookup is used first, and the "network" provider uses this, and gets an accuracy of about 200ft-1mile.
When only "enable assisted GPS" is checked, then AGPS is used first, and the "gps" provider uses this, and gets an accuracy of about 10ft-20ft.
When only "use GPS satellites" is checked, then, GPS is used, and the "gps" provider uses this, and gets an accuracy of less than 10ft.
In all our code (for ScreamingToaster products), we try and use the "network" provider first, because it will always work on anyone's device down to the potato class, and the location fix will be obtained immediately. And the accuracy is pretty good - about 200 feet. You can also try "passive" first. Keep in mind that not all providers are available on android hardware, carriers, and user configurations.