Page 1 of 1

Detect whether App is active/paused

Posted: 10 Feb 2020 08:24
by MartiSL
Hi,
not yet an automagic user but in search of a solution for a problem.
I've an app to control a remote media player (two options available, html5 running in Chrome as well as android app)
Think of it as a media player only that music is not actually played in the device. Music is stored and played in a different device, but you have cover art, volume control, pause/play, progress bar, etc
So far screensaver will trigger after a time without user interaction. Problem is I want to trigger screensaver when music is paused, not when music is playing (since I want to see song title and cover on the screen). Since I'll have a playlist, there will be no user interaction with the app. That means I need to detect activity based on changes in progress bar, counter for time played/remaining, etc

Is it possible to achieve this with automagic?
Thanks in advance :)

Re: Detect whether App is active/paused

Posted: 10 Feb 2020 19:08
by Micky Micky
Hello and welcome.

The answer is POSSIBLY with this trigger:

https://automagic4android.com/trigger_m ... ed_en.html

My advice to you would be to download the trial version of Automagic and test it. It's not available from Google Play Store. Here's the link:

https://automagic4android.com/evaluation_en.html

Hope this helps and maybe other forum members can help too.

Good luck

Re: Detect whether App is active/paused

Posted: 11 Feb 2020 19:07
by Desmanto
When you mean no interaction >> screensaver, this mean the phone is actually locked at that time right? If yes, then use the Media session changed as pointed by Micky above. Then use action Lock device and turn on screen again. This should trigger the screensaver. But you have to try it out first, since it might not work in all devices.

Re: Detect whether App is active/paused

Posted: 12 Feb 2020 13:12
by MartiSL
Micky Micky wrote:
10 Feb 2020 19:08
Hello and welcome.

The answer is POSSIBLY with this trigger:

https://automagic4android.com/trigger_m ... ed_en.html
I'll test but think most probably won't work since the media is not played in the device.
Thanks!

Re: Detect whether App is active/paused

Posted: 12 Feb 2020 13:16
by MartiSL
Desmanto wrote:
11 Feb 2020 19:07
When you mean no interaction >> screensaver, this mean the phone is actually locked at that time right? If yes, then use the Media session changed as pointed by Micky above. Then use action Lock device and turn on screen again. This should trigger the screensaver. But you have to try it out first, since it might not work in all devices.
Hi Desmanto,
nope, the tablet isn't locked and the goal is that it never locks.

Re: Detect whether App is active/paused

Posted: 12 Feb 2020 19:13
by Desmanto
MartiSL wrote:
12 Feb 2020 13:16
Hi Desmanto,
nope, the tablet isn't locked and the goal is that it never locks.
We need Screenshot to see the case better. If the screen is not locked, then it is not screen saver. It is just like another view of the app. It seems what you need is the setting of the app itself to show the info much faster. I don't know how long the "screensaver" will trigger, but it seems this is related to the app setting. Don't know if other app can interfere with it.

Since everything is always screen on, I think trigger UI Event or action Control UI can do it in the sense if there is a button that can be used to trigger the screen saver immediately. Accessibility services for Automagic should be enabled first to do this.