我正在尝试以编程方式建立并连接到我们自己的VPN(不是默认的VPN提供商,即PPTP、L2TP等,它们存在于Android设置->无线和网络中)。
我想知道截至 2017 年这是否已经可能。
有我用的参考
使用数据报通道时,我收到 PortUnreachableException。这就是我的代码的样子:
@Override
public void run() {
try {
Log.i(getTag(), "Starting");
// If anything needs to be obtained using the network, get it now.
// This greatly reduces the complexity of seamless handover, which
// tries to recreate the tunnel without shutting down everything.
// In this demo, all we need to know is the server address.
final SocketAddress serverAddress = new InetSocketAddress(mServerName, mServerPort);
// We try to create the tunnel several times. …Run Code Online (Sandbox Code Playgroud)