WiFi control when launching an app

163 views
Skip to first unread message

junkmail...@gmail.com

unread,
May 3, 2013, 1:45:00 AM5/3/13
to tas...@googlegroups.com
Hi all,

I'm trying to create a simple procedure using TASKER that basically turns on Wifi, waits a few seconds, then runs an app that requires network access.
My problem is that I also want to turn off Wifi ONLY when the app closes but unfortunately have so far found no way to do so.

Basically:

TASK: WiFi ON
TASK: WAIT (a few secs)
TASK: LOAD app
TASK: WiFi Off

However, as soon as the app loads and starts running, WiFi is immediately turned off.

Does anyone know of a way to somehow detect that the app is running and prevent the WiFi Off command from executing UNTIL the app closes ?

The reason that I have to manually turn WiFi ON is because some of my apps generate error messages if network access is unavailable when the app starts.

Thanks

Pent

unread,
May 3, 2013, 2:36:15 AM5/3/13
to Tasker
> I'm trying to create a simple procedure using TASKER that basically turns
> on Wifi, waits a few seconds, then runs an app that requires network access.


> My problem is that I also want to turn off Wifi ONLY when the app closes
> but unfortunately have so far found no way to do so.

Create a new profile with an app context. The task should be 'wifi
off'.
Back in the main screen, long-click the task (RHS) and select 'move to
exit'
so that it runs when the app exits.

(and take the 'wifi off' out of your task below)

> TASK: WiFi ON
> TASK: WAIT (a few secs)
> TASK: LOAD app
> TASK: WiFi Off

Pent

junkmail...@gmail.com

unread,
May 3, 2013, 7:06:57 AM5/3/13
to tas...@googlegroups.com
Thanks for your quick reply Pent ... much appreciated.

Your suggestion has solved how to auto turn Wifi OFF when the app has closed (so thats what "Move To Exit" does :-) ) however now I'm left with the dilemma of turning Wifi ON automatically when I launch an app. As a reminder, some of my apps MUST have Wifi running before I open them.

Basically, I want to avoid having to manually turn Wifi on and then click on an app. Rather I'd like to click on the app and have TASKER somehow turn Wifi ON before the app launches. Then when I close the app, have TASKER turn Wifi off (which you've already provided the solution for).

Thanks

TomL

unread,
May 3, 2013, 7:14:34 AM5/3/13
to tas...@googlegroups.com
Do you always launch the app via a Home screen shortcut?  If so, then you can create a Tasker shortcut to put on your homescreen.  That shortcut runs a task with the following action steps:

Turn on wifi
pause (a few seconds maybe?)
Launch your app

Tom

TomL

unread,
May 6, 2013, 4:27:34 AM5/6/13
to tas...@googlegroups.com
Have you tried what I suggested?

junkmail...@gmail.com

unread,
May 6, 2013, 6:41:04 AM5/6/13
to tas...@googlegroups.com
Hi Tom,

Thanks for the suggestion and yes, I did try it out.
I created a simple task that 
1. Turned Wifi ON
2. Waited a couple of secs
3. Loaded the app

I then used that simple task to create a shortcut.

This shortcut worked great in that Wifi started up first, then the app loaded. when I finished with the app and closed it, Wifi turned OFF automatically.
I thought this is great, simple and exactly what I wanted.

Unfortunately though, it only worked perfectly maybe 5 or 6 times and from that point on, Wifi would turn on, the app would load BUT Wifi absolutely refused to turn off automatically when I closed the app. Why ? I have no idea as NOTHING had changed. I even disabled then enabled Tasker .. I even turned off, then turned on the phone ... but nothing would convince Wifi to turn off when the app was closed.
I even made sure no other profiles were active or other tasks were being started in case their was some kind of conflict. So I'm at a loss to understand why your method worked perfectly for a while then stopped.
I also deleted the shortcut and created a new one.

Just can't believe that such a ridiculously simple concept is giving me so much grief !

Steve

TomL

unread,
May 6, 2013, 8:44:14 AM5/6/13
to tas...@googlegroups.com
Go you the profile you created, the one that looks sorta like this:

Profile
context app: YourApp
Enter Task: wifi off

Longclick on the profile to bring up the profile properties.  Is the box for Restore settings enablerd?  Click on that option, and turn it off, so that the profile will *not* try to restore settings for you.  Reboot phone, see if that helps.

Tom

junkmail...@gmail.com

unread,
May 6, 2013, 9:29:20 AM5/6/13
to tas...@googlegroups.com
Thanks for taking the time to try and help me ... much appreciated.

Ok, I understand your suggestion but I'm NOT using a profile as I don't want anything running continuously in the background as would be the case with a profile.

I simply would like an icon (shortcut) on the home screen that I can press anytime to activate it.
When pressed, I need Wifi to be switched ON (no need to scan for Wifi Near, etc) ... just turn Wifi ON.
Then wait a couple of secs.
Then the app loads.
When I close the app, then Wifi OFF.

I've been using 2 simple tasks to do nothing more than (1) turn on wifi and (2) load the app.
I've then used these 2 tasks and created a shortcut on the home screen.

As I mentioned earlier, this worked perfectly for a while ... I could press the shortcut and Wifi would turn on, the app would load ... and when I closed the app, Wifi was turned off immediately. 
But after a while and for no apparent reason, the Wifi turning off action no longer kicked in and Wifi stayed ON until I manually turned Wifi OFF instead.

If it's not to much trouble and if you have the time, I would very much appreciate it if you could please try creating such a task (or profile) yourself and see if you can get it to work.

Wifi ON
Load app ... (use app for as long as you like) ... close app
Wifi OFF


Thanks,
Steve

TomL

unread,
May 6, 2013, 9:49:46 AM5/6/13
to tas...@googlegroups.com
Steve, the Tasker action "Load App: YourApp" completes as soon as it launches YourApp, and then it runs the next step.  

Throw in a couple of Action > Alert > Notify > "something happened %UPS" steps, and you''ll see what I mean:

Create a task with these steps:

Notify "turn on wifi starting %UPS"
Wifi ON
Notify "turning on wifi done %UPS"
Notify "loading app starting %UPS"
Load app: YourApp
Notify "loading app done %UPS"
Notify "turn off wifi starting %UPS"
Wifi OFF
Notify "turning off  wifi done %UPS"


To achieve what you want, you should have a profile as suggested by Pent, me, and easiuser on your second thread.

Tom

TomL

unread,
May 6, 2013, 9:58:51 AM5/6/13
to tas...@googlegroups.com
And I just tried the steps listed above, and here's what happens:

Create a shortcut to Task "OnAppOff" on Home screen.
Click on shortcut.
I see the message "turn on wifi starting ..."
I see my wifi radio power up.
I see the message "turning on wifi done ..."
I see the message "loading app starting ..."
My app (the stock browser) starts up.
I see the message "loading app done ..."
I leave the browser app running, and I see this message: "turn off wifi starting ..."
I see the wifi radio power off.
I see the message "turning off  wifi done ..."
And the browser app is still running.  I close the browser app.

So, your task won't do what you want.  I need to use a profile that watches for your app to be running.  And that profile's *Exit Task* should be to turn wifi off.
Reply all
Reply to author
Forward
0 new messages