3.5. Modules API Reference

This section provide all details concerned with available SDK modules, with specifications for all related components (e.g. Trigger, Condition Checker, Performer).

Please notice that some modules require OAuth authentication (e.g. Facebook, Gmail). More details on how to exploit such modules by effectively handling authentication, will be provided in section OAuth Based Modules.

Module Description Auth Version Dependencies
Activity Manager Allows to handle applications installed on device.   1 Core
Airplane Allows to control airlplane mode.   3 Core
Alarm Defines functionalities concerned with alarms and temporal controls.   3 Core
Battery Allows to control functionalities concerned with device battery.   1 Core
Bluetooth Allows to control Bluetooth on device.   4 Core
Camera Defines functionalities for controlling device camera.   1 Core
Contacts Allows interfacing with contacts available on device.   1 Core
Core Defines core components for building rules and provides all basic value types to be used in other modules.   1 -
Data Sync Allows to control background synchronization settings.   1 Core
Dropbox Implements integration with Dropbox. Yes 4 Core
Facebook Implements integration with Facebook. Yes 1 Core
Google Calendar Implements integration with Google Calendar. Yes 1 Core Location
Google Drive Implements integration with Google Drive. Yes 5 Core
Gmail Implements integration with Gmail. Yes 4 Core, Contacts
Headphone Allows to check headphones presence.   1 Core
Instagram Implements integration with Instagram. Yes 4 Core
Location Allows to determine device position.   3 Core
Notification Allows to show notifications during rule execution.   1 Core
Shake Provides features to handle and react to shake gestures.   1 Core
SMS Allows to send and receive SMS.   1 Core, Contacts, Telephony
Telephony Allows to control basic device features.   1 Core, Contacts
Text To Speech Executes Text To Speech functionalities.   1 Core
Twitter Implements integration with Twitter. Yes 1 Core
Weather Provides utilities for weather forecast and for monitoring current weather conditions.   2 Core, Location
WiFi Allows to control WiFi on device.   3 Core

3.5.1. OAuth Based Modules

All modules implementing integration with external services require an authentication flow to be implemented before using them. Common choice in this sense is OAuth, that is an open standard for authorization. OAuth provides client applications a secure delegated access to server resources on behalf of a resource owner. In particular, idea behind OAuth is to allow alphanumeric access tokens to be issued to third-party clients by an authorization server, with the approval of the resource owner. The client then uses the access token to access the protected resources hosted by the resource server.

All modules having access to an external service need to implement the corresponding OAuth flow (in some cases like Facebook, such flow is already implemented by a dedicated SDK). Target is getting a valid access token to be used for all requests to the external server. Atooma SDK defines ab abstract class ChannelHandler that is used for implementing the relationship between a module and its OAuth flow. Such class provides three main methods and its usage requires three abstract methods to be implemented.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
 * To be invoked for connecting to a specific channel,
 * retrieving corresponding valid access token.
 */
public void connect(Context context);

/**
 * To be invoked for disconnecting from a specific channel,
 * clearing stored access token.
 */
public void disconnect(Context context);

/**
 * To be invoked for checking whether a valid token
 * is already available or not. This method can be
 * used for deciding whether to activate a rule or not.
 */
public boolean isConnected(Context context);

/**
 * Method implementing logic for starting OAuth flow
 * for the current channel.
 */
abstract protected void doConnection(Activity source);

/**
 * Method implementing logic for retrieving username
 * from outcome of the OAuth flow execution.
 */
abstract protected String extractUserFromResult(Intent data);

/**
 * Method implementing logic for retrieving access token
 * from outcome of the OAuth flow execution.
 */
abstract protected String extractTokenFromResult(Intent data);

3.5.1.1. Dropbox

The OAuth authentication flow via Dropbox is already implemented by a dedicated SDK. The only information required to perform the authentication is the setting of some data within the Manifest file:

1
2
3
4
5
6
7
<meta-data
  android:name="dropbox_app_key"
  android:value="YOUR_APP_KEY"/>

<meta-data
  android:name="dropbox_app_secret"
  android:value="YOUR_APP SECRET"/>

This data can be found in Dropbox Developer page, within the settings of your own application.

Besides the user application’s data another necessary information is required, that is the declaration of the Dropbox Authentication Activity within the Manifest.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<activity
  android:name="com.dropbox.client2.android.AuthActivity"
  android:configChanges="orientation|keyboard"
  android:launchMode="singleTask"
  android:screenOrientation="portrait">
  <intent-filter>
    <!-- Change this to be 'db-' followed by your app key -->
    <data android:scheme="db-YOUR_APP_KEY"/>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
</activity>

3.5.1.2. Google

Let’s consider for example Gmail module. A possible implementation of ChannelHandler is reported below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class GmailChannelHandler extends ChannelHandler {

  @Override
  protected void doConnection(Activity source) {
    Intent intent = new Intent(source, GmailActivity.class);
    source.startActivityForResult(intent, 8888);
  }

  @Override
  protected String extractUserFromResult(Intent data) {
    return data.getStringExtra(GoogleOAuth2Activity.PARAM_EMAIL);
  }

  @Override
  protected String extractTokenFromResult(Intent data) {
    return data.getStringExtra(GoogleOAuth2Activity.PARAM_TOKEN);
  }

  @Override
  public boolean isConnected(Context context) {
    return !TextUtils.isEmpty(getToken(context));
  }

}

Where GoogleOAuth2Activity is an SDK Activity that encapsulates the entire Google Oauth2 flow, simplifying the integration of Google services. As an example, for Gmail we’ll have following implementation:

1
2
3
4
5
6
7
8
public class GmailActivity extends GoogleOAuth2Activity {

  @Override
  protected String getScope() {
    return "https://mail.google.com/";
  }

}

In case Play Services are not available, GoogleOAuth2Activity will handle authentication via web but it requires the setup of two meta-data fields in the manifest:

1
2
3
4
5
6
7
<meta-data
  android:name="com.google.oauth.ClientId"
  android:value="your CLIENT_ID" />

<meta-data
  android:name="com.google.oauth.ClientSecret"
  android:value="your CLIENT_SECRET" />

3.5.1.3. Instagram

Authentication via Instagram requires additional meta-data fields in the manifest:

1
2
3
4
5
6
7
<meta-data
  android:name="instagram_client_id"
  android:value="YOUR_CLIENT_ID"/>

<meta-data
  android:name="instagram_redirect_uri"
  android:value="YOUR_REDIRECT_URI"/>

This data can be found in Instagram Developer page, within the settings of your own application. The redirect URI should be implemented on a dedicated server. The logic of the endpoint of the redirect URI must follow the instructions written here on Instagram Developers Web Site (Server Side Explicit Flow). Essentially, your endpoint will receive a ‘code’ parameter from Instagram. All you have to do is performing a HTTP POST to https://api.instagram.com/oauth/access_token in order to convert the request token to an access token. This POST request must contain the following parameters in the payload: client_id, client_secret, redirect_uri, grant_type, code. The grant_type parameters must be set to ‘authorization_code’, while the code parameter is the code just received. A successful response contains the access_token, id, username, full_name, profile_picture parameters. All you have to do is returning all these parameters in a JSON format as follows:

{ obj:
  {
  'token': '<ACCESS_TOKEN>'
  'username': '<USERNAME>'
  'name': '<FULL_NAME>'
  'id': '<ID>'
  'picture': '<PROFILE_PICTURE>'
  }
}

If all these steps are performed correctly, the user authenticated with your Instagram Application will be able to use the the facilities provided by the SDK.

3.5.1.4. Twitter

Authentication via Twitter requires additional meta-data fields in the manifest:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<meta-data
  android:name="twitter_app_id"
  android:value="YOUR_APP_ID"/>

<meta-data
  android:name="twitter_consumer_key"
  android:value="YOUR_CONSUMER_KEY"/>

<meta-data
  android:name="twitter_consumer_secret"
  android:value="YOUR_CONSUMER_SECRET"/>

<meta-data
  android:name="twitter_redirect_uri"
  android:value="YOUR_REDIRECT_URI"/>

This data can be found in Twitter Developer page, within the settings of your own application. The redirect URI should be implemented on a dedicated server. The logic of the endpoint of the redirect URI must follow the instructions written here on Twitter Developers Web Site. Essentially, your endpoint will receive two parameters from Twitter: oauth_token and oauth_verifier. All you have to do is performing a HTTP POST to https://api.twitter.com/oauth/access_token in order to convert the request token to an access token. This POST request must contain the Authorization header with your Consumer Key, your Consumer Secret, and the oauth_token just received. The request must also contain the oauth_verifier obtained, with Content-Type: application/x-www-form-urlencoded. A successful response contains the oauth_token, oauth_token_secret, user_id, and screen_name parameters. All you have to do is returning all these parameters in a JSON format. If all these steps are performed correctly, the user authenticated with your Twitter Application will be able to use the Triggers and Performers provided by the SDK.

3.5.2. Activity Manager

  • Identifier - ACTIVITY-MANAGER
  • Description - Allows to control applications within current device.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.2.1. Value Types

Name Description From Version Wrapper Class
APP-PACKAGE Represents an application. 1 VT_AppPackage_Wrapper

3.5.2.2. Trigger App Installed

Name APP-INSTALLED
Description Executes when installing a new application.
  Type Name Description
Variables ACTIVITY-MANAGER.APP-PACKAGE APP-PACKAGE Package of the installed application.
CORE.STRING APP-NAME Name of the installed application.

3.5.2.3. Trigger App Uninstalled

Name APP-UNINSTALLED
Description Executes when uninstalling an application.
  Type Name Description
Variables ACTIVITY-MANAGER.APP-PACKAGE APP-PACKAGE Package of the uninstalled application.

3.5.2.4. Performer Launch App

Name APP-LAUNCH
Description Launch an application.
  Type Name Required Description
Parameters ACTIVITY-MANAGER.APP-PACKAGE APP-PACKAGE Yes The application to execute.

3.5.3. Airplane

  • Identifier - AIRPLANE
  • Description - Allows to control device airplane mode.
  • Current Version - 3
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.3.1. Trigger Airplane Mode On

Name ON
Description Executes when airplane mode is turned on.

3.5.3.2. Trigger Airplane Mode Off

Name OFF
Description Executes when airplane mode is turned off.

3.5.3.3. Condition Checker Airplane Mode On

Name ON
Description Returns true if airplane mode is turned on, false otherwise.

3.5.3.4. Condition Checker Airplane Mode Off

Name OFF
Description Returns true if airplane mode is turned off, false otherwise.

3.5.3.5. Performer Airplane Mode On

Name ON
Description Turns airplane mode on.

3.5.3.6. Performer Airplane Mode Off

Name OFF
Description Turns airplane mode off.

3.5.4. Alarm

  • Identifier - ALARM
  • Description - Defines functionalities concerned with alarms and temporal controls.
  • Current Version - 3
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.4.1. Trigger Alarm

Name ALARM
Description Executes every day at specified time (like a normal alarm clock).
  Type Name Required Description
Parameters CORE.TIME TIME Yes Activation time.
CORE.BOOLEAN REPEAT Yes If true, alarm is repeated daily in all days defined by REPEAT-DAYS, otherwise only at next occurrence of TIME.
CORE.DAY-OF-WEEK-ARRAY REPEAT-DAYS Yes Array with all days of the week when alarm must activate. It is ignored in case REPEAT is false.

3.5.4.2. Trigger Alarm Every

Name ALARM-EVERY
Description Executes at rule activation and repeat indefinitely at regular intervals.
  Type Name Required Description
Parameters CORE-DURATION INTERVAL Yes Repetition interval.

3.5.4.3. Condition Checker Time Between

Name TIME-BETWEEN
Description Returns true if current time is within the specified interval.
  Type Name Required Description
Parameters CORE.TIME BEGIN Yes Begin time of interval to check.
CORE.TIME END Yes End time of interval to check.

3.5.5. Battery

  • Identifier - BATTERY
  • Description - Allows to control functionalities concerned with device battery.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.5.1. Trigger Battery Plugged

Name PLUGGED
Description Executes when device is connected to battery charger.

3.5.5.2. Trigger Battery Unplugged

Name UNPLUGGED
Description Executes when device is disconnected from battery charger.

3.5.5.3. Trigger Level

Name UNPLUGGED
Description Executes when battery level changes.
  Type Name Required Description
Parameters CORE.PERCENT-FILTER FILTER Yes Percentage filter to apply.

3.5.5.4. Condition Checker Battery Plugged

Name PLUGGED
Description Returns true if device is connected to battery charger.

3.5.5.5. Condition Checker Battery Unplugged

Name UNPLUGGED
Description Returns true if device is disconnected to battery charger.

3.5.5.6. Condition Checker Level

Name LEVEL
Description Returns true if current level matches filter criteria, false otherwise.
  Type Name Required Description
Parameters CORE.PERCENT-FILTER FILTER Yes Percentage filter to apply.

3.5.6. Bluetooth

  • Identifier - BLUETOOTH
  • Description - Allows to control Bluetooth on device.
  • Current Version - 4
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.6.1. Trigger Bluetooth Enabled

Name ENABLED
Description Executes when Bluetooth is enabled.

3.5.6.2. Trigger Bluetooth Disabled

Name DISABLED
Description Executes when Bluetooth is disabled.

3.5.6.3. Trigger Bluetooth Device Found

Name FOUND
Description Executes when presence of a new Bluetooth device is detected. This can happen in case of execution of performer BLUETOOTH.DISCOVER or in case of manual scan by the user.
  Type Name Required Description
Parameters CORE.TEXT-FILTER NAME-FILTER No If present, activates trigger only if detected device name matches filter criteria.
Variables CORE.STRING DEVICE-NAME Detected device name.
CORE.STRING DEVICE-ADDRESS Detected device hardware address.

3.5.6.4. Condition Checker Bluetooth Enabled

Name ENABLED
Description Returns true if Bluetooth is enabled, false otherwise.

3.5.6.5. Condition Checker Bluetooth Disabled

Name DISABLED
Description Returns true if Bluetooth is enabled, false otherwise.

3.5.6.6. Performer Bluetooth On

Name ON
Description Activates Bluetooth.
  Type Name Required Description
Parameters CORE.BOOLEAN DISCOVERABLE YES Declares if discoverable or not.

3.5.6.7. Performer Bluetooth Off

Name OFF
Description Deactivates Bluetooth.

3.5.6.8. Performer Bluetooth Discover

Name DISCOVER
Description Begin search of devices, evantually activating Bluetooth.

3.5.7. Camera

  • Identifier - CAMERA
  • Description - Defines functionalities for controlling device camera.
  • Current Version - 1
  • Initialization - Checks whether camera hardware is present on device or not.
  • Destroy - None
  • Dependencies - Core

3.5.7.1. Trigger New Picture

Name NEW-PICTURE
Description Executes a new photo is taken.
  Type Name Description
Variables CORE.URI URI Path of new picture.

3.5.7.2. Trigger New Video

Name NEW-VIDEOCLIP
Description Executes when a new videoclip is recorded.
  Type Name Description
Variables CORE.URI URI Path of new videoclip.

3.5.8. Contacts

  • Identifier - CONTACTS
  • Description - Allows interfacing with contacts available on device.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.8.1. Value Types

Name Description From Version Wrapper Class
PHONE-NUMBER

Represent a phone number. It can be of two different types:

  • A literal number
  • A reference to a contact on device
1 VT_PhoneNumber_Wrapper
EMAIL-ADDRESS

Represent an email address. It can be of two different types:

  • A literal string
  • A reference to a contact on device
1 VT_EmailAddress_Wrapper

3.5.9. Core

  • Identifier - CORE
  • Description - Defines core components for building rules and provides all basic value types to be used in other modules.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - None

3.5.9.1. Business Types

Name Description
NumberFilter Filter for Number type. Includes constants for representing filter type (LESS, EQUAL, GREATER)
PercentFilter Filter for Percent type. Includes constants for representing filter type (LESS, EQUAL, GREATER)
TextFilter Filter for Number type. Includes constants for representing filter type (EQUALS, CONTAINS, STARTS_WITH, ENDS_WITH)

3.5.9.2. Value Types

Name Description From Version Wrapper Class
STRING Represents a random length string. 1 VT_String_Wrapper
TEXT-FILTER Represent a filter for text strings. It is made of an index aimed to identify filter type, a boolean allowing to define if comparison should be case sensitive and a string with value to use for filtering matching. 1 VT_TextFilter_Wrapper
BOOLEAN Represent a boolean value (true or false). 1 VT_Boolean_Wrapper
NUMBER Represent a decimal number. 1 VT_Number_Wrapper
NUMBER-FILTER Represent a filter for integer and decimal numbers. It is made of an index aimed to identify filter type and a decimal number to use for filtering. 1 VT_NumberFilter_Wrapper
PERCENT Represent an integer percent value. 1 VT_Percent_Wrapper
PERCENT-FILTER Represent a filter for integer percent values. It is made of an index aimed to identify filter type and an integer number to use for filtering. 1 VT_PercentFilter_Wrapper
TIMESTAMP Represent a date and time with millisectonds precision. 1 VT_Timestamp_Wrapper
DATE Represent a date. 1 VT_Date_Wrapper
TIME Represent a time with milliseconds precision. 1 VT_Time_Wrapper
DURATION Represent a duration, expressed in seconds. 1 VT_Duration_Wrapper
DAY-OF-WEEK Represent a day of the week. 1 VT_DayOfWeek_Wrapper
DAY-OF-WEEK-ARRAY Represent an array of days of the week. No duplicates are allowed and array max size is 7. 1 VT_DayOfWeekArray_Wrapper
URI Represent a reference to a resource. 1 VT_Uri_Wrapper

3.5.10. Data Sync

  • Identifier - DATA-SYNC
  • Description - Allows to control background synchronization settings.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.10.1. Trigger Sync Enabled

Name ON
Description Enable background synchronization.

3.5.10.2. Trigger Sync Disabled

Name OFF
Description Disable background synchronization.

In practice, using this module will have the effect of controlling account synchronization flag reported in the screenshot below (taken from a Google Nexus 5).

Configuration Flag Configuration Warning

3.5.11. Dropbox

  • Identifier - DROPBOX
  • Description - Implements integration with Dropbox.
  • Initialization - Check availability of Dropbox App Key and App Secret as meta-data. Set up Dropbox AuthActivity in Manifest file in order for the client application to interact with Dropbox API.
  • Destroy - None
  • Dependencies - Core

3.5.11.1. Value Types

Name Description From Version Wrapper Class
URI Represents a Dropbox Relative Uri. 1 VT_Dropbox_Uri_Wrapper

3.5.11.2. Trigger Directory Created

Name DIR-CREATED
Description Executes when a new directory is created by the Dropbox user.
  Type Name Required Description
Parameters DROPBOX.URI DIR-PATH No Filter criteria for path of the folder created.
CORE.STRING DIR-NAME No Filter criteria for name of the folder created.
Variables DROPBOX.URI DIR-NAME Directory name.

3.5.11.3. Trigger Directory Deleted

Name DIR-CREATED
Description Executes when a directory is deleted by the Dropbox user.
  Type Name Required Description
Parameters DROPBOX.URI DIR-PATH No Filter criteria for path of the folder deleted.
CORE.STRING DIR-NAME No Filter criteria for name of the folder deleted.
Variables DROPBOX.URI DIR-NAME Directory name.

3.5.11.4. Trigger File Added

Name FILE-ADDED
Description Executes when a file is added by the Dropbox user.
  Type Name Required Description
Parameters DROPBOX.URI FILE-PATH No Filter criteria for path of the file added.
CORE.STRING FILE-NAME No Filter criteria for name of the file added.
Variables DROPBOX.URI FILE-PATH File path.

3.5.11.5. Trigger File Deleted

Name FILE-DELETED
Description Executes when a file is deleted by the Dropbox user.
  Type Name Required Description
Parameters DROPBOX.URI FILE-PATH No Filter criteria for path of the file deleted.
CORE.STRING FILE-NAME No Filter criteria for name of the file deleted.
Variables DROPBOX.URI FILE-PATH File path.

3.5.11.6. Trigger Media Uploaded

Name MEDIA-UPLOADED
Description Executes when a media file is uploaded by the Dropbox user.
  Type Name Required Description cc
Parameters DROPBOX.URI FILE-PATH No Filter criteria for path of the media uploaded.
CORE.STRING FILE-NAME No Filter criteria for name of the media uploaded.
Variables DROPBOX.URI DIR-TO Media File path.

3.5.11.7. Trigger Space Used

Name SPACE-USED
Description Executes when the used space in Dropbox is equal/greater/lesser than a predefined percentage value passed as a parameter.
  Type Name Required Description
Parameters CORE.PERCENT-FILTER PERCENT Yes Filter criteria for used space.

3.5.11.8. Performer Create Directory

Name DIR-CREATE
Description Creates a new directory in Dropbox.
  Type Name Required Description
Parameters DROPBOX.URI DIR-PATH No Dropbox relative path of the directory to be created.
CORE.STRING DIR-NAME Yes Name of the directory to be created.

3.5.11.9. Performer Delete Directory

Name DIR-DELETE
Description Deletes an existing directory in Dropbox.
  Type Name Required Description
Parameters DROPBOX.URI DIR-PATH No Dropbox relative path of the directory to be deleted.
CORE.STRING DIR-NAME Yes Name of the directory to be deleted.

3.5.11.10. Performer Add File

Name FILE-ADD
Description Adds a new file in Dropbox.
  Type Name Required Description
Parameters DROPBOX.URI FILE-PATH No Dropbox relative path of the file to be added.
CORE.URI FILE Yes Uri of the file to be added.

3.5.11.11. Performer Delete File

Name FILE-DELETE
Description Deletes an existing file in Dropbox.
  Type Name Required Description
Parameters DROPBOX.URI DIR-PATH Yes Dropbox relative Uri of the file to be deleted.

3.5.11.12. Performer Share File

Name FILE-SHARE
Description Shares an existing file in Dropbox.
  Type Name Required Description
Parameters DROPBOX.URI FILE-PATH No Dropbox relative path of the file to be shared.
CORE.STRING FILE-NAME Yes Name of the file to be shared
Variables CORE.LINK LINK File link.

3.5.12. Facebook

  • Identifier - FACEBOOK
  • Description - Implements integration with Facebook.
  • Initialization - Checks availability of Facebook Application Id as meta-data.
  • Destroy - None
  • Dependencies - Core

3.5.12.1. Value Types

Name Description From Version Wrapper Class
PROFILE Represents a Facebook profile, with id and name. 1 VT_Profile_Wrapper

3.5.12.2. Trigger Status Update

Name STATUS-UPDATE
Description Executes when weather forecast for following day is Cloudy.
Logic Periodic check every 10 minutes.
  Type Name Required Description
Parameters FACEBOOK.PROFILE PROFILE No Profile to monitor. If empty, current profile is monitored.
CORE.TEXT-FILTER TEXT-FILTER No Filter criteria for status.

3.5.12.3. Trigger Birthday

Name BIRTHDAY
Description Executes when weather forecast for following day is Cloudy.
Logic Periodic check every 12 hours.
  Type Name Required Description
Parameters FACEBOOK.PROFILE PROFILE Yes Profile to monitor.
CORE.NUMBER DAYS-BEFORE No Filter criteria for status.

3.5.12.4. Performer Update Status

Name UPDATE-STATUS
Description Executes when weather forecast for following day is Cloudy.
  Type Name Required Description
Parameters CORE.STRING TEXT Yes Status message.

3.5.12.5. Performer Post Link

Name POST-LINK
Description Executes when weather forecast for following day is Cloudy.
  Type Name Required Description
Parameters CORE.STRING LINK Yes Link to share.
Parameters CORE.STRING CAPTION Yes Caption for link.
Parameters CORE.STRING DESCRIPTION No Link description.

3.5.13. Google Calendar

  • Identifier - GCALENDAR
  • Description - Implements integration with Google Calendar.
  • Initialization - Checks availability of Play Services, if not available checks availability of com.google.oauth.ClientId and com.google.oauth.ClientSecret as meta-data.
  • Destroy - None
  • Dependencies - Core, Location

3.5.13.1. Value Types

Name Description From Version Wrapper Class
EVENT Represents a Google Calendar event. 1 VT_Event_Wrapper
CALENDAR Represents a User Google Calendar. 1 VT_Calendar_Wrapper

3.5.13.2. Trigger Calendar Event

Name ON-EVENT
Description Executes when a calendar event starts.
Logic Periodic check every 10 minutes.
  Type Name Required Description
Parameters GCALENDAR.CALENDARDESC CALENDARDESC Yes User Calendar description.
CORE.STRING KEYWORD No Calendar keyword to match.
LOCATION.AREA LOCATION No Location of the Event.
Variables GCALENDAR.EVENT EVENTTOSEND Calendar Event.
CORE.STRING EVENTPOS Location of the event

3.5.13.3. Trigger Tomorrow Overloaded

Name ON-OVERLOAD
Description Executes when tomorrow has more than N events, where N is a parameter provided by user. Please notice that trigger fires only once per day, unless number of events changes going below and above limit again.
Logic Periodic check every 10 minutes.
  Type Name Required Description
Parameters GCALENDAR.CALENDARDESC CALENDARDESC Yes User Calendar description.
CORE.NUMBER LIMIT Yes Limit for tomorrow events.
Variables CORE.NUMBER NUM-EVENTS Number of tomorrow events.

3.5.13.4. Performer Create Event

Name CREATE-EVENT
Description Sends an email with specified parameters.
  Type Name Required Description
Parameters GCALENDAR.EVENT EVENT Yes Event to be created.

3.5.14. Google Drive

  • Identifier - GDRIVE
  • Description - Implements integration with Google Drive.
  • Initialization - Checks availability of Play Services, if not available checks availability of com.google.oauth.ClientId and com.google.oauth.ClientSecret as meta-data.
  • Destroy - None
  • Dependencies - Core

3.5.14.1. Value Types

Name Description From Version Wrapper Class
URI Represents a Google Drive Parent Folder Identifier 5 VT_Dropbox_Uri_Wrapper

3.5.14.2. Trigger Directory Added

Name DIRADDED
Description Executes when a new directory is added by the Google Drive Dropbox user.
Logic Periodic check every 15 minutes.
  Type Name Required Description
Parameters CORE.STRING DIR-NAME No Filter criteria for name of the folder added.

3.5.14.3. Trigger File Added

Name FILEADDED
Description Executes when a new file is added by the Google Drive Dropbox user.
Logic Periodic check every 15 minutes.
  Type Name Required Description
Parameters CORE.STRING DIR-NAME No Filter criteria for name of the file added.

3.5.14.4. Performer Add Directory

Name DIRADD
Description Adds a folder in Google Drive
  Type Name Required Description
Parameters CORE.STRING DIR Yes Name of of the folder to be added.
Parameters GDRIVE.URI DIR-ID No Parent directory identifier of the folder to be added.

3.5.14.5. Performer Delete Directory

Name DIRDELETE
Description Deletes a folder in Google Drive
  Type Name Required Description
Parameters CORE.STRING DIR Yes Name of of the folder to be deleted.
Parameters GDRIVE.URI DIR-ID No Parent directory identifier of the folder to be deleted.

3.5.15. Gmail

  • Identifier - GMAIL
  • Description - Implements integration with Gmail.
  • Initialization - Checks availability of Play Services, if not available checks availability of com.google.oauth.ClientId and com.google.oauth.ClientSecret as meta-data.
  • Destroy - None
  • Dependencies - Core, Contacts

3.5.15.1. Trigger Incoming Email

Name INCOMING
Description Executes when receiving a new email.
Logic Based on real time updates from Google. It works even without Play Services (GCM).
  Type Name Required Description
Parameters CONTACTS.EMAIL-ADDRESS SENDER No Email sender.
CORE.TEXT-FILTER SUBJECT-FILTER No Email subject filter.
CORE.TEXT-FILTER BODY-FILTER No Email body filter.
Variables CONTACTS.EMAIL-ADDRESS SENDER Email sender.
CORE.STRING SENDER-EMAIL Email sender email.
CORE.STRING SENDER-NAME Email sender name.
CORE.STRING SUBJECT Email subject.
CORE.STRING BODY Email body.
CORE.URI ATTACH Email attachment.

3.5.15.2. Performer Send

Name SEND
Description Sends an email with specified parameters.
  Type Name Required Description
Parameters CONTACTS.EMAIL-ADDRESS RECIPIENT Yes Email recipient.
CORE.STRING SUBJECT No Email subject.
CORE.STRING BODY No Email body.
CORE.URI ATTACH No Email attachment as Content Uri.

3.5.16. Headphone

  • Identifier - HEADPHONE
  • Description - Allows to check headphones presence
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.16.1. Trigger Headphone Plugged

Name HEADPHONE-PLUGGED
Description Executes when jack is plugged in

3.5.16.2. Trigger Headphone Unplugged

Name HEADPHONE-UNPLUGGED
Description Executes when jack is plugged out

3.5.16.3. Condition Checker Headphone Plugged

Name HEADPHONE-PLUGGED
Description Checks if jack is plugged in

3.5.16.4. Condition Checker Headphone Unplugged

Name HEADPHONE-PLUGGED
Description Checks if jack is plugged out

3.5.17. Instagram

  • Identifier - INSTAGRAM
  • Description - Implements integration with Instagram.
  • Initialization - Check availability of Instagram Client ID as meta-data. Set up redirect uri as meta-data (Only the logic of the redirect uri should be implemented and running on a dedicated server). Implementation of Server Side (Explicit) Flow. More info in https://instagram.com/developer/authentication/
  • Destroy - None
  • Dependencies - Core

3.5.17.1. Trigger New Like

Name NEW-LIKE
Description Executes when a new “like” is received on a user’s media posted on Instagram.
Logic Periodic check every 30 minutes.

3.5.17.2. Trigger New Photo From Me

Name NEW-PHOTO-FROM-ME
Description Executes when a new photo is posted by the user on Instagram.
Logic Periodic check every 20 minutes.

3.5.17.3. Trigger Photo From Following

Name NEW–PHOTO-FROM-FOLLOWING
Description Executes when a new photo is posted by a user followed by the current user.
Logic Periodic check every 20 minutes.

3.5.17.4. Trigger Video From Me

Name NEW-VIDEO-FROM-ME
Description Executes when a new video is posted by the user on Instagram.
Logic Periodic check every 20 minutes.

3.5.17.5. Trigger New Video From Following

Name NEW-VIDEO-FROM-FOLLOWING
Description Executes when a new video is posted by a user followed by the current user.
Logic Periodic check every 20 minutes.

3.5.18. Location

  • Identifier - LOCATION
  • Description - Allows to determine device position.
  • Current Version - 3
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.18.1. Value Types

Name Description From Version Wrapper Class
POSITION Represents a position through latitude and longitude coordinates. 1 VT_Position_Wrapper
AREA Represents a circular area, defined through a centre (latitude and longitude) and a radius. 1 VT_Area_Wrapper

3.5.18.2. Trigger Location In

Name IN
Description Executes when entering into an Area.
  Type Name Required Description
Parameters LOCATION.AREA AREA Yes Area to monitor

3.5.18.3. Trigger Location Out

Name OUT
Description Executes when exiting from an Area.
  Type Name Required Description
Parameters LOCATION.AREA AREA Yes Area to monitor

3.5.18.4. Condition Checker In

Name IN
Description Returns true if current position is inside the specified area.
  Type Name Required Description
Parameters LOCATION.AREA AREA Yes Area to monitor

3.5.18.5. Condition Checker Out

Name OUT
Description Returns true if current position is outside of the specified area.
  Type Name Required Description
Parameters LOCATION.AREA AREA Yes Area to monitor

3.5.19. Notification

  • Identifier - NOTIFICATION
  • Description - Allows to show notifications during rule execution.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.19.1. Performer Status Bar

Name STATUS-BAR
Description Shows a notification on status bar.
  Type Name Required Description
Parameters CORE.STRING TITLE Yes Notification title.
CORE.STRING MESSAGE Yes Notification message.

3.5.19.2. Performer Toast

Name TOAST
Description Shows a toast notification.
  Type Name Required Description
Parameters CORE.STRING TEXT Yes Message to show.

3.5.20. Shake

  • Identifier - SHAKE
  • Description - Provides features to handle and react to shake gestures.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.20.1. Trigger Shake Horizontal

Name SHAKE-HORIZONTAL
Description Executes in case of horizontal device shake.
  Type Name Required Description
Parameters CORE.PERCENT SENSITIVE No Shake sensitivity.

3.5.20.2. Trigger Shake Vertical

Name SHAKE-VERTICAL
Description Executes in case of vertical device shake.
  Type Name Required Description
Parameters CORE.PERCENT SENSITIVE No Shake sensitivity.

3.5.21. SMS

  • Identifier - SMS
  • Description - Allows to send and receive SMS.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core, Contacts, Telephony

3.5.21.1. Trigger Incoming SMS

Name INCOMING
Description Executes when receiving an SMS.
  Type Name Required Description
Parameters CONTACTS.PHONE-NUMBER SENDER No If present, trigger is executed only if SMS sender matches with provided one.
CORE.TEXT-FILTER TEXT-FILTER No If present, trigger is executed only if SMS content matches filter.
Variables CORE.STRING TEXT Message content.
CORE.TIMESTAMP TIMESTAMP Message date and time.
CORE.STRING SENDER.NAME Eventual sender name, otherwise null.
CONTACTS.PHONE-NUMBER SENDER.PHONE-NUMBER Eventual sender number, otherwise null.

3.5.21.2. Performer Send SMS

Name SEND
Description Sends an SMS.
  Type Name Required Description
Parameters CORE.STRING TEXT Yes Message content.
CONTACTS.PHONE-NUMBER RECIPIENT-NUMBER Yes Recipient number.

3.5.22. Telephony

  • Identifier - TELEPHONY
  • Description - Allows to control basic device features.
  • Initialization - Looks for availability of mobile phone hardware (GSM).
  • Destroy - None
  • Dependencies - Core, Contacts

3.5.22.1. Value Types

Name Description From Version Wrapper Class
SIGNAL-STRENGTH Represents signal strength. 1 VT_SignalStrength_Wrapper

3.5.22.2. Trigger Ringing

Name RINGING
Description Executes when device is ringing for an incoming call.
  Type Name Required Description
Parameters CONTACTS.PHONE-NUMBER PHONE-NUMBER No If present, trigger is executed only if caller number matches with provided one.
Variables CONTACTS.PHONE-NUMBER PHONE-NUMBER Eventual caller number, otherwise null.

3.5.22.3. Trigger Offhook

Name OFFHOOK
Description Executes when a call starts.

3.5.22.4. Trigger Idle

Name IDLE
Description Executes when device, after a call, comes back to idle status.

3.5.22.5. Trigger Signal Strength

Name SIGNAL-STRENGHT
Description Executes when GSM signal strength changes.
  Type Name Description
Variables TELEPHONY.SIGNAL-STRENGTH STRENGHT Detected signal strength when trigger executes

3.5.22.6. Performer Answer

Name ANSWER
Description Answer to an incoming call (so it can only work in case there is an incoming call).

3.5.22.7. Performer Reject

Name REJECT
Description Reject an incoming call (so it can only work in case there is an incoming call).

3.5.22.8. Performer Mute

Name MUTE
Description Set mute to an incoming call (so it can only work in case there is an incoming call).

3.5.22.9. Performer Call Number

Name CALL-PHONE-NUMBER
Description Make a call to a provided number.
  Type Name Required Description
Parameters CONTACTS.PHONE-NUMBER PHONE-NUMBER Yes Number to call.

3.5.22.10. Performer End Call

Name END-CALL
Description Terminate a call.

3.5.22.11. Performer Voice Volume

Name VOICE-VOLUME
Description Set voice volume for calls.
  Type Name Required Description
Parameters CORE.PERCENT VOLUME Yes Volume percent value.

3.5.22.12. Performer Ringer Volume

Name RINGER-VOLUME
Description Set ringer volume.
  Type Name Required Description
Parameters CORE.PERCENT VOLUME Yes Volume percent value.

3.5.23. Text To Speech

  • Identifier - TEXT-TO-SPEECH
  • Description - Executes Text To Speech functionalities.
  • Current Version - 1
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.23.1. Performer Speak

Name SPEAK
Description Vocalizes a text.
  Type Name Required Description
Parameters CORE.STRING TEXT Yes Text to vocalize.

3.5.24. Twitter

  • Identifier - TWITTER
  • Description - Implements integration with Twitter.
  • Initialization - Check availability of Twitter Consumer Key and Consumer Secret as meta-data. Set up redirect uri as meta-data (Only the logic of the redirect uri should be implemented and running on a dedicated server). More info in https://dev.twitter.com/web/sign-in/implementing
  • Destroy - None
  • Dependencies - Core

3.5.24.1. Trigger New Tweet

Name NEW-TWEET
Description Executes when a new status is tweeted by the user denoted by the USER id parameter.
Logic Periodic check every 10 minutes.
  Type Name Required Description
Parameters CORE.STRING USERID Yes ID of the user whose status is of interest.
CORE.STRING HASHTAG No Filter criteria for hashtag.
CORE.STRING MENTIONED-USERID No Filter criteria for mentioned user id.
CORE.TEXT-FILTER TEXT-FILTER No Filter criteria for status message.
Variables CORE.STRING USERID Tweet sender user-id.
CORE.STRING USER-DISPLAYNAME Tweet sender name.
CORE.STRING TEXT Tweet text.

3.5.24.2. Trigger Reply Received

Name REPLY-RECEIVED
Description Executes when the user is mentioned in a tweet.
Logic Periodic check every 10 minutes.
  Type Name Required Description
Parameters CORE.STRING USERID No ID of the user who tweeted the message.
CORE.TEXT-FILTER TEXT-FILTER No Filter criteria for status message.
Variables CORE.STRING USERID Reply sender user-id.
CORE.STRING USER-DISPLAYNAME Reply sender name.
CORE.STRING TEXT Reply text.

3.5.24.3. Trigger Direct Message Received

Name DIRECT-MESSAGE-RECEIVED
Description Executes when a direct message is received.
Logic Periodic check every 10 minutes.
  Type Name Required Description
Parameters CORE.STRING SENDER No ID of the user who sent the message.
CORE.TEXT-FILTER TEXT-FILTER No Filter criteria for received message.
Variables CORE.STRING USERID Message sender user-id.
CORE.STRING USER-DISPLAYNAME Message sender name.
CORE.STRING TEXT Message text.

3.5.24.4. Trigger Favorited

Name FAVORITED
Description Executes when a tweet gets favorited.
Logic Periodic check every 10 minutes.
  Type Name Required Description
Variables CORE.STRING USERID Tweet sender user-id.
CORE.STRING USER-DISPLAYNAME Tweet sender name.
CORE.STRING TEXT Tweet text.

3.5.24.5. Performer Update Status

Name TWEET
Description Tweets a new status on Twitter user timeline.
  Type Name Required Description
Parameters CORE.STRING TEXT Yes Status message.

3.5.25. WiFi

  • Identifier - WIFI
  • Description - Allows to control WiFi on device.
  • Current Version - 3
  • Initialization - None
  • Destroy - None
  • Dependencies - Core

3.5.25.1. Trigger WiFi Enabled

Name ENABLED
Description Executes when WiFi is enabled.

3.5.25.2. Trigger WiFi Disabled

Name DISABLED
Description Executes when WiFi is disabled.

3.5.25.3. Trigger WiFi Connected

Name CONNECTED
Description Executes when device get connected to a WiFi network.
  Type Name Required Description
Parameters CORE.STRING SSID No WiFi network ID. If null any SSID leads to trigger execution.

3.5.25.4. Condition Checker WiFi Enabled

Name ENABLED
Description Returns true if WiFi is enabled, false otherwise.

3.5.25.5. Condition Checker WiFi Disabled

Name DISABLED
Description Returns true if WiFi is enabled, false otherwise.

3.5.25.6. Condition Checker WiFi Connected

Name CONNECTED
Description Returns true if device is connected to a WiFi network, false otherwise.
  Type Name Required Description
Parameters CORE.STRING SSID No WiFi network ID. If null any SSID is valid for verification.

3.5.25.7. Performer WiFi On

Name ON
Description Activates WiFi.

3.5.25.8. Performer WiFi Off

Name OFF
Description Deactivates WiFi.

3.5.26. Weather

  • Identifier - WEATHER
  • Description - Provides utilities for weather forecast and for monitoring current weather conditions.
  • Initialization - None
  • Destroy - None
  • Dependencies - Core, Location

3.5.26.1. Trigger Cloudy

Name CLOUDY
Description Executes when weather forecast for following day is Cloudy.
Logic Periodic check every 5 hours.
  Type Name Required Description
Parameters LOCATION.POSITION POSITION Yes Position to monitor
Variables CORE.STRING WEATHERSTATUS -

3.5.26.2. Trigger Foggy

Name FOGGY
Description Executes when weather forecast for following day is Foggy.
Logic Periodic check every 5 hours.
  Type Name Required Description
Parameters LOCATION.POSITION POSITION Yes Position to monitor
Variables CORE.STRING WEATHERSTATUS -

3.5.26.3. Trigger Partially Cloudy

Name PARTIALLY-CLOUDY
Description Executes when weather forecast for following day is Partially Cloudy.
Logic Periodic check every 5 hours.
  Type Name Required Description
Parameters LOCATION.POSITION POSITION Yes Position to monitor
Variables CORE.STRING WEATHERSTATUS -

3.5.26.4. Trigger Rainy

Name RAINY
Description Executes when weather forecast for following day is Rainy.
Logic Periodic check every 5 hours.
  Type Name Required Description
Parameters LOCATION.POSITION POSITION Yes Position to monitor
Variables CORE.STRING WEATHERSTATUS -

3.5.26.5. Trigger Snow

Name SNOW
Description Executes when weather forecast for following day is Snow.
Logic Periodic check every 5 hours.
  Type Name Required Description
Parameters LOCATION.POSITION POSITION Yes Position to monitor
Variables CORE.STRING WEATHERSTATUS -

3.5.26.6. Trigger Sunny

Name SUNNY
Description Executes when weather forecast for following day is Sunny.
Logic Periodic check every 5 hours.
  Type Name Required Description
Parameters LOCATION.POSITION POSITION Yes Position to monitor
Variables CORE.STRING WEATHERSTATUS -

3.5.26.7. Trigger Thunderstorms

Name THUNDERSTORMS
Description Executes when weather forecast for following day is Thunderstorms.
Logic Periodic check every 5 hours.
  Type Name Required Description
Parameters LOCATION.POSITION POSITION Yes Position to monitor
Variables CORE.STRING WEATHERSTATUS -