[android-developers] Re: I don't see how to do this....
As another side note, if you want to preemptively prevent force close messages, the best thing to do is test everything for a valid data type before using it. Many unexpected conditions can be caught and handled if you do this, failure to test everything that may have an unexpected value will at some time catch you. The last thing you want is a dozen one star "FC - uninstalled" comments in the market because of a missed test. -John Coryat "Radar Now!" "What Zip Code?" -- 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
[android-developers] Re: I don't see how to do this....
Aha! Thank you! As soon as I read your response it hit me - I am testing on the emulator, which will always give me a null provider! Which means no matter what I do I am gonna get a null which means I can't get a latitude... Which shows that I have had WAY too much time off of programming between Christmas and New years! Thanks a million! On Jan 6, 2:26 pm, "Maps.Huge.Info (Maps API Guru)" wrote: > You're not testing to see if you get a null provider, also I'm not > sure asking to use POWER_LOW and ACCURACY_FINE will work as GPS uses a > lot of power. > > I suggest dropping the POWER_LOW and testing provider for null. > > Also, unless you need a very accurate fix, the wireless network > location service (ACCURACY_COARSE) is much faster, uses less power and > also works indoors, you might consider using that as well. > > As a side note, you're not going to get a good fix using > getLastKnownLocation without first attaching a listener to the GPS. > The last known location might be 100 miles away, if the last time > location services were used was a while ago. I've found > getLastKnownLocation to be unreliable. > > -John Coryat > > "Radar Now!" > > "What Zip Code?" -- 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
[android-developers] Re: I don't see how to do this....
You're not testing to see if you get a null provider, also I'm not sure asking to use POWER_LOW and ACCURACY_FINE will work as GPS uses a lot of power. I suggest dropping the POWER_LOW and testing provider for null. Also, unless you need a very accurate fix, the wireless network location service (ACCURACY_COARSE) is much faster, uses less power and also works indoors, you might consider using that as well. As a side note, you're not going to get a good fix using getLastKnownLocation without first attaching a listener to the GPS. The last known location might be 100 miles away, if the last time location services were used was a while ago. I've found getLastKnownLocation to be unreliable. -John Coryat "Radar Now!" "What Zip Code?" -- 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