Sub ListNetworkCapabilities
Dim p As Phone
If p.SdkVersion >= 21 Then
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim manager As JavaObject = ctxt.RunMethod("getSystemService", Array("connectivity"))
Dim networks() As Object = manager.RunMethod("getAllNetworks", Null)
For Each network As JavaObject In networks
Dim capabilities As JavaObject = manager.RunMethod("getNetworkCapabilities", Array(network))
Log(capabilities)
Dim IsVPN As Boolean = capabilities.RunMethod("hasTransport", Array(4)) 'TRANSPORT_VPN
Log("IsVPN: " & IsVPN)
Next
End If
End Sub