Unified in-app VPN SDK's for Microsoft Windows Vista+, Android 4.4+, Mac OS 10.7+, iOS 9.0+, Ubuntu Linux LTS 18.04+. Earlier OS versions can be supported as well by request. Please contact [email protected] to receive your own API key.

Copyright © 2019 VPNWholesaler.com. All rights reserved.


3.13 setIOCount Android Example

I. Providing JSON as a parameter:

VPNSDK.CmdProc("{\"cmd\": 15, \"data\": {\"status\": true}}");

Result of this command will be returned using onNotify method provided on initialization

II. Convenient form:

VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
        public void onNotify(int notification, int error, Object data) {
            if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
                // Do something when command is successful
            } else {
                // Process error

This form of method accepts following parameters:

  1. Command code
  2. Callback to be invoked after command execution
  3. IO Counter status (boolean)

data parameter of callback will be null. Result could be determined based on error parameter of callback.

When IO Counter is enabled SDK will be constantly invoking handler provided upon initialization with notification code equal to VPNSDK.OVS_NOTIFY_CODES.OVS_NOTIFY_IOCOUNT. And data parameter will contain following structure:

    "data_in": 0,
    "speed_in": 0,
    "data_out": 0,
    "speed_out": 0

It's possible to use the following code to handle it:

public void onNotify(int notification, int error, Object data) {
    switch (notification) {
            Map<String, Long> map = (Map)data;
            long BytesIn = data.get("data_in");
            long BytesOut = data.get("data_out");
            //Do something with IO counters