DIY-Actions/Triggers: Start Activity, General Broadcast, ...

Post your questions and help other users.

Moderator: Martin

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

DIY-Actions/Triggers: Start Activity, General Broadcast, ...

Post by Martin » 26 Apr 2013 18:33

Hi,

Many actions can be added by yourself using the actions Start Activity, Send Broadcast and even triggers using trigger General Broadcast or UI Event.
The goal of this post is to collect actions that are either too device specific to include in Automagic, depend on third party apps not installed on most devices or I didn't have the time to include in Automagic yet.

Feel free to add more actions and variations of already listed actions by replying to this post. Optionally also include a link to a published flow that shows how the feature can be used.
Please also add a link to the third party app when the action requires one (link to Google Play when available).

Thanks!
Martin


:!: Not all actions work on all devices/Android versions


Action Start Activity

Start a skype audio call (requires Skype: Google Play)
Action: android.intent.action.VIEW
Data URI: skype:echo123?call (replace echo123 with the Skype contact name)


Start a skype video call (requires Skype: Google Play)
Action: android.intent.action.VIEW
Data URI: skype:echo123?call&video=true (replace echo123 with the Skype contact name)


Start a skype chat (requires Skype: Google Play)
Action: android.intent.action.VIEW
Data URI: skype:echo123?chat (replace echo123 with the Skype contact name)


Open the SMS app with the defined recipient and message without sending the SMS.
Action: android.intent.action.VIEW
Data URI: sms:1234567 (replace 1234567 with the actual phone number)
Extras: putString("sms_body", "SMS text")


Compose an MMS with image, recipient and message without sending the MMS.
Action: android.intent.action.SEND
Explicit Component: checked
Package Name: com.android.mms
Extras:
putString("address", "1234567");
putString("sms_body", "MMS text");
putUri("android.intent.extra.STREAM", "file:///mnt/sdcard/test.png");



Start an app to compose a mail with some predefined fields.
Action: android.intent.action.SEND
Data MIME Type: text/plain
Extras:
putString("android.intent.extra.SUBJECT", "Subject text");
putString("android.intent.extra.TEXT", "Mail body");
putStringArray("android.intent.extra.EMAIL", newList("recipient1", "recipient2"));
putStringArray("android.intent.extra.CC", newList("ccrecipient1", "ccrecipient2"));
putStringArray("android.intent.extra.BCC", newList("bccrecipient1", "bccrecipient2"));



Execute a web search.
Action: android.intent.action.WEB_SEARCH
Extras: putString("query", "what's the time?");


Take a picture using the camera app and store in the specified file (manual operation required).
Action: android.media.action.IMAGE_CAPTURE
or
Action: android.media.action.IMAGE_CAPTURE_SECURE (Android 4.2+ when screen is locked)
Extras: putUri("output", "file://mnt/sdcard/test.jpg");




Action Send Broadcast

Ask the operating system to close system dialogs (like power off menu).
Action: android.intent.action.CLOSE_SYSTEM_DIALOGS




Trigger General Broadcast

The current time has changed. Sent every minute by the system when the system is awake.
Action: android.intent.action.TIME_TICK


The date of the device has changed.
Action: android.intent.action.DATE_CHANGED


The device language has changed.
Action: android.intent.action.LOCALE_CHANGED


WiFi signal strength changed (usually only reported by the system when the display is turned on).
Action: android.net.wifi.RSSI_CHANGED
Access Intent Extras: value=getInt("newRssi", 0);


Ringer mode changed.
Action: android.media.RINGER_MODE_CHANGED
Access Intent Extras: ringer_mode=getInt("android.media.EXTRA_RINGER_MODE", 0); (0=Silent, 1=Vibrate, 2=Normal)


Location providers (GPS/network) enabled/disabled. (use condition Location Provider Enabled: xyz to check if GPS or network is enabled).
Action: android.location.PROVIDERS_CHANGED


Wallpaper has changed.
Action: android.intent.action.WALLPAPER_CHANGED



Trigger UI Event

A Google Now voice search was executed. The search term can be accessed in the flow in variable text.
Event Type: Text selection changed
Package Name: com.google.android.googlequicksearchbox
Text: leave empty

fly
Posts: 10
Joined: 01 May 2013 15:19

Re: DIY-Actions/Triggers: Start Activity, General Broadcast

Post by fly » 07 Jun 2013 13:42

How do we find these things on our own? I'd love to find a way to make MediaDog sync with my server when I connect to wifi at home...

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: DIY-Actions/Triggers: Start Activity, General Broadcast

Post by Martin » 09 Jun 2013 14:02

Difficult to answer since it depends on a case by case basis.

The official Android intents are documented in the developer documentation.
A good starting point is the documentation of the class Intent itself:
http://developer.android.com/reference/ ... ntent.html

some bluetooth intents are documented here:
http://developer.android.com/reference/ ... apter.html scroll down to the list of actions.

some USB device intents:
http://developer.android.com/reference/ ... nager.html
Some of the intents require special permissions not available in Automagic so you will not be able to receive every listed intent.

OpenIntents has a registry of intents used by third-party apps:
http://www.openintents.org/en/intentstable

You can also directly contact the developers of a third-party app when they don't publish the intents on their website or directly check the source code when the app is available on a public repository like GitHub.

syndromtr
Posts: 31
Joined: 01 Feb 2013 13:28

Re: DIY-Actions/Triggers: Start Activity, General Broadcast

Post by syndromtr » 17 Nov 2013 20:14

(There may be a simpler method for this)
Pull an application to foreground: (should be running in background to work properly)

START ACTIVITY:
Action : android.intent.action.MAIN
Category list : android.intent.category.LAUNCHER
Explicit Component is checked
Package name & Class name : your application you want to pull to foreground

Install an APK file:

START ACTIVITY:
Action : android.intent.action.VIEW
Data URI: file:///mnt/sdcard/Download/sample.apk
Data MIME type: application/vnd.android.package-archive

skahlhoefer
Posts: 12
Joined: 02 Dec 2013 22:35

Re: DIY-Actions/Triggers: Start Activity, General Broadcast

Post by skahlhoefer » 08 Dec 2013 22:04

Hi Martin,

what about a documentation of Automagic intents?
Thinking that Liama manages cell based locations better than Automagic I would like to combine these apps and trigger Automagic from Liama calling Automagic to start a specific Flow/Shortcut.

Cheers
Stefan

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: DIY-Actions/Triggers: Start Activity, General Broadcast

Post by Martin » 09 Dec 2013 17:40

Hi Stefan,

You can execute a flow in Automagic by adding a trigger Shortcut to a flow in Automagic and launch/execute the shortcut using Llama (Run App Shortcut).
You could also define a trigger General Broadcast using your own action name and send this broadcast intent using Llama (Android intent, Intent send mode=Broadcast). The broadcast method is more flexible and also allows to pass additional data to Automagic by using the extras fields.

Regards,
Martin

Mbuso
Posts: 2
Joined: 31 Oct 2014 08:26

Re: DIY-Actions/Triggers: Start Activity, General Broadcast,

Post by Mbuso » 01 Nov 2014 04:10

Hi

I have exactly the same issue. I need to start some flows automagic from llama as I have found the two apps have different strengths for me. For me too llama does a good job with locations using cell towers while automagic is excellent in everything else. I have done stuff with automagic that was almost impossible to do with other apps. What I need to do is start a flow triggered by llama when I enter or leave a certain area. I am not very good with intents but I am willing to use them if someone can give specific instructions. I do not know how I can create a flow-shortcut which I understand I can run from llama. Alternatively sending a "text key word" directly to automagic to be evaluated in a flow would be magic for me. I have seen some general comments on intents, general broadcast etc but its not specific enough for me and what I need to do. Any help will be appreciated.

Thanks
Mbuso

Mbuso
Posts: 2
Joined: 31 Oct 2014 08:26

Re: DIY-Actions/Triggers: Start Activity, General Broadcast,

Post by Mbuso » 01 Nov 2014 10:24

Sorry got it by creating a widget and starting the flow from Llama. Still new to automagic. The two of them put together are amazing.

psydex
Posts: 11
Joined: 19 Jun 2015 07:46

Re: DIY-Actions/Triggers: Start Activity, General Broadcast,

Post by psydex » 19 Jun 2015 14:26

Is it possible to receive applications action "Share" by broadcast trigger?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: DIY-Actions/Triggers: Start Activity, General Broadcast,

Post by Martin » 22 Jun 2015 19:47

Unfortunately that's currently not possible. Apps don't send this intent as a broadcast.
The plugin AutoShare might be capable to intercept such intents (untested by me).

Regards,
Martin

Post Reply