The new “Launch Intent Action” released on AutomateIt latest update raised a few questions that are basically saying “What is it, and how do I use it?”.
To better understand this new action, we first need to explain what an Intent is on Android. In a nutshell, an intent is a way of communication between apps so that one app can launch another app screen or notify it to do a specific action.
Each intent has a name (called “Action”) and type (“Activity” – show screen, “Broadcast” – send a message).
To demonstrate the way this action can be used we will launch a web search on the device.
Using the android.intent.action.WEB_SEARCH action (of type “Activity”) will launch the default web search on the device (Such as Google Now).
The Advanced link on the action properties allows further customization of the Intent and is usually optional. For web search action, we can specify a query to be used for search.
The most common way to customize an Intent is to add Extras. we do that by tapping the Add Extra button:
After adding a new Extra, you can set its name, type and value:
Launching that action will start the device’ default web search and search for “AutomateIt”:
Additional properties that can be used to customize an Intent are (From the Android developer documentation):
- Category – Gives additional information about the action to execute. For example,
CATEGORY_LAUNCHERmeans it should appear in the Launcher as a top-level application, while
CATEGORY_ALTERNATIVEmeans it should be included in a list of alternative actions the user can perform on a piece of data.
- Data – The data to operate on, such as a person record in the contacts database, expressed as a
- Package Name – Specifies an explicit name of an app main package. You can take it from the download link of the app. For instance, the Package Name of AutomateIt free version is AutomateIt.mainPackage taken from the download link https://play.google.com/store/apps/details?id=AutomateIt.mainPackage
- MIME Type – Specifies an explicit type of the intent data
- Flags – Set special flags controlling how this intent is handled. Most values here depend on the type of component being executed by the Intent, specifically the FLAG_ACTIVITY_* flags are all for use with Intents of type “Activity”and the FLAG_RECEIVER_* flags are all for use Intents of type “Broadcast”
To get you started with some Intents you can try, take a look at the following lists of Intents:
Feel free to share more links to lists of Intents or rules from the Rules Market in the comments of this post.