【发布时间】:2013-12-23 11:26:48
【问题描述】:
我找到了以下代码以编程方式建立一个新的 vpn,但我不知道如何使用它来创建我的应用程序
VpnService service = context.getSystemService(VPN_SERVICE);
VpnProfile profile = VpnProfile.create(L2TP_PROFILE);
profile.setName(myServerName);
profile.setServerName(myServerAddress);
profile.setRouteList("192.168.1.0/255.255.255.0,192.168.10.0/255.255.255.0");
service.connect(profile, "myUserName", "myPassword");
service.setNotificationIntent(myIntent);
谁能帮我提供一个示例代码? 甚至有可能实现dis吗?
【问题讨论】:
-
可以分享完成的代码吗?
标签: android vpn android-vpn-service