Accessing global variables in tasker-made apps

764 views
Skip to first unread message

Grant Junno

unread,
Feb 19, 2014, 9:19:33 PM2/19/14
to tas...@googlegroups.com
Hey all,

I'm pretty new to tasker (got my first Android device about 2 weeks ago), so what I'm trying to do is relatively simple. I'm making my own version of this: http://tasker.wikidot.com/car-locator-and-park-timer

Since my car does not have a bluetooth connection I can use as a state, I just made apps that I can click on that will perform each action (refresh action performed when the Minimalistic widget is clicked; widget is supposed to show time parked)


I have all of these pieces working fine in Tasker, but when I export them as apps none of them work because the individual apps aren't accessing the variables that the other ones are setting. The refresh app always sets the time to the current time (since the %TIMEPARKED variable is not loading and it's supposed to be changing the text to %TIME - %TIMEPARKED), the Find app doesn't work because it tries to find directions to %PARKED instead of an actual location, and these two things make the Park app nothing but a waste of battery. I even tried doing something silly and made new apps with one action in them, which is Task -> Perform Task -> Task I already made in tasker in hopes that this would work more like the profile change calls, but no dice. 


The next thing I'm exploring is making an app that will activate a profile that is linked to the task I want, but even if that works it seems that there must be a more straightforward way to do this. Or are apps simply unable to create variables and pass them to each other?

Rich D

unread,
Feb 19, 2014, 9:46:39 PM2/19/14
to Tasker Google Groups Post


> I'm pretty new to tasker (got my first Android device about 2 weeks ago),

Looks like you are swimming quickly for just being in the water 2 weeks..

so what I'm trying to do is relatively simple. I'm making my own version of this: http://tasker.wikidot.com/car-locator-and-park-timer
>
> Since my car does not have a bluetooth connection I can use as a state, I just made apps that I can click on that will perform each action (refresh action performed when the Minimalistic widget is clicked; widget is supposed to show time parked)
>
>

> I have all of these pieces working fine in Tasker, but when I export them as apps none of them work because the individual apps aren't accessing the variables that the other ones are setting. The refresh app always sets the time to the current time (since the %TIMEPARKED variable is not loading and it's supposed to be changing the text to %TIME - %TIMEPARKED), the Find app doesn't work because it tries to find directions to %PARKED instead of an actual location, and these two things make the Park app nothing but a waste of battery. I even tried doing something silly and made new apps with one action in them, which is Task -> Perform Task -> Task I already made in tasker in hopes that this would work more like the profile change calls, but no dice. 
>
>
> The next thing I'm exploring is making an app that will activate a profile that is linked to the task I want, but even if that works it seems that there must be a more straightforward way to do this.

Or are apps simply unable to create variables and pass them to each other?

Bingo....  well kinda bingo..

Apps are totally separate from tasker and other  app factory apps. They will not share any information unless  you do it in a very specific way..

1. You can use the tasker action 'send intent' and the tasker context ' intent received'

2. Have one app write to a file and have the other app or tasker read the file.

3. As you mentioned have one app set something on the device that will trigger in the other app or tasker..

Others might chime in on a few i might have missed but that is basically it.

For your app you just need to put it all in one app.   You can do this by using putting the whole thin in a project and then export the project as a app..

>
> --
> You received this message because you are subscribed to the Google Groups "Tasker" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
> Visit this group at http://groups.google.com/group/tasker.
> For more options, visit https://groups.google.com/groups/opt_out.

Grant Junno

unread,
Feb 19, 2014, 11:38:35 PM2/19/14
to tas...@googlegroups.com
Well I want three individual buttons (One to initiate park, one to update the minimalist text, one to find my car), so can I do that by putting them all in one project? Can I make three different widgets that all come out of one project or something? Further, I specifically want the time to update when I tap the minimalist widget (I know, picky picky, but that's how I want it to work so I'm going to find a way), and I'm not sure how to link the "tap widget" behavior to opening another widget (also I haven't tried, so if it's simply an option and I haven't noticed it yet just tell me I'm being a dolt). 

I'll probably go the trigger route because it seems to be the most in line with what I want to do, though it's a bit messy and circuitous.

Speaking of messy, can I make task folders or something? Or is rearrangement the only task organization technique available?

Thanks for the response!

Matt R

unread,
Feb 20, 2014, 1:18:23 AM2/20/14
to tas...@googlegroups.com
Is there a reason you don't just make the tasks into Tasker shortcuts, and not bother with creating apps at all?

Matt

Rich D

unread,
Feb 20, 2014, 6:26:17 AM2/20/14
to Tasker Google Groups Post


> Well I want three individual buttons (One to initiate park, one to update the minimalist text, one to find my car), so can I do that by putting them all in one project?

It is a android limitation that you can not package widgets directly into app and i believe it is the same for shortcuts.

To make a app as you describe you would need to use the single app icon that is packaged with the app ( it runs the "initial" (not sure of the exact word) task. From there you would show a scene with as many buttons and other gadgets as you like, in other words it would be a 2 press operation from the home screen.

Option 2 would be to set some permanent notifications you can click on but this still makes it a 2 step operation to get to your buttons...

I have never used it but you could check into a widget maker like zooper, it says it has tasker integration not sure if it works with tasker app factory apps though... 

Grant Junno

unread,
Feb 20, 2014, 8:15:07 AM2/20/14
to tas...@googlegroups.com
Well there is at least one reason: I didn't know about tasker shortcuts until you just mentioned them. I'll look into that next, thanks!

Grant Junno

unread,
Feb 20, 2014, 1:21:20 PM2/20/14
to tas...@googlegroups.com
Tasker shortcuts made all of this work exactly as I wanted, and are a way better solution than apps because I can just edit the tasks in Tasker and they're automatically up to date without having to repackage/install. 

Thanks everyone for the advice.
Reply all
Reply to author
Forward
0 new messages