I\'m trying to register receiver, that will check VPN status. I have tried this: Get VPN Connection status on Android but looks like it no longer works on ICS. I have checked an
for (Enumeration en =
NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {
NetworkInterface intf = en.nextElement();
if (intf.getName().contains("tun0") || intf.getName().contains("ppp0")) {
vpnInterface = intf;
break;
}
}
For the VPNNetwork Interface
for (Enumeration en =
vpnInterface.getInetAddresses(); en.hasMoreElements(); ) {
InetAddress address = en.nextElement();
if (!address.isLoopbackAddress()) {
String ip = address.getHostAddress();
break;
}
}
and the InetAddress
Thats everything I know by the moment now
To check if it's up etc. maybe
if (vpnInterface.isUp())
I do have implemented a code which calls itself after a serveral time and send a message to the ApplicationHandlers