How to connect to a VPN automatically?

susu

Well-Known Member
Licensed User
Longtime User
On my device with Android 2.3.4, I can connect to a VPN with a few steps. I just wonder how to do that with 1-click app/widget? Anyone had experience please share. Thank you :-D
 

vukanilod

Member
Licensed User
Longtime User
No replies at this subject?

It would be useful and handy if there was a way to connect to predefined vpn connection simply by pressing a button.
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
As far as I know, you cannot connect automatically but you should be able to direct the user to the vpn-settings page from where the connection can be launched (manually):

Something like this (not tested):

B4X:
Dim i As Intent
i.Initialize("android.net.vpn.SETTINGS","")
StartActivity(i)
 
Upvote 0
Top