Working with Start Android Activity Process

Navigation:  How to Work with Processes > Working with the Other Processes Group >

Working with Start Android Activity Process

Previous pageReturn to chapter overviewNext page

 

Process Purpose

 

The "Start Android Activity" process is used to initiate activities (meaning, intents with a GUI component) outside the MCL application environment. For instance, perform a Google search, create an event in the Android OS Calendar, sending an SMS, etc.

This process is based on Android Intents so, it ONLY applies to Android target devices.

 

The "Start Android Activity" process ONLY initiates/launches external applications that contain a graphical user interface.

 

 

Be aware that this process is based on Android intents which are NOT developed/managed by MCL.

These intents can be changed, at any moment, without MCL knowledge, so we recommend you check the Android developer support page for specific information on Android intents and standard examples.

 

When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the "Start Android Activity" process. In this case, the properties window includes several tabs - "General", "Send", "Receive" and "Error".

If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.

 

"General" tab

 

.

 

Fill in the following options:

 

Android Activity to Start

Action

Define the general action/intent to be performed. You can use known actions such as "ACTION_VIEW"; "ACTION_EDIT", etc. OR  enter an explicit action string (ex: android.bluetooth.devicepicker.action.LAUNCH).

Enter an action directly OR  select an available action from the drop-down OR  click and select a variable with that value.

URI

Define the data to operate on (ex: a record/entry on a contacts database). Enter the intended target data in URI format OR  click and select a variable with that value.

MIME type

If required, specify the MIME type of the intended target data. If this option is left empty, the type is inferred by the data itself.

Component

If required, explicitly define the component that will handle the action/intent. Select one from the drop-down OR click and select a variable with that value.

 

Proceed to the "Send" tab.

 

"Send" tab

 

 

Fill in the following options:

 

Extra Parameters to Send

Name

Enter the name of the intended extra parameter OR  click to select the variable with the intended value.

Type

Select the type of the extra parameter from the drop-down.

Array

Check the corresponding check box, if you want to send the parameter value(s) as an array.

Value

Enter a value for the extra parameter OR  click to select the variable with the intended value.

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

Click the "Receive" tab to continue.

 

"Receive" tab

 

 

If required, check the "Store Result into Variables" option to receive and store the expected data/parameters related to the defined action/intent.

You must know beforehand, the name/type of the parameter(s) that will be returned.

Once the option is checked the following options/table are activated:

 

Store Result into Variables

Return Code

Click to create/select the variable that will receive the return code of the defined action. See To Select/Create a Variable.

Return Data

Click to create/select the variable that will receive the return data of the defined action.

Name column

Enter the name of the parameter you want to receive and store OR  click to select the variable with the intended value.

Type column

Select the type of the parameter to be received from the available options in the drop-down.

Array column

Check the corresponding check box, if you want to receive the parameter value(s) as an array.

Value column

Click to select the variable that will receive the designated parameter's value.

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

Click the "Error" tab to continue.

 

"Error" tab

 

 

Fill in the available option:

 

If Error

Go to

Select a target location from the drop-down OR  the list, if an error occurs in the execution of the defined action/intent. See Detail of a window below.

 

When defining a screen as a target destination (ex: via a “Go to” process), you CANNOT use variables to specify the name of that target screen. You must select the intended screen from the available drop-down/list.

 

Detail of a window:

 

 

"S:Menu" is a screen included in the same program as the process.

"R:Routine_1" is a routine included in the same program as the process.

 

If required, use the icon to attach any relevant notes to this process. Click it and enter your notes in the resulting text box. These notes will be displayed in the corresponding "Actions" tab or "Process" window (in the "Notes" field) and in the "Developer Report".icons on the top of the properties window.

 

After filling in the required options, click to conclude, or to abort the operation.

The added process is displayed in the corresponding "Actions" tab or "Process" window.

 

 

"Start Android Activity" Examples

 

The following examples were created for Android 8 or 9 target devices.

 

Since Android intents are NOT managed by MCL and subject to changes, we recommend you visit the Android developer page to check if the intents used in the provided examples are still valid.

 

 

Example 1 - To display a specific location in "Google Maps"

 

Example 2 - To call a GPS driving software

 

Example 3 - To make a call with the phone app

 

Example 4 - To send an email with the email app

 

 

If you want to use a label as a target destination, you can use the "Auto-Label" mechanism. This alternative to the "Set Label" process allows you to create a label in the properties window of a process - specifically, in the fields used to define target destinations (ex: the "If Error..." type fields). See To Automatically Create a Label.

 

Use the right-click in MCL-Designer's input boxes to access some related options as well as the general "Cut", "Copy"; "Paste"; "Search" actions (active/inactive according to the current context).

Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with general editing/search actions and other more specific options such as "Variable Select" (see "Variable Select"); "Variable Insert" (see "Variable Insert"); "Insert Special Character" (see To Insert Special Characters into a Control's Text Input Field) and "Localization Select" (see Localization List).

If you right-click another input box, it may provide other possibilities.