1

Possible Duplicate:
How can I enable or disable the GPS programmatically on Android?

I have searching on how to toggle GPS programmatically, the standard answer is that it's not possible.

If this is really the case how do all the various power/toggle related widgets manage to toggle GPS with one click and no warning. The market place is full of examples that show it is possible.

So how?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Woz
  • 11
  • 2
  • Can you name any app widgets on the Market that "toggle GPS with one click and no warning"? – CommonsWare Apr 10 '11 at 10:53
  • Widgetsoid (Jaumard), PowerControl (Surius Apps), GPS OnOff (Curve Fish)... There are 3 straight off that I have tested and all work as I describe. Would you like me to list more there appears to be many more but I have not tested those yet – Woz Apr 10 '11 at 19:45
  • 1
    These are exploiting security holes in Android. Your prompt attention will help me in getting them fixed. Thanks! – CommonsWare Apr 10 '11 at 20:23
  • This question comes up many times and there is an obvious demand for this functionality. Would it not be better just to have a permission of ToggleGPS and let the user decide if they want to allow apps that have that sort of control over the GPS? The current situation is just dumb – Woz Apr 11 '11 at 06:52

1 Answers1

0

I've tested this on the emulator with 1.6 and it works.

How can I enable or disable the GPS programmatically on Android?

EDIT: This is not particularly allowed on the Android Market, and it stopped working as of android 2.3. I have also tested on a 2.1 emulator, and two actual devices with 2.2, and it worked on those.

Community
  • 1
  • 1
Reed
  • 14,703
  • 8
  • 66
  • 110