---
title: getState(String profileName)
slug: isac/admin-guide/android/getstatestring-profilename
docTags: 
createdAt: 2026-07-23T05:01:25.262Z
---

Get the current VPN state for the specified VPN profile.

### Syntax:

int getState(String profileName)

### Parameters:

The profileName is the name of the profile.

### Returns:

The possible return values are:

```bash
public enum KnoxVpnState {
IDLE(1),
CONNECTING(2),
DISCONNECTING(3),
CONNECTED(4),
FAILED(5),
DELETED(6),
// State(s) defined by our app. To avoid conflict with KNOX state // definitions, we are starting the value from 101; PS_USER_SESSION_CREATED(101);
}
```

When the return value is KnoxVpnState.FAILED, the caller can call getErrorString() to obtain a description of the VPN failure.
