Process Purpose
The Start Android Activity process is used to initiate services/activities 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 is ONLY applicable for Android target devices.
In order to have specific information on Android Intents and standard examples, see the Android developer support page.
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 |
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 |
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 |
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 |
Type |
Select the type of the extra parameter from the drop-down. |
Value |
Enter a value for the extra parameter or click |
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 Standard Values into Variables |
|
Return Code |
Click |
Return Data |
Click |
Name column |
Enter the name of the parameter you want to receive and store or click |
Type column |
Select the type of the parameter to be received from the available options in the drop-down. |
Value column |
Click |
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 |
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
This example describes how to call the "Google Maps" service to show the map (providing latitude and longitude).
1. Prepare the data to send to the "Google Maps" service by using the Variable Combine process:
The "Google Maps" service needs to receive a specific string that includes the URI intent definition (in this case the "geo" URI) and the coordinates to be displayed. In the example, from Brussels (Longitude 50.8503 (in var L_Lng) and Latitude 4353517 (in var L_Lat)).
2. Define the following values in the "General" tab:
3. Screen sequence example when selecting a location:
|
This example describes how to call "Sygic" application to show the destination map and driving route (providing a specific address).
1. Prepare the data to send to the "Sygic" application by using the Variable Combine process:
The "Sygic" application needs to receive a specific string that includes the URI intent definition (in this case the "com.sygic.aura://address" URI) and the destination address. In the example, São Bento Train Station address ("Portugal" (in var L_Country), "Porto" (in var L_City), "" (in var L_Code), "Praça Almeida Garret" (in var L_Street) and "" (in var L_Number)). <Mode> (in var P_Mode) can have values "show" or "drive" and defines if Sygic shows the map for the given address or shows the driving route to the given address. This information must be passed to "Sygic" using the "|" (\7C) as a field separator.
2. Define the following values in the "General" tab:
3. Screen sequence example when selecting a destination:
|
This example describes how to call the device's "Phone" app to make a call (providing the phone number).
1. Define the following values in the "General" tab:
The defined Action is "CALL" that needs to receive the URI intent definition (in this case the "tel:" URI) and the phone number (in var &A9). In the example, "987654230".
2. Screen sequence example when selecting a contact from the list:
|
This example describes how to call the device's "Email" app to send an email (providing the email address respectively).
1. Define the following values in the "General" tab:
The defined Action is "SENDTO" that needs to receive the URI intent definition (in this case the "mailto:" URI) and the email address (in var &B0). In the example, "rose.peterson@abc.com".
2. Alternatively you can define the following values in the "Send" tab:
The defined "mailto:" Android intent allows you to send additional parameters such as the email subject (using the android.intent.extra.SUBJECT parameter) and body (using the android.intent.extra.TEXT parameter). As soon as the email window is opened, the corresponding subject and body are already mapped with the values transmitted to the intent.
3. Screen sequence example when selecting a contact from the list:
|
Use the right click in MCL-Designer's input boxes to access certain features regarding the input box's option as well as general actions such as "Copy"; "Paste"; "Search".
Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with the "Search..."and "Variable Select" options.
If you right-click another input box, it will provide other possibilities.