How do you Enable/Disable GPS & Network Location Provide

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

How do you Enable/Disable GPS & Network Location Provide

Postby WillyWontHe » Sat May 30, 2009 2:20 am

How do I enable GPS and Network (WIFI) location services? I check to see if they're enabled using this code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. locationManager.isProviderEnabled("gps");
  2.  
  3. locationManager.isProviderEnabled("network");
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


If both return false, then I want to enable one or both so that they return true. How do I do that? I've searched the LocationManager API and found nothing. What permissions have to be on to enable / disable these providers? Any help would be great.
WillyWontHe
Freshman
Freshman
 
Posts: 3
Joined: Mon Apr 27, 2009 7:17 am
Location: Berkeley

Top

in answer to my own question

Postby WillyWontHe » Sun May 31, 2009 7:00 am

I'm still not sure how to do it, but for those of you who are interested, you can just open the Location Settings like so:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. startActivity(new Intent("android.settings.LOCATION_SOURCE_SETTINGS"));
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


That way the users themselves can turn on GPS/Wifi location providers without exiting your map program.
WillyWontHe
Freshman
Freshman
 
Posts: 3
Joined: Mon Apr 27, 2009 7:17 am
Location: Berkeley

Postby raghavendra » Mon Nov 02, 2009 12:07 pm

Hi WillyWontHe,

Thank You very much... This is what the functionality I am searching for. Thanks again.....
raghavendra
Freshman
Freshman
 
Posts: 5
Joined: Fri Sep 25, 2009 2:09 pm

Postby zitscher » Tue Dec 01, 2009 4:00 pm

YAY thanks a lot WillyWontHe,
that was exactly what I was looking for!
User avatar
zitscher
Freshman
Freshman
 
Posts: 5
Joined: Fri Nov 20, 2009 8:20 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests