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?

Thanks,
RMD


On Apr 3, 8:05 am, Mark Murphy <mmur...@commonsware.com> wrote:

> RMDwrote:
> > Thanks for all the responses.  I'm embarrassed to admit, but I had the
> > GPS turned off in the phone.  Since,
>
> > locm.requestLocationUpdates("gps", 0, 0,onLocationChange);
>
> > was specifically set to "gps" it wouldn't work.
>
> > To address that I have it check if the gps is on and use network if
> > the gps is disabled.
>
> >    LocationManager locm = (LocationManager)
> > getSystemService(Context.LOCATION_SERVICE);
> >    //Check if GPS is enabled and choose network if it isn't
> >     if ( !locm.isProviderEnabled( LocationManager.GPS_PROVIDER ) ) {
> >        locm.requestLocationUpdates("network", 0, 0,onLocationChange);
> >     } else {
> >        locm.requestLocationUpdates("gps", 0, 0,onLocationChange);
> >     }
>
> Another suggestion: don't use "network" and "gps", but use
> LocationManager.NETWORK_PROVIDER and LocationManager.GPS_PROVIDER instead.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in NYC: 30 April-2 May 2010:http://guruloft.com

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to