Show Content such as an image or a video with Android Automate

334 views
Skip to first unread message

enzo.p...@gmail.com

unread,
Feb 20, 2017, 10:48:36 AM2/20/17
to Automate
Hi All,

I would like to display an image or a video in case of a given event (for example when charging). 
I am trying to achieve this with the block "view content", but no luck. Does anybody have a working example?


Henrik "The Developer" Lindqvist

unread,
Feb 20, 2017, 2:17:13 PM2/20/17
to Automate, enzo.p...@gmail.com
The Content view block should work if you have an image viewer and video player app installed.
Try hard-coding the content MIME type, i.e: image/jpeg or video/mp4

enzo.p...@gmail.com

unread,
Feb 27, 2017, 3:11:56 PM2/27/17
to Automate, enzo.p...@gmail.com
Thank you for your answer. The issue concerned the syntax I used to specify the URI of the video. By typing manually the path between double quotes, it works (whereas before I was using the URI automatically loaded by the application).

The video now starts correctly, however, the block doesn't wait and it there is a "start activity" in a following block, the video is automatically stopped. I used the delay block to avoid this issue, but the delay block causes other problems. Is it possible by any chance to view all the video without using the delay block?

Henrik "The Developer" Lindqvist

unread,
Feb 27, 2017, 3:21:54 PM2/27/17
to Automate, enzo.p...@gmail.com
Yes, Content view block or App start block can not wait until the video ends, that will be difficult to achieve.
Try using the App decision block instead with the URI in the Extras field: { "android.intent.extra.STREAM" as uri: "file//"++videofile }
or, use the Media tag read to get the Media duration, the an Delay block to pause the flow for that duration.

Enzo Paradiso

unread,
Feb 27, 2017, 3:36:13 PM2/27/17
to Henrik The Developer Lindqvist, Automate
Thank you again for your answer.

To be sure I understand, supposing for example that the path of the video file is "/storage/videos/intro.mp4", what shall I write in the Extra field? Data URI needs to be empty?


--
You received this message because you are subscribed to a topic in the Google Groups "Automate" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automate-user/k7U-Bbnwj_c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to automate-user+unsubscribe@googlegroups.com.
To post to this group, send email to automa...@googlegroups.com.
Visit this group at https://groups.google.com/group/automate-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/05870ec1-4e46-4f83-9b13-758015ff59fd%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Henrik "The Developer" Lindqvist

unread,
Feb 27, 2017, 4:38:48 PM2/27/17
to Automate, henrik.l...@gmail.com, enzo.p...@gmail.com
Extras:
{ "android.intent.extra.STREAM" as Uri: "file//" ++ "/storage/videos/intro.mp4" }


On Monday, February 27, 2017 at 9:36:13 PM UTC+1, Enzo Paradiso wrote:
Thank you again for your answer.

To be sure I understand, supposing for example that the path of the video file is "/storage/videos/intro.mp4", what shall I write in the Extra field? Data URI needs to be empty?

enzo.p...@gmail.com

unread,
Mar 5, 2017, 7:29:44 AM3/5/17
to Automate, henrik.l...@gmail.com, enzo.p...@gmail.com
Hi there, 

Is it possible to display a video with Automate and, in parallel, to start applications without interfering with the video? In other terms, I would like the device to play a boot animation of a few seconds, and once the animation finished, the apps are loaded and already running. 

Thank you.

Henrik "The Developer" Lindqvist

unread,
Mar 5, 2017, 2:45:11 PM3/5/17
to Automate, henrik.l...@gmail.com, enzo.p...@gmail.com
No. Android only allows a single app to in the foreground.
Except on Android 7 with the split screen feature, but that can only be controlled by user interactions.

Enzo Paradiso

unread,
Mar 5, 2017, 2:54:47 PM3/5/17
to Henrik The Developer Lindqvist, Automate
Okay, thanks anyway!
Reply all
Reply to author
Forward
0 new messages