Set up VPN programmatically on Android

I need to implement IPsec VPN on Android programmatically, i.e. connect, disconnect at the click of a button inside my own application, without explicit user request. I came across VpnService ( https://developer.android.com/reference/android/net/VpnService.html ) and its implementation, i.e. toyvpn ( https://android.googlesource.com/platform/development/+/master/samples/ToyVpn/src/com/example/android/toyvpn/ )

Some topics are already discussing the same thing:

But did not find a satisfactory answer. What I understood is that I have to write the whole implementation myself. Or something about a hidden API in Android.

+7
source share

All Articles