12-02-2008 01:04 PM
locationProvider.setLocationListener(this, 2, 1, -1);
My understanding is as follows:
This will wait to provide a location to the listener until the GPS chip has supplied a location which it will pass on, and then try to give you a another location every 2 seconds.
If there is no location available after a 2 second interval, the listener will wait 1 further second for a fix, before giving up - by giving up, this means supplying the listener with an invalid location (so the listener will get bumped every 3 seconds at worst, but the bump might be invalid. But see next,
The maxage, is the maximum age of a location that will be supplied. The Listener is allowed to reuse a Location it has previously supplied until maxage has passed. This allows the Listener processing to leave the GPS Receiver 'off' and not ask it for a new value when it doesn't need to. So the location you are supplied with could, in fact, be the same location that you were supplied with last time.
Does this help?