Launch Apps in background

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
julian.colombo
Posts: 8
Joined: 21 Jan 2017 10:18

Launch Apps in background

Post by julian.colombo » 03 Feb 2017 13:40

Is it possible to launch apps exactly like when launched via BOOT_COMPLETED (after rebooting, in the background)?

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

Re: Launch Apps in background

Post by Martin » 05 Feb 2017 21:00

That's difficult. The operating system probably prevents to send the BOOT_COMPLETED broadcast from Automagic so you would have to check if the app has an other intent action defined in an intent filter of the broadcast receiver that can be sent by Automagic.

Regards,
Martin

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Launch Apps in background

Post by ariloc » 01 Mar 2017 21:14

I don't know if this is the right post but, how can I launch an app in the background?
I need it because I have an app that I want to be always executing in the background. But it is killed when I have no RAM and it's pretty annoying to launch it every time this happens.
I have tried to make this action automatically with Automagic but it interrupts what I'm doing in that moment.

Therefore, I want Automagic to launch it on the background every time it closes so I do not need to stop what I'm doing to restart the application. Is that possible?

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

Re: Launch Apps in background

Post by Martin » 02 Mar 2017 21:33

Maybe the app provides a way to start the required background service. You have to check the documentation of the other app or ask the developer of the other app to see if this is possible. You will likely have to use action Send Broadcast or Start Service to start the other app in the background. You could also check if the other app is listed in action Plugin or you could use an app like ManifestViewer to see if you can find a broadcast receiver or an exported service that can be used to start the app. The latter method is difficult if you don't happen to be a developer.

What app do you want to start?

Regards,
Martin

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Launch Apps in background

Post by ariloc » 02 Mar 2017 22:59

mSwitch aka KeyCut. It is an app to control a Mi Key I have connected to my device. Therefore, if the app isn't running, I can't use that Mi Key.

PD: The Mi Key is an extra button that plugs into the headphone jack and it can be controlled via software.

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

Re: Launch Apps in background

Post by Martin » 05 Mar 2017 13:34

It sounds like this type of app should start on its own when the device is booted and should keep running in the background. I recommend to contact the developer of mSwitch if it does not autostart or if it's killed by Android (check for settings with names like 'autostart on device boot' or 'start on boot' etc. Also ensure that the notification of the app is available in the notification area to ensure that Android does not kill the app).

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Launch Apps in background

Post by ariloc » 07 Mar 2017 11:27

It auto boots when turning on the phone. There's a notification on the status bar to prevent the app to be killed. But by phone's RAM is too low so it can't handle it and the app is killed. Then, I need to launch it again manually.

Looks like by somewhat reason its priority isn't that higher to keep running all the time. Definitely a problem that the developer didn't notice. Contacting the developer won't be the solution: the app hasn't been updated since 2015.

I concluded that the solution is to use another app like Klick (much better performance, less clicks or functions), get a better phone, or root mine.

Anyway, thank you a lot for your help!

Locked