0

I have been working for days in attempting to obtain a location using Android devices. I cannot use requestSingleUpdate due to a high API level. I also do not want to use getLastKnownLocation by itself due to accuracy issues. Therefore I have opted for using requestLocationUpdates.

(For simplicity I will refer to this code, but I have used many approaches to using requestLocationUpdates using GPS: What is the simplest and most robust way to get the user's current location on Android?)

I can get a location using the cell towers, but its accuracy is not good enough. Whenever I try to obtain a location for GPS onLocationChanged is never called, even if I let the listener go for 5 minutes. The GPS icon does appear in my notification bar during the GPS reading part. I do have permissions set for getting a coarse+fine location, and my GPS is working fine in Google Maps and GPS Test. Even if I go to Google Maps to get an accurate lock then switch to my application, I never get a location update. I have asked people I know for a solution or a reason and have been left without a response. I also have done many searches around the net for a solution and have left empty-handed. Is there anything that I am missing or am I never going to get a more accurate location reading?

Community
  • 1
  • 1
J_P
  • 51
  • 1
  • 6
  • Don't remember the names immediately, but some include HTC, Motorola, and Samsung. – J_P May 23 '11 at 17:39

1 Answers1

0

You mention that you have permissions set for getting FINE locations, but what about getting COARSE locations? A good implementation will use FINE location updates when possible and COARSE location updates when not. Just because you have a GPS icon showing does not mean you have a lock.

You can read up on this issue more here:

http://developer.android.com/guide/topics/location/obtaining-user-location.html

vee
  • 720
  • 7
  • 8
  • Forgot to mention coarse location is also used. The code snippet above takes into account getting a lesser accurate reading if a finer one is not available. The problem is I'm not getting a GPS reading when clearly it is available. I also have visited and referred to that link that you have provided when I started out. – J_P May 18 '11 at 19:52