Thanks Mark, I'll give it a try ...
Emre > Date: Wed, 26 Aug 2009 13:16:33 -0400 > Subject: [android-developers] Re: LocationManager always returns null ... ? > From: mmur...@commonsware.com > To: android-developers@googlegroups.com > > > > Anyway, the code seems to work fine, but locationManager always returns > > null even though I tried to send mock location data to the Android > > Emulator via the DDMS application using the "Manual Location" tab. > > Whatever I send seems to be ignored. I also tried establishing a telnet > > connecton to the emulator and using the command "geo fix lat long". I did > > get an OK message yet, the emulator still returns null to my request. > > > > Any ideas about what might be the problem ? > > Use requestLocationUpdates(). > > Unless your timing is perfect, you will not be able to send the fix at the > right time for getLastKnownLocation() to work as you expect. > > Moreover, on a production device, getLastKnownLocation() will *never* work > as you expect, because it takes GPS several seconds, at best, to get a > fix, and it will only *try* get a fix because you have called > requestLocationUpdates(). > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com > Android App Developer Books: http://commonsware.com/books.html > > > > > _________________________________________________________________ Stay on top of things, check email from other accounts! http://go.microsoft.com/?linkid=9671355 --~--~---------~--~----~------------~-------~--~----~ 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-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---