GPS Widget

10 views
Skip to first unread message

Mojo123

unread,
Aug 3, 2010, 6:06:31 PM8/3/10
to Tasker
My car locator widget consists of:

1) set my current location using Variable -> Variable Set, Name:
%PARKPLATZ, To: %LOC.

2) App -> Open Map, Mode: Navigate To, Lat,Long: %PARKPLATZ

My GPS is always set to ON in the phone settings (and I'm outside when
trying this). When I do the steps, the location is not consistently
set correctly at step 1. However, if I first turn on the Nav app and
then do steps 1 and 2, the location is set consistently correctly. Is
this because having GPS turned on in the phone settings only means
that the GPS is available (and will be activated when an app needs
it)? If that's the case, how can I ensure that GPS is REALLY on
before doing step 1? I suppose doing step 2, step 1, and step 2 is an
option, but it seems there should be a more elegant solution.

UncleMike

unread,
Aug 3, 2010, 7:38:32 PM8/3/10
to Tasker
You're right. Having GPS on in the Android settings does not cause it
to keep track of your location. It merely makes it available to apps
that request it.

A workaround for Tasker is to create a profile with a GPS Location
context, give it a name, and then disable it. You don't actually want
the profile to do anything, so you can just use a Stop action as the
only action in the Task. Then when you're in need of a current GPS
location, enable the named profile, wait a reasonable amount of time
(15-30 seconds if you're outdoors should be good), and then disable
the profile again.

What happens is that when you enable a profile with a GPS Location
context, Tasker discards any cached location data and requests a
current location.

Profile: GetGPSfix
Context: Location <actual location doesn't matter>
Enter Task:
Stop

Widget Task:
Profile Status [Name: GetGPSfix] [Set: On]
Wait 30 seconds
Profile Status [Name: GetGPSfix] [Set: Off]
Variable Set [Name: %PARKPLATZ] [To: %LOC]
Reply all
Reply to author
Forward
0 new messages