Tasker
Home
Tour
Download
FAQs
Reviews
Wiki
Forum
Main
Pros
Feature Requests
Developer
Userguide
Index: en es fr zh
1 Page: en
More
Developers
Bugs / Limitations
History
Release Notes
Next Version
Plans

Developers: Plugins

Tasker supports Locale-Compatible plugins. Any such plugins installed on the device will appear in the Plugins action (for settings plugins) or state (for condition plugins) category in the Tasker UI.

Please see the Developer Section of the Locale Website for the base specification.

After downloading the Locale platform library, you may need to remove the comments from these lines:

//              packages.add("net.dinglisch.android.taskerm"); //$NON-NLS-1$
//              packages.add("net.dinglisch.android.tasker"); //$NON-NLS-1$
//              packages.add("net.dinglisch.android.taskercupcake"); //$NON-NLS-1$

in src/com/twofortyfouram/locale/PackageUtilities.java so that your plugin can access resources in the Tasker apk.

Tasker Limitations

  • Tasker only supports the value types int, long, float, double, boolean, String
  • From version 1.0.18, String [] values are also supported, as long as they are not null
  • Tasker only supports condition plugins from version 1.1.

Tasker Protocol Additions

Variable Replacement

From version 1.0.10, Tasker will do variable replacements on any String extras in a setting plugin bundle which are specified by the extra:
net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS
The value of this extra should be a String containing a space-separated list of one or more other key/value pairs in the bundle. For each of those other values, Tasker will scan for variable names and replace them with the current values of the variables in Tasker.
Example

Bundle after setup in the plugin activity:

Bundle KeyBundle Value (String)
com.sample.plugin.MYVALUEYour location is currently %LOC +- %LOCACC.
com.sample.plugin.MYOTHERVALUEI am %ONEHUNDRED sure this string won't be touched.
net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYScom.sample.plugin.MYVALUE

Bundle passed to the plugin to fire it...

Bundle KeyBundle Value (String)
com.sample.plugin.MYVALUEYour location is currently -1.0,1.5 +- 500m
com.sample.plugin.MYOTHERVALUEI am %ONEHUNDRED sure this string won't be touched.

Condition Variables

From version 1.2, condition plugins can stipulate local (all lower case) variable names and values which will be visible in any tasks that run as a result of a change in plugin state.

The variable name values pairs should be returned via a bundle extra with the key:

	net.dinglisch.android.tasker.extras.VARIABLES
Example:

Bundle b = new Bundle();
b.putString( "%colour", "red" );
getResultExtras( true ).putBundle( "net.dinglisch.android.tasker.extras.VARIABLES", b );

Notes

Identifying Plugins
Tasker identifies a plugin by the label of its edit activity, not the package name. That means that if you have several package names (beta, trial, release, pro etc) the plugin should continue working when the user changes, as long as the edit activity label doesn't change.