Keeping GPS on for apps running in background

1,136 views
Skip to first unread message

silox

unread,
Aug 8, 2010, 10:37:11 PM8/8/10
to Tasker
I have setup tasker rules to enable the GPS when I open certain apps
that require it to function. In this example, I'll fire up Google
Maps and then Navigation to a specific location. While Navigation is
going, I may jump to Pandora to change a song or to the homescreen to
text someone via widget. When this happens, the GPS turns off. I
have removed the Exit Action for the rule to see if that helps, but
the GPS still shuts off. Is it possible to leave the GPS on for an
app if it's actively using it or running in the background? If so,
would someone mind pointing me in the right direction to accomplish
this? Sorry if this has been covered here or elsewhere previously, I
could not find it via searching(at least with the terms I was using).
Thanks!
Message has been deleted

b2barker

unread,
Aug 9, 2010, 2:03:08 AM8/9/10
to Tasker
The reason it turns off the GPS off again, even though it not in an
exit task, is explained here : http://tasker.dinglisch.net/userguide/userguide_settings.html.
Your profile has a context of Maps in the foreground that turns on the
GPS, so when Maps is not in the foreground the setting of GPS on is
restored to off.

One solution with two user defined variables:
Profile 1
Context - Application Google Maps
Entry Task - set %MAPSRUNNING to ON
set %MAPSGONE to OFF
Exit Task - set %MAPSGONE to ON

Profile 2
Context - State Variable Value %MAPSRUNNING = ON
Entry Task - turn GPS On

Profile 3
Context - State Variable Value %MAPSGONE = ON
Entry Task - Wait 120 seconds
set %MAPSRUNNING = OFF

I haven't tried this but I think it should allow up to 120 seconds
with maps not being the foreground app before shutting off the GPS

BossMan

unread,
Aug 9, 2010, 3:19:16 AM8/9/10
to Tasker
Good thinking, but this part will not as expected, I'm afraid:
> Profile 3
> Context - State Variable Value %MAPSGONE = ON
> Entry Task - Wait 120 seconds
> set %MAPSRUNNING = OFF
>

Even if MAPSGONE is set to off again (you returned to maps), this will
not interrupt this ongoing task. So you should add least add condition
to that last action, like set %MAPSRUNNING = OFF if %MAPSGONE ~ on,
in case your wait ends and you're in the maps again.

BR,
A.

Brendan CM

unread,
Aug 17, 2010, 8:42:38 PM8/17/10
to Tasker
What if you want to have GPS and navigation running in the background
while you are listening to music? I know this might be a small
minority of people who do this, but there should be a way of checking
which notifications are visible in the notification area. Is there
something like this available currently? If not, it would be a great
way to write explicit checks for existing applications already
running.

-Brendan
> > > app if it's actively using it or running in thebackground?  If so,

BossMan

unread,
Aug 18, 2010, 4:21:03 AM8/18/10
to Tasker
> but there should be a way of checking
> which notifications are visible in the notification area.
Not possible, due to security limitations in Android.

> If not, it would be a great
> way to write explicit checks for existing applications already
> running.
App context can be used for that, but only for foreground applications
- background service detection is on the todo tough.

An idea for walkaround: use ASE script to run "ps" command, then put
the output in a file (probably parsing it a bit first). Then you can
use that file (and info from it) in Tasker.

BR,
A.

J.J.

unread,
Aug 18, 2010, 5:04:32 PM8/18/10
to Tasker
Just don't turn off GPS. There isn't a reason to unless you for sure
don't want GPS to activate in a given instance or circumstance. It
doesn't use any battery power, unless the GPS Icon is on in the
notification bar. No need to make complicated tasks to turn on or off
GPS.

simplecy

unread,
May 17, 2011, 1:46:20 PM5/17/11
to tas...@googlegroups.com

 It doesn't use any battery power, unless the GPS Icon is on in the
notification bar.  No need to make complicated tasks to turn on or off
GPS.
Well said :)

Simon

brandall

unread,
May 17, 2011, 1:59:20 PM5/17/11
to Tasker
+1

Users don't seem to like it highlighted in the status bar power widget
that is in some Gingerbread ROMs, but Google tells us it uses no
resource. None of my profiles any longer need GPS on or off as it's
now just available when required...

Müsli

unread,
May 19, 2011, 5:17:11 PM5/19/11
to Tasker
> Users don't seem to like it highlighted in the status bar power widget
> that is in some Gingerbread ROMs, but Google tells us it uses no
> resource. None of my profiles any longer need GPS on or off as it's
> now just available when required...

There is one reason to do so: Some apps (e.g. weather widgets) use GPS
location if GPS is enabled. But for a weather widget network based
location is exact enough, so one can save battery by disabling GPS.
But you are right, instead of building tasker profiles for that one
should contact the developers and ask them to use network based
location if it is sufficient for their purpose ;-)
Reply all
Reply to author
Forward
0 new messages