Thursday, May 13, 2010

[android-developers] Re: Ensure GPS has fix before proceeding..

> "Best" is debatable - but you could use an AsyncTask that does whatever it
> is you need your GPS fix for and include getting a fix as one of it's steps,
> during which time you show an indeterminate progress dialog that says
> "Getting your current location ... please wait..." or something. That's what
> I do when the last known location will not suffice. Works well enough.
>

What I did is to setup a locationlistener, and assume that the gps
gets the fix only after the first update (when the onLocationChanged
is fired the first time).
You can also listen to the other callbacks like onStatusChanged in
order to decide if the gps is down again.

Hope this helps,

Federico

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate