views:

70

answers:

4

I am creating a BREW app that requests the user's position.

If the phone cannot acquire the position, I would like to display an error.

How long should I wait for my callback to be called before I determine that the phone is not likely to get a GPS fix?

+1  A: 

45-90 seconds.

For more information, see the GPS Time To First Fix article at Wikipedia.

But you can never know when the user actually has view to the satellites or not, maybe they are still inside when they start your program, so the approach suggested by Matthew Vines is much better than a constant delay.

Bandi-T
+1  A: 

I might go with an increment (say 20 or 30 seconds) between notifying the user that you have failed to establish a link, and give them the option to stop trying. Keep at it until they stop you, or a set number of iterations have passes (say 5 - 10 iterations).

Matthew Vines
+2  A: 

When a cold start is required, the receiver has to download a full set of Ephemeris data, which is broadcast from the GPS satellite over a 30 second cycle and re-transmitted every 30 seconds.

So I would say that 60-90 seconds (two or three Ephemeris cycles) would be a suitable time to wait before declaring failure.

http://www.navigadget.com/index.php/gps-knowledge/ttff-time-to-first-fix

Note that if a device requires an almanac download, the startup time can be much longer (on the order of 12.5 to 15 minutes). This is referred to as a Factory TTFF (Time to First Fix).

Robert Harvey
Having an out of date almanac and performing a download does not prevent the GPS from acquiring a position. The almanac is transmitted in sections and can be collected by the GPS over a number of wakeup events. One GPS engine that I have used had a default acquisition timeout of 2 minutes. If it had not acquired the satellites after this time it did a self reset and started again.
Ian
+1  A: 

Cellphone-specifically, I've had a Motorola phone that had a GPS receiver, but was horrendously bad at it - it could take it around 5 minutes to get a fix where my standalone Bluetooth receiver would manage in less than a minute.

Why are you declaring failure after a fixed timeout anyway? Why not, after a reasonable time has passed (say, a minute), display a message to the tune of "GPS fix still not available; but I'm still trying" with a possibility to cancel at any time if the user is fed up? What do you expect the user to do with the failure message you're proposing to give him?

MaxVT
For the time being, I am writing a Unit Test so we can see if it works properly. The end user will likely never see any of this. Thanks for the input though.
Andres