Im pretty sure you have to add permissions for FINE location in order to get
the GPS. Why not Try to get a GPS fix.... Start the GPS receiver, then set a
timer for however long you want the gps to try to fix itself for.... if it
takes to long shut the GPS down and change your criteria to use the Network
provider....If it does get the gps in the time you gave, shut the timer off
inside the GPS receiver.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jake Colman
Sent: Friday, February 18, 2011 11:37 AM
To: [email protected]
Subject: [android-developers] Re: Issue Determining the Location

>>>>> "T" == TreKing  <[email protected]> writes:

   T> On Fri, Feb 18, 2011 at 9:20 AM, Jake Colman <[email protected]>
   T> wrote:
   >> But doesn't the device always know where it is - assuming it has a
   >> GPS, WiFi or network connection?
   >> 

   T> Having those features doesn't mean much if they're not actually
   T> used. If nothing on the device is requesting it's location, why
   T> would the device update it's location? getLastKnownLocation gets
   T> you exactly that - the location the device last knew it was at,
   T> which is the last time a location update was requested by some
   T> app.

   >> Other than getLastKnownLocation() is my code a reasonable paradigm
   >> for getting the best available location fix?
   >> 

   T> Not really. If I used my device's GPS in Tulsa, Oklahoma then
   T> stopped using it, took a flight back to Chicago and ran your app,
   T> your app would think I was still in Tulsa.

   T> Use requestLocationUpdates as Mark already said.

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? And in the
unlikely event that it has GPS but no network, will I still get a location?

--
Jake Colman -- Android Tinkerer

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

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