Tuesday, November 23, 2010

[android-developers] GPSProvdier is enabled or not

Hi All,

I am trying to fetch current location in my application. I want to try
it firstly with GPS if it is not working then with Network provider.

My query is if
manager.isProviderEnabled( LocationManager.GPS_PROVIDER ) gives me
false then will "requestLocationUpdates" not work. or even if GPS is
not enabled on my cell "requestLocationUpdates" will automatically
enable the GPS.

Should my code be like below
if(manager.isProviderEnabled( LocationManager.GPS_PROVIDER ) )

manager.requestLocationUpdates(LocationManager.GPS_PROIVDER...
else

manager.requestLocationUpdates(LocationManager.NETWORK_PROIVDER...

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate