I need to implement VPN IPsec on android programmatically i.e. connecting, disconnecting on the click of button inside my own app, without asking user explicitly. 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 of the threads already discussing the same:
- https://code.google.com/p/android/issues/detail?id=8915
- How to configure VPN programmatically?
- programmatically setting up a vpn
- How to programmatically create a new VPN interface with Android 4.0?
- Android: Sample Code to use own VPN connection in Android 4.0 using VPNService API
But didn't find any satisfactory answer. What I inferred is, either I have to write whole implementation by myself. Or something about hidden API in Android.