On Fri, Feb 18, 2011 at 10:43 AM, Mark Murphy <[email protected]>wrote:

> On Fri, Feb 18, 2011 at 11:36 AM, Jake Colman <[email protected]> wrote:
> > I am about to reread Mark's chapter on Location Provider from his Busy
> > Coders book.  If I put my listener only asks for Network updates (coarse
> > location) it will still hear GPS updates too if available?
>
> Not automatically via the LocationListener, AFAIK. Besides, in your
> scenario, you don't have permission for GPS.
>
> > And in the
> > unlikely event that it has GPS but no network, will I still get a
> > location?
>
> That depends on which one you register the LocationListener for. If
> you ask for network, and network is not available, you will not get
> GPS fixes, AFAIK.


To add to this, you have to explicitly register for what you want and you
need to have the permission to do so.

It would not make sense for apps that just need Network to automatically get
GPS and waste battery.
Nor would it make sense for apps that require GPS to automatically get
Network and end up with bad results.

If you're OK with network, then just register for and use that. If you want
GPS accuracy but can settle for network, use Tommy's suggestion.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

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

Reply via email to