Is there a GPS State in Contexts?

746 views
Skip to first unread message

kiwiBeans

unread,
Nov 3, 2010, 12:33:49 PM11/3/10
to Tasker
Hi,

I've been attempting to set up a general notification that comes up
when the GPS state has been toggled. Basically, I'd like to know
whenever it gets turned on or off. I know I can set up a notification
to do this within a task but I thought I'd set up a general "if GPS is
toggled, give a notification".

Well, I've been looking and looking but when I go to set up a new
profile, and try to find a Context that is basically "GPS on or GPS
off", there's nothing. I've looked in all the Context options. I find
it strange that it's missing, considering virtually every other state
I can think of is listed. Have I just missed it or does it really not
exist in Tasker?

Thank you for your help,

kiwis

Sam

unread,
Nov 3, 2010, 6:18:23 PM11/3/10
to Tasker
It's in variable set.

If %GPS matches on
Notify GPS On

If %GPS matches off
Clear Notification

Sam

unread,
Nov 3, 2010, 6:55:07 PM11/3/10
to Tasker
No, ignore what I said sorry. Doesn't work.

Luke

unread,
Nov 8, 2010, 6:48:07 PM11/8/10
to Tasker
I've been wanting to do the same thing actually. I just recently got
Tasker and figure there has to be a way to do it. I'll keep you
posted if I come up with anything, and please do if you find an answer
as well.

Pent

unread,
Nov 9, 2010, 5:14:06 AM11/9/10
to Tasker
There is a %GPS, but it's not 'dynamic'. That means that the Variable
Value state or Variable Set state aren't triggered when it changes.

It *is* technically possible to detect changes without having to keep
asking Android what the state is (polling), so I'll put it on the todo
list.

Pent

Duck Redbeard

unread,
Nov 9, 2010, 5:18:07 AM11/9/10
to Tasker
This has been a picky point for me also. I created a switch widget
for GPS that changes if I use that widget. I incorporated the widget
change in the task. If I use any other means to toggle GPS, this
widget does not reflect the change in state. When I make a profile to
change the widget, I am told that variable (%GPS) is not valid here.

duch...@yahoo.com

unread,
Nov 9, 2010, 7:23:55 AM11/9/10
to Tasker
I have an idea for a workaround that might work for some. It should
work for me.

Use context "Location" and set the area for 999km. 999 km covers much
of my area (and a few other states). The action for me will be to
change the GPS icon to indicate GPS on (I use icons from
iconfinder.com - search for green box - they are available in many
colors). Therefore, anytime GPS is on and sees me in the southeastern
US, it will set the icon as I need it. Since GPS is typically only
used outside, this should work. If this works, I'll post to this
thread.

Duck Redbeard

unread,
Nov 9, 2010, 8:45:19 AM11/9/10
to Tasker
(My last post was on the wrong account...)

Update on my test...no good. I made a location context that covered
pretty much all of the SE USA. Action was to change my GPS tasker
widget icon.
I made sure my Tasker GPS on/off switch was off, went into location
settings, enabled GPS, returned to home screen, verified my Tasker
switch indicated off. I monitored my widget during several Tasker
%LOC updates and the widget never changed.

I tried a few other configurations...Location changed from GPS to Net
- no help. Action changed to Perform Task>GPS on (which includes
changing the target widget icon) - no help.

I considered using %LOCSPD (GPS on would give that value), but
remembered that if GPS is turned off when %LOCSPD is a valid value,
then that value stays as %LOCSPD and cannot be cleared, even with GPS
off. Is there any variable that is set when GPS is on and cleared
when GPS is off? Like a proxy variable?

iphone2n1

unread,
Nov 11, 2010, 12:49:58 PM11/11/10
to Tasker
A side question here. You mention using icons from iconfinder.com. How
do you actually go about using them? Where do you use them - i.e.
widgets, notification bar?

Duck Redbeard

unread,
Nov 11, 2010, 5:31:25 PM11/11/10
to Tasker
Find all the icons you want and put them in a subfolder of .icn in the
tasker directory (suggest creating the subfolder). When you make a
widget, navigate to that folder and select it. I use them as widgets,
simple colored squares show states of:
WiFI (Green=connected, Orange=disconnected, Red=off)
Bluetooth (Green=on, Blue=connected)
Ringer (Green=ring on, Yellow=vibrate, Red=silent)
I use another set of three (Home, Car, Work) to show (and set) what
mode my phone is in, which is a collection of tasks setting volumes,
display brightness, antennae settings

Make sure the icons you are going to use are 48x48 png files.
Iconfinder has a great filter function.

Chris

unread,
Nov 11, 2010, 9:29:49 PM11/11/10
to Tasker
I know that this is getting off track for this thread, but since the
icon issue came up I figured that I would post it here. Pent states
in the User Guide that you should use 48 x 48px icons for medium
density screen devices and 72 x 72px images for high density screen
devices. According to the Android developers site (http://
developer.android.com/guide/practices/ui_guidelines/icon_design.html),
there are also low density screens for which you would use 36 x 36px
icons. The installation instructions that Duck Redbeard gave above
are correct and you do need to use PNG files. Just make sure that you
don't use multiple subdirectories within the directory that you
transfer into the .icn directory on the sd card (i.e. leave all images
within the top level of the directory that you are installing). I
just happened to ask this same question in a different thread recently
and that's the info that I got. I can assure you that it works!
Navigate to the icons using the Tasker icon button in the bottom right
hand side of the Task Edit screen and select the name of the directory
that you installed in /.icn to find your images.

It just so happens that I posted links to over 1200 free icons that
you can use on your Android devices on Profileify today. Here's the
link if you are interested:

1200 + Smokin' Hot Free Icons to Use on Your Android Phone (http://
profileify.com/2010/11/11/1200-smokin-hot-free-icons-to-use-on-your-
android-phone/)

Best,
Chris
http://profileify.com

iphone2n1

unread,
Nov 12, 2010, 9:56:46 AM11/12/10
to Tasker
Great Find! Thanks Duck.

My weather widget is starting to come together at last.

Phil Bilton

unread,
Jan 2, 2015, 9:25:36 AM1/2/15
to tas...@googlegroups.com
Sorry to dig up a old post but since its what i need i thought i would post here.
Im using a lg r watch, lg g3 with lollipop non rooted.
I have used autoinput to enable me to toggle location on/off and change the accuracy from gps to net using autovoice.

What i need to do though is create a notification of whether location services is on or off on request.
So for instance i would say to my watch "is my gps on?" it would then notify me if indeed it is on or off and then ask me "do you want to turn it off or on?"
But i don't know how to get the state of the location services in a notification?
Cheers
Phil

Matt R

unread,
Jan 4, 2015, 5:39:52 AM1/4/15
to tas...@googlegroups.com
It's the %GPS variable ... ?

Matt

Phil Bilton

unread,
Jan 5, 2015, 11:17:25 AM1/5/15
to tas...@googlegroups.com
Thank you but sorry the question was poorly worded. I meant the location services as a hole.

Matt R

unread,
Jan 5, 2015, 6:43:18 PM1/5/15
to tas...@googlegroups.com

Necro mancer

unread,
Aug 9, 2015, 7:17:25 PM8/9/15
to Tasker
Is there an update on the subject? is it possible to use GPS state as context? 

Dave

unread,
Aug 21, 2017, 3:16:47 PM8/21/17
to Tasker
For anyone else who finds this old thread, what Sam posted above is working now. Go to Profiles -> Add -> State -> Variables -> (Variable Value) %GPS ~ On

In which the ~ symbol means "matches"

Then you can create a task to generate an Alert -> Notify (and optionally a second task for Alert -> Notify Cancel (to cancel the notification that has the same title). The Notify task can be assigned to your new GPS Profile and the Notify Cancel task can also be added to the same Profile but as an Exit Task (to cancel the notification when GPS is turned off).

Reply all
Reply to author
Forward
0 new messages