The runIntent action starts an Android intent that facilitates late runtime binding between the code in different applications. Use these intents to accomplish actions on your Android devices.
The most significant use of runIntent is the launching of activities, where it can be thought of as the glue between activities. It is a passive data structure holding an abstract description of an action to be performed. The runIntent action supports both explicit and implicit intents.
Depending on the arguments used, the Workspace ONE Intelligent Hub uses either of the following to start the specified intent.
- android.content.Context.startActivity(Intent intent)
- android.content.Context.sendBroadcast(Intent intent) to run the specified intent.
RunIntent Syntax
The argument syntax changes depending on whether explicit or implicit mode is specified.
mode=explicit, broadcast=[true|false] , action=< action>, package=<package>, class=<class> [, data=<data>][, extraString=<stringname>=<string value>[,...]][, extraInt=<int name>=<int value>[,…]]
mode=implicit, broadcast=[true|false] , action=<action> [,category=<category>][, uri=<uri>] [, data=<data>] [, extraString=<string name>=<string value>[,...]][, extraInt=<int name>=<int value>[,…]]
Argument | Explanation |
mode=[explicit|implicit] | Specifies whether the intent is explicit or implicit. |
broadcast=[true|false] | Specifies whether the intent to be launched using startActivity() or sendBroadcast(). |
action=<action> | Specifies the Android action string for the intent. An example of an Android action string is android.intent.action.MAIN. |
package=<package > | Specifies the Android package name of the java class to be explicitly run. Android package names are generally of the format com.mycompany.myapplication. |
class=<class> | Specifies the java class in the specified package that is to be explicitly launched. |
uri=<uri> | Specifies the URI that is to be passed with the implicitly launched intent. |
category =<category> | Specifies the Android category string that is to be passed with the implicitly launched intent. An example of an Android category string is android.intent.category.DEFAULT |
data=<data> | Specifies the value of the Android data parameter that is to be passed with the explicitly or implicitly launched intent. |
extraBoolean | Specifies the name of an extra boolean parameter that is to be passed with the explicitly or implicitly launched intent. Boolean value specifies the value of the extra boolean. The extraBoolean argument can be used multiple times to specify additional extra boolean name/values. |
extraBooleanArray | Specifies the name of an extra boolean array parameter that is to be passed with the explicitly or implicitly launched intent. Boolean array value specifies the value of the extra boolean array. The extraBooleanArray argument can be used multiple times to specify additional extra boolean array name/values. |
extraFloat | Specifies the name of an extra float parameter that is to be passed with the explicitly or implicitly launched intent. Float value specifies the value of the extraFloat. The extraFloat argument can be used multiple times to specify additional extraFloat name/values. |
extraFloatArray | Specifies the name of an extra float array parameter that is to be passed with the explicitly or implicitly launched intent. Float array value specifies the value of the extraFloatArray. The extraFloatArray argument can be used multiple times to specify additional extra float array name/values. |
extraInt=<int name>=<int value> | Specifies the name of an extra int parameter that is to be passed with the explicitly or implicitly launched intent. int value specifies the value of the extra int. The extraInt argument can be used multiple times to specify additional extra int name/values. |
extraIntArray | Specifies the name of an int array parameter that is to be passed with the explicitly or implicitly launched intent. The int array value specifies the value of the extra int array. The extraIntArray argument can be used multiple times to specify additional extra int array name/values. |
extraIntArrayList | Specifies the name of an int array list parameter that is to be passed with the explicitly or implicitly launched intent. The int array list value specifies the value of the extra int array list. The extraIntArrayList argument can be used multiple times to specify additional extra int array list name/values. |
extraLong | Specifies the name of an extra long parameter that is to be passed with the explicitly or implicitly launched intent. Long value specifies the value of the extra long. The extraLong argument can be used multiple times to specify additional extra long name/values. |
extraLongArray | Specifies the name of an extra long array parameter that is to be passed with the explicitly or implicitly launched intent. Long array value specifies the value of the extra long array. The extraLongArray argument can be used multiple times to specify additional extra long array name/values. |
extraString=<string name>=<string value> | Specifies the name of an extra string parameter that is to be passed with the explicitly or implicitly launched intent. string value specifies the value of the extra string. The extraString argument can be used multiple times to specify additional extra string name/values. |
extraStringArray | Specifies the name of a string array parameter that is to be passed with the explicitly or implicitly launched intent. The string array value specifies the value of the extra string array. The extraStringArray argument can be used multiple times to specify additional extra string array name/values. |
extraStringArrayList | Specifies the name of a string array list parameter that is to be passed with the explicitly or implicitly launched intent. The string array list value specifies the value of the extra string array list. The extraStringArrayList argument can be used multiple times to specify additional extra string array list name/values. |
The following table indicates which arguments are required, optional, or not applicable for the explicit and implicit modes.
mode | Explicit | Implicit |
broadcast | required | required |
action | required | required |
package | required | n/a |
class | required | n/a |
uri | n/a | optional |
category | n/a | optional |
data | optional | optional |
extraString | optional | optional |
extraInt | optional | optional |
Example RunIntent
mode=explicit,broadcast=false,action=android.intent.action.MAIN,package=com.examples.myappl,class=com.examples.myappl.MainActivity
APK File Installation
You can use a runIntent action on an APK file on the device's local storage which installs an application on the device.
RunIntent Syntax for APK File Installation
mode=implicit,broadcast=false,action=com.airwatch.android.provisioning.INSTALL_APKS_FROM_FOLDER,package=com.airwatch.androidagent,extraString=path=/storage/emulated/Download
- You must customize the path in the highlighted portion to account for your specific file and folder structure.
- You can specify an individual APK file in this path on the runIntent which installs an application on the device.
- You can also specify a folder in the path of the runIntent, which runs all APK files found in that folder.
- Applications installed on a device using APK files by way of a runIntent are unmanaged.
- You can also use a path variable in the runIntent to represent the device's internal or external storage.
Path Variable Use in RunIntent for APK Installation
$external$ – Use this variable at the beginning of your path to indicate your source path to be from the external memory card storage, which the device must feature. External storage supports read-only access so any usage must involve a memory card that has been properly formatted and furnished with the correct files in the correct locations. For example: /$external$/sdcard/license.txt
reads the file license.txt from the sdcard folder found on the device's external memory card storage.