[Free] Vpn Checker extension (check vpn status if connected or not)

Write a short description

You can check Vpn is connected or not by this extension…

Add a picture of all the blocks

Here is the simple blocks of exntesion…
Event raised and return “true” if vpn connected else “false”


you can’t use Logic and Math compare blocks just compare text block is working…
equal :x:
equals :x:

Download links here;

Vpnchecker.aix (6.4 KB)

aia Project:
Vpnchecker.aia (10.2 KB)

VPNChecker.apk (4.3 MB)


No need to use compare block, if your status parameter only return either true or false then you can directly set it in if then condition.

It returns string instead of boolean.

@Professional make Status return boolean instead


yes its Return true or false but in string form instead of boolean…soo we need to use comapre text block…

You can do like this:

    @SimpleFunction(description = "Returns true if the device is connected to a VPN")
    public boolean IsConnectedToVPN() {
        ConnectivityManager connectivityManager =
            (ConnectivityManager) this.context.getSystemService(Context.CONNECTIVITY_SERVICE);
        Network activeNetwork = connectivityManager.getActiveNetwork();
        if (activeNetwork != null) {
            NetworkCapabilities capabilities = connectivityManager.getNetworkCapabilities(activeNetwork);
            return capabilities != null && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN);
        return false;

As already mentioned earlier, follow the naming conventions
Status → status


1 Like

It is returning a string value, instead of Boolean value, which can helps alot.

yes, you can use compare block as i mentioned in post

why is this extension needed? we can already see the VPN connection status

you can check vpn is connected or not in your kodular app… you can restrict user to use vpn when your app is active…