5

When moving a big distance, like to another city, with the GPS off, it takes very much time for it, when turned on, to get the first correct point.

So if by example I register to the gps provider, it could take up to 10 min until the first onLocationChanged call.

The network provider will respond faster, but is less accurate.

Is there a way to help the gps provider? To give it an approximate location (the one from the network provider), so it can find my location faster?

I think that google maps made some kind of optimisation, because their app finds my location faster than my basic app, that only register to the gps provider.

Any idea how I could accelerate the process of obtaining my location with decent accuracy ( <30 m) ?

Stefan Alexandru
  • 563
  • 1
  • 5
  • 18
  • That would require an external source of the ephemeris of each SV (and an interface to the SW to feed them in.) I'm afraid, I don't know the Android specific details. – Aki Suihkonen Mar 14 '13 at 13:23
  • Does your device have A-GPS capability? That sounds like what you're looking for: Using the network/coarse location to help the GPS lock faster. – Geobits Mar 14 '13 at 13:25

3 Answers3

3

You are right that if you move a long way with the phone switched off, then it can take a long time to get a satellite fix. This is where AGPS helps. The 'A' stands for 'assisted' which is very much carrier and handset dependent in its implementation. In essence it gets an approximate location from cell towers or from public WiFi like coffee shops and then downloads ephemeris and almanac data which tell the phone which satellites are likely to be overhead at that time in that rough location. The phone can then start listening on the frequencies corresponding to the visible satellites first. This should speed up the time to first fix.

NickT
  • 23,844
  • 11
  • 78
  • 121
1

Common practice is to use WiFi SSIDs or the location of the cell tower you're registered with to look up your current location via providers like WeFi or Skyhook. Google uses its own service for that (and sees that no one else does).

Another method would be, in case your smartphone has a barometer, to look up the air pressure and try to pin it down to a location. While all these methods can theoretically be used offline, it is easier to fetch the data from the internet.

Also note that inaccurate NTP settings on the phones may lead to longer GPS search times.

nemo
  • 55,207
  • 13
  • 135
  • 135
0

Is there a way to help the gps provider?

NickT has answered this, but the android phone has to call the AGPS. In your app you cannot controll that.

I think that google maps made some kind of optimisation, because their app finds my location faster than my basic app, that only register to the gps provider.

This should not be the case, probaly you are doing something wrong, or the google app can enable assisted GPS. Try to compare with other android GPS apps (e.g compare with Motion-X-GPS)

it could take up to 10 min until the first onLocationChanged call.

Normally this is far too long, either your phone is known to have a weak GPS quality, or the device did not have free view to open sky. Even without assisted GPS, after 45 seconds, you should have a valid GPS position (asuming free view to open sky). But this situation can happen, either the first time you use GPS on your device, or when you fly by airplane to a location far away to your last GPS position.

On my iphone i rarly saw such a situation when another GPS app was somehow disturbing, after a reboot of the device the GPS was immedeatly valid.

Again check if it is the fault of your app, by comparing if other apps needs 10 minutes too. (It could be your fault, when you wait to recieve an accuracy <30m while other apps would take the first valid position they get.

If google needs 10 minutes, too, then you could do nothing on that phone, except to expose it to good view to sky.
(Inside an urban canyon it's more difficult to obtain a valid first fix, then on an big place.
)

AlexWien
  • 28,470
  • 6
  • 53
  • 83