I'm using the ConnectivityManager
to check the network interfaces type in this manner:
NetworkInfo info = cm.getActiveNetworkInfo();
if(info.getType() == ConnectivityManager.TYPE_WIFI)
return "WIFI";
My problem is that I have to use API 19, while the TYPE_VPN
value was introduced only in API 21.
How can I check if the interface is a VPN?