28

I know this has been asked before, but most of them are 3 to 4 years ago with no definite answers. I would like to know if this is already possible as of 2015.

Community
  • 1
  • 1
jameshwart lopez
  • 2,993
  • 6
  • 35
  • 65

3 Answers3

15

Also there seems to API working for that in Android 22. VpnService and VpnService.Builder. Also you should check out this sample https://android.googlesource.com/platform/development/+/master/samples/ToyVpn/src/com/example/android/toyvpn/

Update: github.com/schwabe/ics-openvpn seems much better option when using openVPN profiles

N0mi
  • 714
  • 7
  • 14
  • 2
    i have gone their but it seems like its not making vpn instead vpn interface.i dont know if my idea of vpn CRUD is really posible or i just need to code it on my own vpn profile and vpn protocol. – jameshwart lopez Aug 18 '15 at 06:04
  • I found your answer accidentally, but this link is so useful for me. thank you. – Morteza Jalambadani Nov 20 '19 at 12:48
6

Yes, there is an API for an android VpnService (https://developer.android.com/reference/android/net/VpnService.html) which was added in API 14.

In addition, some CyanogenMod ROMs have an openvpn binary preinstalled.

rexroni
  • 443
  • 4
  • 15
4

API is one for OpenVPN:

http://code.google.com/p/ics-openvpn/

This provides one potential VPN solution that you are fully in control of (the server is open-source also), but it is not PPTP or IPSec. If you understand the PPTP protocol, it should be possible to use this as a model to implement such a VPN client.

I think u find more information here:

How to programmatically create a new VPN interface with Android 4.0?

Community
  • 1
  • 1
Zhunder
  • 73
  • 2
  • 12