Dynamically enabling location

Post your questions and help other users.

Moderator: Martin

Post Reply
steveriley

Dynamically enabling location

Post by steveriley » 05 Jan 2013 04:59

Normally I prefer to keep both location mechanisms -- wi-fi/network and GPS -- disabled. The only times I want my phone to be collecting location information is when I'm running an app that needs it, such as Maps or One Bus Away (bus route finder for Seattle). Automagic includes an action for SMS, which I've tested and can successfully enable when the app of interest starts and disable when the app terminates. But there isn't an obvious action for the wi-fi/network location source. Is there a way to this possibly with a script or something under "Start Activity"?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Dynamically enabling location

Post by Martin » 07 Jan 2013 08:27

There exists no action to change the network location setting yet. I will add a new action Set Network Location State that will allow to change this setting but the new action will require root (like Set GPS State).
Changing this system setting seems to also trigger a confirmation dialog (Location consent) that you have to confirm with "Agree" so this action will not be usable in completely automatic flows. You could automatically let Automagic click the "Agree" button for you with action Control UI but this also requires the display to be on and the device to be unlocked.

Another option is to use action Launch App: com.android.settings/.Settings$LocationSettingsActivity when Maps/One Bus Away is started/stopped and then to manually change the setting.

steveriley

Re: Dynamically enabling location

Post by steveriley » 23 Jan 2013 08:41

Just downloaded the update with the new feature. It works perfectly. Thanks very much, wonderful service. I'll recommend Automagic to everyone I know.

EDIT: I wanted to write a complimenentary review on the Play Store, but I see it now requires a Google+ account, which I don't want to create. Rats.

Post Reply