Reputation: 14581
I am a bit curious to find you thoughts on this issues. I have an app which needs to track the user all the time. It needs to read a location every 50 meters and this is a parameter when I register a location listener. The reading is done in a background service all the time. There is no need to worry about battery usage.
Here comes the interesting part, I thought of trying to use the Network location and when the accuracy is big, fire GPS readings instead. The app is used most of the time in cities where there are many cells and wifi networks so the Network reading is pretty accurate. The problem is: the Network location readings are made very rare, for instance 4 times in 1 kilometer, so basically this is not suitable for tracking. This happens even if I give the listener the hint for 50 meters.
My question is, am I doing something wrong? If I switch the provider from Network to GPS the readings are correct and happen as expected. As a conclusion, Network location is not suitable for tracking ? And another short question: Network location in order to be more accurate would require Wifi module to be enabled, right ? This means it will use more battery than the GPS module ?
Upvotes: 1
Views: 18956
Reputation: 4017
It may not the answer for your exact question. But, It will give you some idea about battery usage
and accuracy
, when you fix the location using network or GPS provider.
Most cell phone companies have the GPS in the phone turned off except for emergency calls and for services they sell you (such as directions). This type of GPS is calling A-GPS.
Basically, It is like GPS Provider as well as it uses network connection also. Because of using network connection with GPS, It will give more accurate
location fix, even in-door
also (Mostly, GPS will work fine in out-door alone).
While considering about battery usage, It doesn't depend on GPS alone. After getting the raw data, Network will take the action of processing the data. So, it won't use that much battery level
like GPS uses.
Note: Refer (Adam Davis's answer).
Hope, you will get some more idea!
Upvotes: 0
Reputation: 23873
I think you are missing the point here. You want the location only every 50 metres in order to save on battery, but unless the location listener is ON the device won't know that it's moved that 50 metres. That minimum distance 'hint' can therefore only control when the onLocationChanged() is fired, not whether the GPS is on. When my phone had Gingerbread as the OS, that min distance parameter was ignored, now that it is on ICS it seems to be honoured.
Upvotes: 2
Reputation: 4307
It probably won't use more battery than the GPS does, but the network provider is just not cut out for tracking purposes. If you don't have to worry about battery usage, then you should just use GPS all the time, and try getting a network location only if you don't get any data from the GPS (for example when you are indoors and you can't get a fix).
Upvotes: 1
Reputation: 95636
Yes, you are correct. Network location is not suitable for tracking (at least not with the level of accuracy that you require). Yes, if you want more accuracy with Network location you need to have the wifi enabled. Whether this will use nore or less battery than GPS is very much dependent on the device and the situation.
Upvotes: 3