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.

Back

3.3 GetServlist_bygeo Android Example

I. Providing JSON as a parameter:

VPNSDK.CmdProc("{\"cmd\": 24, \"data\": {\"premium\": true}}");

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

II. Convenient form:

VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
        @Override
        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
            }
        }
    };  VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_SERVLIST_BYGEO, callback, true);

This form of method accepts following parameters:

  1. Command code
  2. Callback to be invoked after command execution

data parameter of callback will contain Map of the following structure:

 {
    "104.192.3.90": {
            "name": "U.S. New York",
            "hostname": "us-new-york.keenvpn.me",
            "country": "US",
            "cipher": [
                "BF-CBC",
                "AES-128-CBC",
                "AES-128-GCM",
                "AES-256-CBC",
                "AES-256-GCM"
            ],
            "cipher_tcp_ports": [
                "1194",
                "8080",
                "8181",
                "1299",
                "1199",
                "8989",
                "8289",
                "1399",
                "9989"
            ],
            "cipher_udp_ports": [
                "1194",
                "8080",
                "8181",
                "1299",
                "1199",
                "8989",
                "8289",
                "1399",
                "9989"
            ],
            "lz4": true,
            "lz4_ports": [
                "1149",
                "4600",
                "5500"
            ],
            "xor": true,
            "xor_ports": [
                "443",
                "80",
                "1499",
                "9919",
                "8332",
                "30303",
                "18080",
                "8081",
                "3333"
            ],
            "smart_dns_id": "1",
            "flag": "https:\/\/client-api.keenow.com\/serverlist\/flags\/new_res\/us.png",
            "protocols": {
                "l2tp": true,
                "openvpn": true,
                "ikev2": true
            },
            "lat": "40.9375",
            "lon": "-73.8994",
            "distance": 6827.8522822623
    }
  }