Sunday, February 20, 2011

Re: [android-developers] Re: Issue Determining the Location

On Sat, Feb 19, 2011 at 8:34 PM, Jake Colman <colman@ppllc.com> wrote:
> If my phone is running a location-aware clock or a location-aware
> weather widget, would getLastKnownLocation() be guaranteed to return a
> value in my app?

There are no guarantees in life.

For example, a "location-aware clock" might only check location
sporadically (e.g., daily).

> Or is that the point of the 'passive' provider?

The passive provider is so you can get location data without
necessarily turning anything on (e.g., GPS radio).

> With my widget installed on my HTC EVO, which runs the HTC standard
> location-aware clock, it always knows where it is as I travel from home
> to work.  That would imply that my app's call to getLastKnownLocation
> returned results since the phone knew where it was.  Does that make
> sense?

Yes. Unless your app is only for you, though, you can't exactly rely on that.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

--
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

No comments:

Post a Comment