How to start VPN connection when I use specific apps

656 views
Skip to first unread message

AutomatingNewbie

unread,
Oct 26, 2016, 11:17:40 AM10/26/16
to Tasker
Hi,

I'm totally new to tasker and (unfortunately) only have a couple of days before I leave on a trip during which I'd like to have a few things automated. I'm struggling to find the best way to setup the following:

Whenever I start a few specific applications (for example, the Synology DS Photo or DS File), I'd like the phone to check if I am connected to my home network (could be done via checking the SSID of connected wifi?) and if I am not, check if I am already on VPN (could be done by pinging a specific address within my home network - 192.168.7.100 for example) and if I am not connected, then start the VPN connection (OpenVPN for Android). If the VPN connection has been started by tasker, it could kill it (ideally cleanly, if that's possible?) when I leave the DS Photo app.

First, I am not sure if I need to create a home widget (?) that will first check the network connectivity and start the VPN if required and THEN start my app (DS Photo for example) once the VPN connection has successfully been established..? Or should I just have tasker monitor when I launch the following 5 apps and apply those rules?

Any help and pointers would be appreciated. I've watched 5 tutorial videos already but I don't feel I'm progressing in the right direction since more tuto are doing more basic automation.

Thanks in advance.

Rich D

unread,
Oct 27, 2016, 5:09:50 AM10/27/16
to Tasker Google Groups Post

> First, I am not sure if I need to create a home widget (?) that will first check the network connectivity and start the VPN if required and THEN start my app (DS Photo for example) once the VPN connection has successfully been established..? Or should I just have tasker monitor when I launch the following 5 apps and apply those rules?
>

Depends on what you want. If you want to make sure you are connected 'Before' the app starts then you would want to use a 'Task short cut'  from your home screen to test connection and then start app. If it does not matter if the connection is made after the app starts then monitoring for those specific apps would be better.

Use a task short cut if you just need to start a task from home screen. you would use a widget if you want to interact with the icon on the home page (IE change the icon when app is running)

To Kill A app you will need root. I am not sure How clean it is.  You can background the app by using the action / app / go home.

Reply all
Reply to author
Forward
0 new messages