In addition to this fine reason, using the provided symbol will allow the compiler to catch any typos, while simultaneously making it clear that you are using a standard value, and allowing you to see the documentation for that value with the mouse.
It's a big win all around. On Apr 4, 5:09 am, Mark Murphy <[email protected]> wrote: > RMD wrote: > > I had tried LocationManager.GPS_PROVIDER but for some reason I didn't > > work. I can't remember now if I tried it before or after I realized > > the GPS was off :) > > > LocationManager.GPS_PROVIDER is supposed to use whatever location > > source is available right? > > No, LocationManager.GPS_PROVIDER, presently, has a value of "gps". It's > more that, in case for some crazy reason they change that convention, > your code will be less likely to break using > LocationManager.GPS_PROVIDER than "gps", because they'll change > LocationManager.GPS_PROVIDER to match the new convention. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, One Low Price! -- 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 To unsubscribe, reply using "remove me" as the subject.

