Running Skype from 15:00 to 22:00 - Questions

Post your questions and help other users.

Moderator: Martin

Post Reply
atsjiedel
Posts: 2
Joined: 26 Aug 2015 00:06

Running Skype from 15:00 to 22:00 - Questions

Post by atsjiedel » 26 Aug 2015 00:32

Hi!
First of all, I would like to thank you for developing Automagic, it's really a great app!
I'm a beginner (bought it today), so I would like to check you if I'm using it in the right way:


My goal is to run Skype from 15:00 to 22:00, quiting the app in the end of this interval.

First, I created 2 flows:

Flow 1 - Skype launch 15:00:
Trigger = Time = 15:00

Code: Select all

Launch App Skype
Flow 2 - Skype kill 22:00:
Trigger = Time = 22:00

Code: Select all

Kill App Skype
Kill App Process Skype
Set App Notification State Skype OFF
Set App Notification State Skype ON (these 2 lasts are just to hide the app notification)

But then I realized that Flow 1 just runs if it is exactly 15:00. If I restart the phone at 16:00, Skype would not be started.
To manage this problem, I created a third flow that runs at Automagic Startup and tests if Time is in between 15:00 and 22:00. If yes, it run Flow 1:

Flow 3 - Skype launch on restart
Trigger = Automagic Startup

Code: Select all

Condition Time Range between 15:00 and 22:00
If TRUE, Execute Flows: Skype Launch 15:00 (runs the Flow 1).
It is working great, I just do not know if I it is the best way to do that.

My questions are:
Do I need to create separated Flows to Launch and to Kill the app, or it is better to make it in the same Flow (maybe using a range time condition and making a loop until the end time is reached)?
Is that Flow 3 really necessary, or there is another solution more elegant to run a flow when I restart the phone after the start time?
What would you do to make the same thing?

Also, I have a technique question:
After Killing Skype app and process, Skype is still appearing in the Recent Apps List. Is there any Actin in Automagic to remove Skype from that list?


Thank you very much!

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Running Skype from 15:00 to 22:00 - Questions

Post by MURTUMA » 26 Aug 2015 10:26

You can easily merge the two flows which starts the app. It is also possible to merge the app closing flow but it requires a condition to check which trigger caused the flow to run. Condition Expression: trigger == "exact trigger name"

As a basic rule you should avoid loops, especially if the run long time. Depending on the setup, they might eat a lot of battery. In this case I suggest not using a loop.

atsjiedel
Posts: 2
Joined: 26 Aug 2015 00:06

Re: Running Skype from 15:00 to 22:00 - Questions

Post by atsjiedel » 27 Aug 2015 00:04

MURTUMA wrote:You can easily merge the two flows which starts the app. It is also possible to merge the app closing flow but it requires a condition to check which trigger caused the flow to run. Condition Expression: trigger == "exact trigger name"

As a basic rule you should avoid loops, especially if the run long time. Depending on the setup, they might eat a lot of battery. In this case I suggest not using a loop.

Thanks for the tips, MURTUMA, I will follow them!

And what about removing the app from the Recent Apps List? Is that possible with Automagic?

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

Re: Running Skype from 15:00 to 22:00 - Questions

Post by Martin » 27 Aug 2015 19:00

Hi,

To my knowledge it's difficult to remove an app from the recents list. You could start the app with action Start Activity with flag FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS which should remove the app from the recents list automatically when you switch to another app or close the app.
On a rooted device you could also try to use action Execute Root Command: pm disable <package> to kill the app and clear it from the recents list, however I'm not sure if this will work on all versions of Android.

Regards,
Martin

Post Reply