I'm trying to write an application that could connect to my VPN server with pptp protocol
, as i was researching I found out that with android.net.vpnservice
I could connect, but as I read some of documentation it was not clear how to connect to VPN (there were no API to set username or password, and also no API to set my VPN type(l2tp,pptp
); I also tested example application Google provided(toyvpn) and there were none of what I mentioned earlier there too.
Here is some code I found :
// Create a new interface using the builder and save the parameters.
mInterface = builder.setSession(mServerAddress)
.setConfigureIntent(mConfigureIntent)
.establish();
mParameters = parameters;