Pass variables to Tasker programatically

122 views
Skip to first unread message

Oleksii Ponomarov

unread,
Feb 23, 2016, 2:33:50 AM2/23/16
to Tasker - Developers
I have some app. In this app, user can add one or more variables, like: 
name: Colour 
value: Red

And after create or edit variable, I want to pass it to Tasker, and use it in any tasks, like tasker global variable. I read instructions on Tasker site, but can't understand, I have to create Tasker Condition or Event plugin? Or there is another way?

P.S.: please excuse my bad English, my native language is Ukrainian

Pent

unread,
Feb 23, 2016, 2:49:05 AM2/23/16
to Tasker - Developers
You shouldn't be trying to set global variables in Tasker from outside. If the
user wants to set a global variable, they can do that from the local variable
that you pass in.

The best method would be to create an event plugin with which you would trigger
an event every time you want to signal a new variable value.

Pent

Oleksii Ponomarov

unread,
Feb 23, 2016, 4:40:29 AM2/23/16
to Tasker - Developers
Thanks for quick answer.
I try to create event plugin using this instruction Tasker Plugin Introduction And there is text: 
"
in QueryReceiver.java, add
   if ( messageID == -1 )
      setResultCode( com.twofortyfouram.locale.Intent.RESULT_CONDITION_UNKNOWN );
   else
before the line
   if (isScreenOn)
"

but "messageID" cannot be resolved.  

вторник, 23 февраля 2016 г., 9:49:05 UTC+2 пользователь Pent написал:

Crafty Apps Support

unread,
Feb 25, 2016, 2:43:43 AM2/25/16
to task...@googlegroups.com

I try to create event plugin using this instruction Tasker Plugin Introduction And there is text: 
"
in QueryReceiver.java, add
   if ( messageID == -1 )
      setResultCode( com.twofortyfouram.locale.Intent.RESULT_CONDITION_UNKNOWN );
   else
before the line
   if (isScreenOn)
"

but "messageID" cannot be resolved. 

Did you add the line to include the message id in BackgroundService.java ?

Check also there's nothing in QueryReceiver stripping the id, e.g. by examing
the intent contents right at the top of onReceive.

Pent
Reply all
Reply to author
Forward
0 new messages