Speedify SDK for Android  14.7.0
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
com.speedify.speedifysdk.SpeedifySDK Class Reference

Detailed Description

Main SDK API.

Instantiate an instance of SpeedifySDK in your Applications class. SpeedifySDK will run its VPN services in a separate process, which needs access to a properly configured SpeedifySDK instance for your app. All calls are non-blocking. Create a subclass of SpeedifyHandler or implement ISpeedifyHandler, and implement the methods for the various callbacks which you are interesed in. The SpeedifySDK will call to inform you of changes through these callbacks.

Since
5.6

Classes

interface  AutoConstruct
 Interface for your Application class to provided automatic construction of the SpeedifySDK when needed. More...
 
class  StatsRunnable
 

Public Member Functions

 SpeedifySDK (@NonNull Context applicationContext, @NonNull String name)
 Constructor for SpeedifySDK with default handler. More...
 
 SpeedifySDK (@NonNull Context applicationContext, @NonNull String name, @NonNull ISpeedifyHandler handler)
 Constructor for SpeedifySDK with provided handler. More...
 
final void setAppName (@NonNull String name)
 Sets the app name used for autoaccounts and SDK-generated UI elements, such as the foreground notification. More...
 
final void setHandler (@Nullable ISpeedifyHandler newHandler)
 Sets the main handler for event callbacks. More...
 
final void restartServices ()
 Ensures relevant services are started. More...
 
final void connectAuto (AutoConnectMethod method)
 Connect to a server by an automatic selection method. More...
 
final void connectProxy ()
 Runs the Speedify VPN as a local proxy, without a connection to a remote server. More...
 
final void connectByCountry (@NonNull String country)
 Connect to a server by server country. More...
 
final void connectByCity (@NonNull String country, @NonNull String city)
 Connect to a server by server city. More...
 
final void connectByServer (@NonNull String country, @NonNull String city, int num)
 Connect to a specific server. More...
 
final void connectByServerExact (@NonNull String country, @NonNull String city, int num)
 Connect to a specific server, without fallback. More...
 
final void setConnectMethodAuto (AutoConnectMethod method)
 Set the default connection method to an automatic selection method. More...
 
final void setConnectMethodCountry (@NonNull String country)
 Set the default connection method to a specific country. More...
 
final void setConnectMethodCity (@NonNull String country, @NonNull String city)
 Set the default connection method to a specific city. More...
 
final void setConnectMethodServer (@NonNull String country, @NonNull String city, int num)
 Set the default connection method to a specific server. More...
 
final void setConnectMethodServerExact (@NonNull String country, @NonNull String city, int num)
 Set the default connection method to a specific server, without fallback. More...
 
final void disconnect ()
 Disconnect from the server if connected, or cancel a connection attempt if currenty connecting. More...
 
final void login (@NonNull String username, @NonNull String password)
 Authenticate a new user. More...
 
final void loginOAuth (@NonNull String oauthAccessToken)
 Authenticate a new user using an oauth access token. More...
 
final void refreshOAuthToken (String newOAuthAccessToken)
 Refreshes the current oauth access token. More...
 
final void getActivationCode ()
 Gets an activation code usable to login via the website. More...
 
final void logout ()
 Logout the current user. More...
 
final void setMode (BondingMode mode)
 Change the basic mode of operation, between optimizing for speed or maximizing reliability. More...
 
final void setConnectionPriorities (@NonNull String adapterID, ConnectionPriority priority)
 Change priorities of a connection. More...
 
final void enableAutomaticConnectionPriority (boolean enabled)
 Set if automatic priority is allowed. More...
 
final void setConnectionEncryption (@NonNull String adapterID, boolean encrypted)
 Change encryption settings per connection. More...
 
final void setTunnelEncrypted (boolean encrypted)
 Sets encryption status on all connections forming the tunnels. More...
 
final void setConnectionRateLimit (@NonNull String adapterID, long bps)
 Set the speed rate limit on a connection. More...
 
final void resetConnectionRateLimit (@NonNull String adapterID)
 Reset the speed rate limit on a connection to unlimited. More...
 
final void setOverflowThreshold (double mbpsOverflow)
 Set the overflow threshold. More...
 
final void setPriorityOverflowThreshold (double mbpsOverflow)
 Set the priority overflow threshold, which is used when there is active priority traffic (i.e. More...
 
final void setDirectoryDomain (@NonNull String domain)
 Change directory server used for user authentication and server management. More...
 
final void setESNIEnabled (boolean enableEsni)
 Sets if ESNI is used when talking to the directory domain If using your own directory server, this must be called before login or loginAutoAccount. More...
 
final void resetDirectoryDomain ()
 Reset the directory server to defaults. More...
 
final void setDirectoryGatewayURI (@NonNull String gatewayUri)
 Set an oauth gateway to use for directory server requests. More...
 
final void resetDirectoryGatewayURI ()
 Reset the directory oauth gateway to defaults. More...
 
final void enableStatUpdates (boolean enabled, @Nullable List< Long > periods)
 Enable periodic connection stats, adapter list updates, session stats, and streaming stats to be sent while Speedify is connected. More...
 
final void refreshHistoricConnectionStats ()
 Gets historic tunnel stats for last 5 minutes. More...
 
final void refreshSessionStats ()
 Refreshes session stats. More...
 
final void refreshStreamingStats ()
 Refreshes streaming stats. More...
 
final void refreshDirectory ()
 Refresh a list of available servers from the directory list. More...
 
final void refreshDirectorySettings ()
 Refresh the current directory settings. More...
 
final void refreshState ()
 Refresh the current connection state and connected/last server. More...
 
final void refreshNetworks ()
 Refresh the list of current connection. More...
 
final void refreshSettings ()
 Refresh the current settings information. More...
 
final void refreshConnectedServer ()
 Requests information about the current connected VPN server Triggers OnConnectedServer. More...
 
final void refreshAll ()
 Shortcut to refresh all data. More...
 
final void handleNewAdapter (@NonNull String adapterID)
 Acknowledge and clear message about a new adapter. More...
 
final void handleAdapterOverlimit (@NonNull String adapterID)
 Acknowledge and clear message about an overlimit adapter. More...
 
final void addAdapterDailyDataLimitBoost (@NonNull String adapterID, long additionalBytes)
 Adds additional bytes to the adapter's daily data usage limit for today. More...
 
final void setAdapterDailyDataLimit (@NonNull String adapterID, long allowedBytes)
 Set the data usage, in bytes, allowed on this adapter in a single day. More...
 
final void disableAdapterDailyDataLimit (@NonNull String adapterID)
 Sets the adapter to unlimited daily data usage. More...
 
final void setAdapterMonthlyDataLimit (@NonNull String adapterID, long allowedBytes, long resetDay)
 Set the data usage, in bytes, allowed on this adapter in a single month. More...
 
final void disableAdapterMonthlyDataLimit (@NonNull String adapterID)
 Sets the adapter to unlimited daily data usage. More...
 
final void setExcludedIPRanges (@NonNull List< IPRange > excludedRanges)
 Set IP address ranges to exclude from going over the VPN tunnel. More...
 
final void setExcludeDefaultPrivateIPRanges (boolean exclude)
 Set whether the default private IP ranges are excluded from going over the VPN tunnel. More...
 
final void setIPLeakProtection (boolean enabled)
 Sets if IP Leak protection is enabled. More...
 
final void setEnableDefaultRoute (boolean enable)
 Set whether the default route (0.0.0.0/0) goes over the VPN tunnel. More...
 
final void setJumboPackets (boolean useJumbo)
 Sets whether to allow jumbo packets over the VPN tunnel. More...
 
final void setConnectionTransportMode (TransportMode transportMode)
 Sets the transport mode selection used for each connection. More...
 
final void setAllowChaChaEncryption (boolean allowChaCha)
 Allow or disallow use of ChaCha for connection encryptions. More...
 
final void setAdapterOverlimitRatelimit (@NonNull String adapterID, long bps)
 Sets how to handle an adapter that has hit its daily or monthly data limit. More...
 
final void resetAdapterUsage (@NonNull String adapterID)
 Resets the tracked data usage on an adapter. More...
 
final void loginAutoAccount ()
 Logs out of any current account and logs in to an automatically generated account for this device. More...
 
final void loginLocalLoopbackOnly ()
 Comcast Loopback Function. More...
 
final void accountCheck (@NonNull String email)
 Check if there is already an account using this email address. More...
 
final void accountCreate (@NonNull String email, @NonNull String password)
 Create a new account using this email address. More...
 
final void accountPasswordChange (@NonNull String email, @NonNull String originalPassword, @NonNull String newPassword)
 Change the password on the account. More...
 
final void refreshNonVPNApplications ()
 Refreshes list of applications that should not go over the VPN. More...
 
final void setNonVPNApplications (@NonNull List< String > nonVpnApps)
 Set applications that should not go over the VPN. More...
 
final void refreshAccounting ()
 Refresh account data. More...
 
final void refreshPrivacy ()
 Refresh privacy settings. More...
 
final void setDoNotStoreCredentials (boolean doNotStore)
 Sets if credentials will not be stored. More...
 
final void setReportingEncryptionKey (@Nullable String key128bit)
 Set reporting encryption key. More...
 
final void setDisconnectOnExit (boolean shouldDisconnect)
 Sets the behavior of the VPN service upon task swipe/close all. More...
 
final void setNeverExitOnSwipe (boolean neverExitOnSwipe)
 Setting this disables all disconnect/exit on swipe logic. More...
 
final void setDNSServers (@NonNull List< String > dnsAddrs)
 Set IP addresses of the DNS servers to use Current value available from OnPrivacySettings. More...
 
final void setForwardPorts (@NonNull List< ForwardedPort > ports)
 Set ports to be forwarded to this client when connected to a dedicated server. More...
 
final void setDownstreamSubnets (@NonNull List< Subnet > subnets)
 Set the downstream subnets available on this device. More...
 
final void setLocalVendorSettings (@NonNull JSONObject settings, boolean merge)
 Set local vendor settings Current value available from OnLocalVendorSettings. More...
 
final void refreshLocalVendorSettings ()
 Gets the local vendor settings Triggers OnLocalVendorSettings. More...
 
final void refreshRemoteVendorSettings ()
 Gets the remote vendor settings Triggers OnRemoteVendorSettings. More...
 
final void setVendorUserData (@Nullable String vendorUserData)
 Set vendor user data Current value available from OnVendorUserData. More...
 
final void refreshVendorUserData ()
 Gets the vendor user data Triggers OnVendorUserData. More...
 
final void refreshLocalProxy ()
 Get configuration of the local proxy Triggers OnLocalProxySettings. More...
 
final void setLocalProxyEnabled (boolean enabled)
 Enables or disables the local proxy. More...
 
final void setLocalProxyMatchMode (ProxyMatchMode matchMode)
 Set the match mode used by the local proxy. More...
 
final void setLocalProxyDomains (@NonNull List< String > domains)
 Set domains to proxy locally, instead of going through the VPN. More...
 
final void setLocalProxyPackages (@NonNull List< String > packages)
 Set packages route around the vpn, instead of going through the VPN. More...
 
final void setLocalProxyIPv4 (@NonNull List< String > ipv4)
 Set IPv4 address to proxy locally, instead of going through the VPN. More...
 
final void setLocalProxyIPv6 (@NonNull List< String > ipv6)
 Set IPv6 address to proxy locally, instead of going through the VPN. More...
 
final void setLocalProxyPorts (@NonNull List< LocalProxyPort > ports)
 Set ports to proxy. More...
 
final void setLocalProxyDomainWatchlist (@NonNull List< LocalProxyDomainWatchlistItem > domainWatchlist)
 Set domain watchlist settings for the local proxy If connected, this triggers a reconnect. More...
 
final void setLocalProxyDomainWatchlistEnable (@NonNull String title, boolean enabled)
 Toggle a single domain watchlist item from being enabled over the local proxy. More...
 
final void setLocalProxyGlobalDomainWatchlistEnable (boolean watchlistEnabled)
 Sets if settings in the local proxy domain watchlist entries are applied. More...
 
final void resetLocalProxyDomainWatchlist ()
 Resets the local proxy domain watchlist entries to their default settings Triggers OnLocalProxySettings. More...
 
final void refreshCaptivePortals ()
 Checks connected networks for captive portals Triggers OnCaptivePortals. More...
 
final void enableCaptivePortalMode (@NonNull String adapterID)
 Enable captive portal mode, sending all traffic over the specified network. More...
 
final void disableCaptivePortalMode ()
 Disable captive portal mode. More...
 
final void refreshFirewall ()
 Get configuration of the firewall Triggers OnFirewallSettings. More...
 
final void setFirewallMode (FirewallMode mode)
 Set the mode used by the firewall. More...
 
final void setFirewallDomains (@NonNull List< String > domains)
 Set domains to firewall. More...
 
final void setFirewallIPv4 (@NonNull List< String > ipv4)
 Set IPv4 address to firewall. More...
 
final void setFirewallIPv6 (@NonNull List< String > ipv6)
 Set IPv6 address to firewall. More...
 
final void setFirewallPorts (@NonNull List< FirewallPort > ports)
 Set ports to firewall. More...
 
final void refreshStreamingSettings ()
 Get configuration of streaming settings. More...
 
final void setStreamingDomains (@NonNull List< String > domains)
 Set domains to be identified as streams. More...
 
final void setStreamingIPv4 (@NonNull List< String > ipv4)
 Set IPv4 address to identified as streams. More...
 
final void setStreamingIPv6 (@NonNull List< String > ipv6)
 Set IPv6 address to identified as streams. More...
 
final void setStreamingPorts (@NonNull List< StreamingPort > ports)
 Set ports to identified as streams. More...
 
final void setKillswitch (boolean enabled)
 Sets if Internet Killswitch should be enabled. More...
 
final void setRequestToDisableDoH (boolean disableDoH)
 Requests that browsers do not use DNS over HTTPS. More...
 
final void setStartupConnect (boolean enabled)
 Set if Speedify should autmatically connect when the daemon starts. More...
 
final void refreshLastDisconnectEvent ()
 Get the last session disconnect event Triggers OnLastDisconnectEvent. More...
 
final void refreshLogSettings ()
 Get the current log settings Triggers OnLogSettings. More...
 
final void setDaemonLogSettings (@NonNull DaemonLogSettings daemon)
 Set daemon log file settings Triggers OnLogSettings. More...
 
final void eraseAllLogFiles ()
 Erase all log files and log zips. More...
 
final void setHeaderCompression (boolean enable)
 Sets whether to allow header compression of packets over the VPN tunnel. More...
 
final boolean hasVPNPermission ()
 Checks if the SDK currently has VPN permission. More...
 
final void initializeVPNPermission ()
 Requests VPN permission from the user through the system VPN dialog Triggers OnVPNPermissionResult. More...
 
final void setLanguage (@NonNull String language)
 Set the language used for error messages Triggers OnSettings. More...
 
final void startSpeedTest ()
 Starts a new speed test Triggers OnSpeedTestResults. More...
 
final void startStreamTest ()
 Starts a new speed test Triggers OnSpeedTestResults. More...
 
final void refreshSpeedTestResults ()
 Gets last 5 speed test results Triggers OnSpeedTestResults. More...
 
final void refreshNetworkSharingSettings ()
 Gets the current network sharing settings Triggers OnNetworkSharingSettings. More...
 
final void setNetworkSharingClientEnabled (boolean enabled)
 Sets whether network sharing client will be active. More...
 
final void setNetworkSharingHostEnabled (boolean enabled)
 Sets whether network sharing host will be active. More...
 
final void setNetworkSharingDisplayName (String displayName)
 Sets the display name of this device. More...
 
final void connectToNetworkShareViaConnectCode (NetworkSharing.ConnectCode connectCode)
 Connects to a network share manually via a connect code. More...
 
final void reconnectToNetworkShare (NetworkSharing.PeerUuid peerUuid)
 Reconnects to a previously authenticated network share. More...
 
final void startNetworkSharingDiscovery ()
 Manually start (or restart) a discovery session. More...
 
final void refreshNetworkSharingDiscovery ()
 Get the state of network sharing discovery. More...
 
final void refreshNetworkSharesAvailable ()
 Gets the discovered network shares Triggers OnNetworkSharesAvailable. More...
 
final void setNetworkSharingPeerAutoReconnect (NetworkSharing.PeerUuid peerUuid, boolean allowed)
 Sets whether this device should automatically reconnect on discovery to a known network share. More...
 
final void setNetworkSharingPeerAllowAsHost (NetworkSharing.PeerUuid peerUuid, boolean allowed)
 Sets whether or not the peer at the given UUID may be treated as a host, i.e. More...
 
final void setNetworkSharingPeerAllowAsClient (NetworkSharing.PeerUuid peerUuid, boolean allowed)
 Sets whether or not the peer at the given UUID may be treated as a client, i.e. More...
 
final void unpairNetworkSharingPeer (NetworkSharing.PeerUuid peerUuid)
 Unpair from a device at the given UUID. More...
 
final void requestNetworkSharingPair (NetworkSharing.PeerUuid peerUuid)
 Initiate a pair request with the specified peer. More...
 
final void allowNetworkSharingPair (NetworkSharing.PeerUuid peerUuid, boolean allowed)
 Allow or deny a pair request from the specified peer. More...
 
final void setNetworkSharingPairRequestBehavior (NetworkSharing.PairRequestBehavior behavior)
 Sets the behavior of pair requests from peers. More...
 
final void setNetworkSharingSameUserAutoPair (boolean allow)
 Sets if devices from the same user are automatically paired. More...
 
final void setUlpReportIntervalSeconds (long interval)
 Sets the ULP reporting inverval in seconds. More...
 
final void setMaximumConnectRetry (int timeout)
 Speedify follows a backoff pattern for repeated errors when logging in or connecting to VPN servers. More...
 
final void setMaximumTransportRetry (int timeout)
 When Speedify fails to establish VPN transport connections over an Internet connection, it will use a backoff pattern to wait before attempting to establish a transport over that connection again. More...
 
final void sendFeedback (String feedback)
 Generates new ulp data report with feedback message attached. More...
 
final void sendMessage (String messageType, JSONObject data)
 
final void sendMessage (String messageType, JSONArray data)
 
final void sendMessage (String messageType)
 
final boolean isBackgroundProcess ()
 Test if currently in sdk background process (:vpnservice). More...
 
void destroy ()
 Destroys this instance of the SpeedifySDK. More...
 
final void registerSdkStateReceiver (@NonNull ISdkStateReceiver handler)
 Register a receiver for SpeedifySDK state changes. More...
 
final void unregisterSdkStateReceiver (@NonNull ISdkStateReceiver handler)
 Unregister a receiver for SpeedifySDK state changes. More...
 
final void registerWsMessageHandler (IWsHandler handler)
 

Static Public Member Functions

static SpeedifySDK getInstance (@Nullable Context context)
 Gets the current SpeedifySDK instance. More...
 
static SpeedifySDK getInstance ()
 Gets the current SpeedifySDK instance. More...
 
static boolean isSdkAlive ()
 Check if there is an active instance of the Speedify SDK. More...
 
static final String Version ()
 SpeedifySDK version. More...
 
static boolean hasVPNPermission (Context appContext)
 Checks if the SDK currently has VPN permission. More...
 
static void initializeVPNPermission (Context appContext)
 Requests VPN permission from the user through the system VPN dialog Triggers OnVPNPermissionResult. More...
 
static void subscribeToEvent (String event)
 internal use More...
 
static boolean IsBackgroundProcess (@NonNull Application application)
 Test if currently in sdk background process (:vpnservice). More...
 
static boolean IsBackgroundProcess (@NonNull Context context)
 Test if currently in sdk background process (:vpnservice). More...
 
static void ForceExit (@NonNull Context context)
 Force Speedify SDK to exit and all SpeedifySDK objects to cleanup themselves. More...
 

Public Attributes

final MultiReceiverManager< ISdkStateReceiversdkStateReceivers = new MultiReceiverManager<ISdkStateReceiver>()
 Registers a new SDK state receiver Receivers are WeakReferenced, so you must keep a reference to the receiver. More...
 
final MultiReceiverManager< IForegroundServiceStateReceiverforegroundServiceReceivers = new MultiReceiverManager<IForegroundServiceStateReceiver>()
 Registers a new foreground service event receiver. More...
 

Static Public Attributes

static boolean EnableSDKHandlerFromBackground = false
 Enables ISdkStateReceiver callbacks for to be used from the sdk background process (:vpnservice). More...
 

Protected Member Functions

Context getApplicationContext ()
 
void onMessage (String messageType, JSONArray data)
 internal use More...
 
void onMessage (String messageType, JSONObject data)
 internal use More...
 
void onMessage (String messageType)
 internal use More...
 

Constructor & Destructor Documentation

◆ SpeedifySDK() [1/2]

com.speedify.speedifysdk.SpeedifySDK.SpeedifySDK ( @NonNull Context  applicationContext,
@NonNull String  name 
)

Constructor for SpeedifySDK with default handler.

This should be called from AutoConstruct#getSpeedifySDK. SpeedifySDK will start a second process for running the VPN service, and will need access to data from this object.

Parameters
applicationContextApplication Context
nameName of the application. Used in notifications.
Since
10.6

◆ SpeedifySDK() [2/2]

com.speedify.speedifysdk.SpeedifySDK.SpeedifySDK ( @NonNull Context  applicationContext,
@NonNull String  name,
@NonNull ISpeedifyHandler  handler 
)

Constructor for SpeedifySDK with provided handler.

This should be called from AutoConstruct#getSpeedifySDK. SpeedifySDK will start a second process for running the VPN service, and will need access to data from this object.

Parameters
applicationContextApplication Context
nameName of the application. Used in notifications.
handlerMain handler for event callbacks
Since
10.6

Member Function Documentation

◆ accountCheck()

final void com.speedify.speedifysdk.SpeedifySDK.accountCheck ( @NonNull String  email)

Check if there is already an account using this email address.

Triggers OnAccountCheckResult.

Parameters
emailaccount to check for
Since
7.5

◆ accountCreate()

final void com.speedify.speedifysdk.SpeedifySDK.accountCreate ( @NonNull String  email,
@NonNull String  password 
)

Create a new account using this email address.

Triggers OnAccountCreateResult.

Parameters
emailaccount to create
passwordpassword of the new account
Since
7.5

◆ accountPasswordChange()

final void com.speedify.speedifysdk.SpeedifySDK.accountPasswordChange ( @NonNull String  email,
@NonNull String  originalPassword,
@NonNull String  newPassword 
)

Change the password on the account.

Triggers OnPasswordChangeResult.

Parameters
emailaccount to change
originalPasswordoriginal password of the account
newPasswordnew password of the account
Since
7.5

◆ addAdapterDailyDataLimitBoost()

final void com.speedify.speedifysdk.SpeedifySDK.addAdapterDailyDataLimitBoost ( @NonNull String  adapterID,
long  additionalBytes 
)

Adds additional bytes to the adapter's daily data usage limit for today.

This value is not added to the base daily data usage limit. Current value available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDID of the adapterID
additionalBytesadditional bytes that may be used today
Since
5.8

◆ allowNetworkSharingPair()

final void com.speedify.speedifysdk.SpeedifySDK.allowNetworkSharingPair ( NetworkSharing.PeerUuid  peerUuid,
boolean  allowed 
)

Allow or deny a pair request from the specified peer.

Parameters
peerUuidThe UUID of the device requesting the pair
allowedWhether to allow or deny the pair request Triggers OnNetworkSharesAvailable.
Since
14.0

◆ connectAuto()

final void com.speedify.speedifysdk.SpeedifySDK.connectAuto ( AutoConnectMethod  method)

Connect to a server by an automatic selection method.

If already connected, this will disconnect before reconnecting. Connect errors will be signalled in OnConnectError. Chosen server will be signalled via OnConnectedServer as connections to them are attempted.

Parameters
methodhow to choose a server
Since
5.6

◆ connectByCity()

final void com.speedify.speedifysdk.SpeedifySDK.connectByCity ( @NonNull String  country,
@NonNull String  city 
)

Connect to a server by server city.

If already connected, this will disconnect before reconnecting. A list of valid servers can be obtained from OnDirectory. Connect errors will be signalled in OnConnectError. Chosen server will be signalled via OnConnectedServer as connections to them are attempted.

Parameters
country2-char ISO country code
citycity name
Since
5.6

◆ connectByCountry()

final void com.speedify.speedifysdk.SpeedifySDK.connectByCountry ( @NonNull String  country)

Connect to a server by server country.

If already connected, this will disconnect before reconnecting. A list of valid servers can be obtained from OnDirectory. Connect errors will be signalled in OnConnectError. Chosen server will be signalled via OnConnectedServer as connections to them are attempted.

Parameters
country2-char ISO country code
Since
5.6

◆ connectByServer()

final void com.speedify.speedifysdk.SpeedifySDK.connectByServer ( @NonNull String  country,
@NonNull String  city,
int  num 
)

Connect to a specific server.

If already connected, this will disconnect before reconnecting. A list of valid servers can be obtained from OnDirectory. Connect errors will be signalled in OnConnectError. Chosen server will be signalled via OnConnectedServer as connections to them are attempted.

Parameters
country2-char ISO country code
citycity name
numserver number
Since
5.6

◆ connectByServerExact()

final void com.speedify.speedifysdk.SpeedifySDK.connectByServerExact ( @NonNull String  country,
@NonNull String  city,
int  num 
)

Connect to a specific server, without fallback.

If already connected, this will disconnect before reconnecting. A list of valid servers can be obtained from OnDirectory. Connect errors will be signalled in OnConnectError. Chosen server will be signalled via OnConnectedServer as connections to them are attempted.

Parameters
country2-char ISO country code
citycity name
numserver number
Since
14.0

◆ connectProxy()

final void com.speedify.speedifysdk.SpeedifySDK.connectProxy ( )

Runs the Speedify VPN as a local proxy, without a connection to a remote server.

If already connected, this will disconnect before reconnecting. Connect errors will be signalled in OnConnectError.

Since
10.4

◆ connectToNetworkShareViaConnectCode()

final void com.speedify.speedifysdk.SpeedifySDK.connectToNetworkShareViaConnectCode ( NetworkSharing.ConnectCode  connectCode)

Connects to a network share manually via a connect code.

Used on remote clients.

Parameters
connectCodethe hostConnectCode of the host Triggers OnNetworkSharesAvailable.
Since
14.0

◆ destroy()

void com.speedify.speedifysdk.SpeedifySDK.destroy ( )

Destroys this instance of the SpeedifySDK.

This does not stop the service. NOTE : This instance of the SpeedifySDK object becomes invalid. You must create a new SpeedifySDK object after calling this.

Since
8.0

◆ disableAdapterDailyDataLimit()

final void com.speedify.speedifysdk.SpeedifySDK.disableAdapterDailyDataLimit ( @NonNull String  adapterID)

Sets the adapter to unlimited daily data usage.

This is a wrapper for setAdapterDailyDataLimit(adapterID,0). Current value available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDID of the adapterID
Since
6.2

◆ disableAdapterMonthlyDataLimit()

final void com.speedify.speedifysdk.SpeedifySDK.disableAdapterMonthlyDataLimit ( @NonNull String  adapterID)

Sets the adapter to unlimited daily data usage.

This is a wrapper for setAdapterMonthlyDataLimit(adapterID,0,0). Current value available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDID of the adapterID
Since
6.2

◆ disableCaptivePortalMode()

final void com.speedify.speedifysdk.SpeedifySDK.disableCaptivePortalMode ( )

Disable captive portal mode.

Since
10.9.5

◆ disconnect()

final void com.speedify.speedifysdk.SpeedifySDK.disconnect ( )

Disconnect from the server if connected, or cancel a connection attempt if currenty connecting.

Since
5.6

◆ enableAutomaticConnectionPriority()

final void com.speedify.speedifysdk.SpeedifySDK.enableAutomaticConnectionPriority ( boolean  enabled)

Set if automatic priority is allowed.

Current settings available from OnSettings.

Parameters
enabledif allowed
Since
12.4

◆ enableCaptivePortalMode()

final void com.speedify.speedifysdk.SpeedifySDK.enableCaptivePortalMode ( @NonNull String  adapterID)

Enable captive portal mode, sending all traffic over the specified network.

Parameters
adapterIDnetwork to operate captive portal mode over
Since
10.9.5

◆ enableStatUpdates()

final void com.speedify.speedifysdk.SpeedifySDK.enableStatUpdates ( boolean  enabled,
@Nullable List< Long >  periods 
)

Enable periodic connection stats, adapter list updates, session stats, and streaming stats to be sent while Speedify is connected.

Triggers OnConnectionStats once per second while connected. Triggers OnAdaptersList once every 30 seconds while connected. Triggers OnSessionStats once per second while connected. Triggers OnStreamingStats once per second while connected.

Parameters
enabledif connection stat updates should be continuously received
periodstimeframes of requested session stats, values in hours, PERIOD_CURRENT for current, PERIOD_TOTAL for total, or empty/null for previously configured periods
Since
10.0

◆ eraseAllLogFiles()

final void com.speedify.speedifysdk.SpeedifySDK.eraseAllLogFiles ( )

Erase all log files and log zips.

Note that the current active log file is not erased.

Since
10.5

◆ ForceExit()

static void com.speedify.speedifysdk.SpeedifySDK.ForceExit ( @NonNull Context  context)
static

Force Speedify SDK to exit and all SpeedifySDK objects to cleanup themselves.

NOTE : Any SpeedifySDK object you have previously contructed will become unuseable after this. You must construct a new SpeedifySDK object or call restartServices on the old one.

Parameters
contextcontext to issue the broadcast on
Since
8.0

◆ getActivationCode()

final void com.speedify.speedifysdk.SpeedifySDK.getActivationCode ( )

Gets an activation code usable to login via the website.

If setting a custom directory, call SpeedifySDK_SetDirectoryDomain() before calling this.

Since
14.0

◆ getApplicationContext()

Context com.speedify.speedifysdk.SpeedifySDK.getApplicationContext ( )
protected

◆ getInstance() [1/2]

static SpeedifySDK com.speedify.speedifysdk.SpeedifySDK.getInstance ( @Nullable Context  context)
static

Gets the current SpeedifySDK instance.

If there is no current instance and a context is passed, a new SpeedifySDK instance is created. The application context will always be used when creating a SpeedifySDK from this call.

Parameters
contextContext used to create the sdk object.
Returns
the SpeedifySDK instance, or null
Since
7.2.1

◆ getInstance() [2/2]

static SpeedifySDK com.speedify.speedifysdk.SpeedifySDK.getInstance ( )
static

Gets the current SpeedifySDK instance.

Returns
the SpeedifySDK instance, or null
Since
7.2.1

◆ handleAdapterOverlimit()

final void com.speedify.speedifysdk.SpeedifySDK.handleAdapterOverlimit ( @NonNull String  adapterID)

Acknowledge and clear message about an overlimit adapter.

Parameters
adapterIDID of the adapterID
Since
5.8

◆ handleNewAdapter()

final void com.speedify.speedifysdk.SpeedifySDK.handleNewAdapter ( @NonNull String  adapterID)

Acknowledge and clear message about a new adapter.

Parameters
adapterIDID of the adapterID
Since
5.8

◆ hasVPNPermission() [1/2]

final boolean com.speedify.speedifysdk.SpeedifySDK.hasVPNPermission ( )

Checks if the SDK currently has VPN permission.

Returns
true if permission is already granted
Since
10.0

◆ hasVPNPermission() [2/2]

static boolean com.speedify.speedifysdk.SpeedifySDK.hasVPNPermission ( Context  appContext)
static

Checks if the SDK currently has VPN permission.

Parameters
appContextapplication context
Returns
true if permission is already granted
Since
14.0

◆ initializeVPNPermission() [1/2]

final void com.speedify.speedifysdk.SpeedifySDK.initializeVPNPermission ( )

Requests VPN permission from the user through the system VPN dialog Triggers OnVPNPermissionResult.

Since
10.0

◆ initializeVPNPermission() [2/2]

static void com.speedify.speedifysdk.SpeedifySDK.initializeVPNPermission ( Context  appContext)
static

Requests VPN permission from the user through the system VPN dialog Triggers OnVPNPermissionResult.

Since
14.3

◆ IsBackgroundProcess() [1/2]

static boolean com.speedify.speedifysdk.SpeedifySDK.IsBackgroundProcess ( @NonNull Application  application)
static

Test if currently in sdk background process (:vpnservice).

Parameters
applicationan android Application
Returns
true if running from background process
Since
8.0

◆ isBackgroundProcess()

final boolean com.speedify.speedifysdk.SpeedifySDK.isBackgroundProcess ( )

Test if currently in sdk background process (:vpnservice).

Returns
true if running from background process
Since
5.8

◆ IsBackgroundProcess() [2/2]

static boolean com.speedify.speedifysdk.SpeedifySDK.IsBackgroundProcess ( @NonNull Context  context)
static

Test if currently in sdk background process (:vpnservice).

Parameters
contextan android Context
Returns
true if running from background process
Since
5.9

◆ isSdkAlive()

static boolean com.speedify.speedifysdk.SpeedifySDK.isSdkAlive ( )
static

Check if there is an active instance of the Speedify SDK.

Returns
if a SpeedifySDK instance is present
Since
11.4

◆ login()

final void com.speedify.speedifysdk.SpeedifySDK.login ( @NonNull String  username,
@NonNull String  password 
)

Authenticate a new user.

If setting a custom directory, call setDirectoryDomain before calling this. Login errors will be signalled in OnLoginError.

Parameters
usernameUsername of the user you wish to authenticate
passwordPassword of the user you wish to authenticate
Since
5.6

◆ loginAutoAccount()

final void com.speedify.speedifysdk.SpeedifySDK.loginAutoAccount ( )

Logs out of any current account and logs in to an automatically generated account for this device.

If setting a custom directory, call setDirectoryDomain before calling this. This may take several seconds as the OS is queryied for the device id. Login or auto-account creation errors will be signalled in OnLoginError. Automatic accounts have an email address in the form of <platform>.<deviceID>@autoaccount.speedify.com.

Since
6.1

◆ loginLocalLoopbackOnly()

final void com.speedify.speedifysdk.SpeedifySDK.loginLocalLoopbackOnly ( )

Comcast Loopback Function.

Since
10.6

◆ loginOAuth()

final void com.speedify.speedifysdk.SpeedifySDK.loginOAuth ( @NonNull String  oauthAccessToken)

Authenticate a new user using an oauth access token.

The application is responsible for fetching updated access tokens if using this method. If setting a custom directory, call setDirectoryDomain before calling this. Login errors will be signalled in OnLoginError. An expired access token will give an error of type TOKEN_EXPIRED, while invalid tokens will give CREDENTIAL.

Parameters
oauthAccessTokenAccess token for the user you wish to authenticate
Since
6.3.4

◆ logout()

final void com.speedify.speedifysdk.SpeedifySDK.logout ( )

Logout the current user.

This will reset your connect method to CLOSEST.

Since
5.6

◆ onMessage() [1/3]

void com.speedify.speedifysdk.SpeedifySDK.onMessage ( String  messageType,
JSONArray  data 
)
protected

internal use

Parameters
messageTypethe message identifier
datajson array of message data

◆ onMessage() [2/3]

void com.speedify.speedifysdk.SpeedifySDK.onMessage ( String  messageType,
JSONObject  data 
)
protected

internal use

Parameters
messageTypethe message identifier
datajson object of message data

◆ onMessage() [3/3]

void com.speedify.speedifysdk.SpeedifySDK.onMessage ( String  messageType)
protected

internal use

Parameters
messageTypethe message identifier

◆ reconnectToNetworkShare()

final void com.speedify.speedifysdk.SpeedifySDK.reconnectToNetworkShare ( NetworkSharing.PeerUuid  peerUuid)

Reconnects to a previously authenticated network share.

Used on remote clients.

Parameters
peerUuidthe uuid of the host Triggers OnNetworkSharesAvailable.
Since
14.0

◆ refreshAccounting()

final void com.speedify.speedifysdk.SpeedifySDK.refreshAccounting ( )

Refresh account data.

Triggers OnAccountingData.

Since
6.1

◆ refreshAll()

final void com.speedify.speedifysdk.SpeedifySDK.refreshAll ( )

◆ refreshCaptivePortals()

final void com.speedify.speedifysdk.SpeedifySDK.refreshCaptivePortals ( )

Checks connected networks for captive portals Triggers OnCaptivePortals.

Since
9.3

◆ refreshConnectedServer()

final void com.speedify.speedifysdk.SpeedifySDK.refreshConnectedServer ( )

Requests information about the current connected VPN server Triggers OnConnectedServer.

Since
14.0

◆ refreshDirectory()

final void com.speedify.speedifysdk.SpeedifySDK.refreshDirectory ( )

Refresh a list of available servers from the directory list.

Triggers OnDirectory.

Since
5.6

◆ refreshDirectorySettings()

final void com.speedify.speedifysdk.SpeedifySDK.refreshDirectorySettings ( )

Refresh the current directory settings.

Triggers OnDirectorySettings.

Since
10.5

◆ refreshFirewall()

final void com.speedify.speedifysdk.SpeedifySDK.refreshFirewall ( )

Get configuration of the firewall Triggers OnFirewallSettings.

Since
9.2

◆ refreshHistoricConnectionStats()

final void com.speedify.speedifysdk.SpeedifySDK.refreshHistoricConnectionStats ( )

Gets historic tunnel stats for last 5 minutes.

Triggers OnConnectionStats.

Since
5.8

◆ refreshLastDisconnectEvent()

final void com.speedify.speedifysdk.SpeedifySDK.refreshLastDisconnectEvent ( )

Get the last session disconnect event Triggers OnLastDisconnectEvent.

Since
10.4

◆ refreshLocalProxy()

final void com.speedify.speedifysdk.SpeedifySDK.refreshLocalProxy ( )

Get configuration of the local proxy Triggers OnLocalProxySettings.

Since
9.2

◆ refreshLocalVendorSettings()

final void com.speedify.speedifysdk.SpeedifySDK.refreshLocalVendorSettings ( )

Gets the local vendor settings Triggers OnLocalVendorSettings.

Since
9.2

◆ refreshLogSettings()

final void com.speedify.speedifysdk.SpeedifySDK.refreshLogSettings ( )

Get the current log settings Triggers OnLogSettings.

Since
10.5

◆ refreshNetworks()

final void com.speedify.speedifysdk.SpeedifySDK.refreshNetworks ( )

Refresh the list of current connection.

Triggers OnAdaptersList.

Since
5.8

◆ refreshNetworkSharesAvailable()

final void com.speedify.speedifysdk.SpeedifySDK.refreshNetworkSharesAvailable ( )

Gets the discovered network shares Triggers OnNetworkSharesAvailable.

Since
14.0

◆ refreshNetworkSharingDiscovery()

final void com.speedify.speedifysdk.SpeedifySDK.refreshNetworkSharingDiscovery ( )

Get the state of network sharing discovery.

Triggers OnNetworkSharingDiscovery.

Since
14.0

◆ refreshNetworkSharingSettings()

final void com.speedify.speedifysdk.SpeedifySDK.refreshNetworkSharingSettings ( )

Gets the current network sharing settings Triggers OnNetworkSharingSettings.

Since
14.0

◆ refreshNonVPNApplications()

final void com.speedify.speedifysdk.SpeedifySDK.refreshNonVPNApplications ( )

Refreshes list of applications that should not go over the VPN.

Triggers OnNonVPNApplications.

Since
7.6.1

◆ refreshOAuthToken()

final void com.speedify.speedifysdk.SpeedifySDK.refreshOAuthToken ( String  newOAuthAccessToken)

Refreshes the current oauth access token.

The application is responsible for fetching updated access tokens if using this method. If not logged in or logged in not using oauth, this will initiate a new login. Otherwise, the new token is stored to be used for future requests. Calling this from a logged in state presumes this is a token for the same user. If setting a custom directory, call setDirectoryDomain before calling this. Login errors will be signalled in OnLoginError. An expired access token will give an error of type TOKEN_EXPIRED, while invalid tokens will give CREDENTIAL.

Parameters
newOAuthAccessTokenNew access token for the user you wish to authenticate
Since
12.7

◆ refreshPrivacy()

final void com.speedify.speedifysdk.SpeedifySDK.refreshPrivacy ( )

Refresh privacy settings.

Triggers OnPrivacySettings.

Since
6.3

◆ refreshRemoteVendorSettings()

final void com.speedify.speedifysdk.SpeedifySDK.refreshRemoteVendorSettings ( )

Gets the remote vendor settings Triggers OnRemoteVendorSettings.

Since
9.2

◆ refreshSessionStats()

final void com.speedify.speedifysdk.SpeedifySDK.refreshSessionStats ( )

Refreshes session stats.

Triggers OnSessionStats.

Since
9.5

◆ refreshSettings()

final void com.speedify.speedifysdk.SpeedifySDK.refreshSettings ( )

Refresh the current settings information.

Triggers OnSettings.

Since
5.8

◆ refreshSpeedTestResults()

final void com.speedify.speedifysdk.SpeedifySDK.refreshSpeedTestResults ( )

Gets last 5 speed test results Triggers OnSpeedTestResults.

Since
11.0

◆ refreshState()

final void com.speedify.speedifysdk.SpeedifySDK.refreshState ( )

Refresh the current connection state and connected/last server.

Triggers OnState, OnConnectedServer.

Since
5.6

◆ refreshStreamingSettings()

final void com.speedify.speedifysdk.SpeedifySDK.refreshStreamingSettings ( )

Get configuration of streaming settings.

Triggers OnStreamingSettings.

Since
10.9

◆ refreshStreamingStats()

final void com.speedify.speedifysdk.SpeedifySDK.refreshStreamingStats ( )

Refreshes streaming stats.

Triggers OnStreamingStats.

Since
9.6

◆ refreshVendorUserData()

final void com.speedify.speedifysdk.SpeedifySDK.refreshVendorUserData ( )

Gets the vendor user data Triggers OnVendorUserData.

Since
9.8

◆ registerSdkStateReceiver()

final void com.speedify.speedifysdk.SpeedifySDK.registerSdkStateReceiver ( @NonNull ISdkStateReceiver  handler)

Register a receiver for SpeedifySDK state changes.

The receiver is stored as a WeakReference.

Parameters
handlerthe receiver to register
Since
11.9.2
Deprecated:
as of 14.7. use sdkStateReceivers.register instead

◆ registerWsMessageHandler()

final void com.speedify.speedifysdk.SpeedifySDK.registerWsMessageHandler ( IWsHandler  handler)

◆ requestNetworkSharingPair()

final void com.speedify.speedifysdk.SpeedifySDK.requestNetworkSharingPair ( NetworkSharing.PeerUuid  peerUuid)

Initiate a pair request with the specified peer.

Parameters
peerUuidThe UUID of the device to pair with. Triggers OnNetworkSharesAvailable.
Since
14.0

◆ resetAdapterUsage()

final void com.speedify.speedifysdk.SpeedifySDK.resetAdapterUsage ( @NonNull String  adapterID)

Resets the tracked data usage on an adapter.

Parameters
adapterIDID of the adapterID
Since
7.8.3

◆ resetConnectionRateLimit()

final void com.speedify.speedifysdk.SpeedifySDK.resetConnectionRateLimit ( @NonNull String  adapterID)

Reset the speed rate limit on a connection to unlimited.

Current rateLimit available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDguid of adapter, from adapter list.
Since
5.6

◆ resetDirectoryDomain()

final void com.speedify.speedifysdk.SpeedifySDK.resetDirectoryDomain ( )

Reset the directory server to defaults.

Triggers OnDirectorySettings, and (if logged in) OnDirectory on domain change.

Since
7.5

◆ resetDirectoryGatewayURI()

final void com.speedify.speedifysdk.SpeedifySDK.resetDirectoryGatewayURI ( )

Reset the directory oauth gateway to defaults.

Triggers OnDirectorySettings.

Since
10.5

◆ resetLocalProxyDomainWatchlist()

final void com.speedify.speedifysdk.SpeedifySDK.resetLocalProxyDomainWatchlist ( )

Resets the local proxy domain watchlist entries to their default settings Triggers OnLocalProxySettings.

Since
13.2

◆ restartServices()

final void com.speedify.speedifysdk.SpeedifySDK.restartServices ( )

Ensures relevant services are started.

Since
5.6

◆ sendFeedback()

final void com.speedify.speedifysdk.SpeedifySDK.sendFeedback ( String  feedback)

Generates new ulp data report with feedback message attached.

Parameters
feedbackfeedback message
Since
14.7

◆ sendMessage() [1/3]

final void com.speedify.speedifysdk.SpeedifySDK.sendMessage ( String  messageType,
JSONObject  data 
)

◆ sendMessage() [2/3]

final void com.speedify.speedifysdk.SpeedifySDK.sendMessage ( String  messageType,
JSONArray  data 
)

◆ sendMessage() [3/3]

final void com.speedify.speedifysdk.SpeedifySDK.sendMessage ( String  messageType)

◆ setAdapterDailyDataLimit()

final void com.speedify.speedifysdk.SpeedifySDK.setAdapterDailyDataLimit ( @NonNull String  adapterID,
long  allowedBytes 
)

Set the data usage, in bytes, allowed on this adapter in a single day.

Setting allowedBytes to 0 will disable this limit. Current value available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDID of the adapterID
allowedBytesbytes that may be used in a single day. 0 for unlimited
Since
5.8

◆ setAdapterMonthlyDataLimit()

final void com.speedify.speedifysdk.SpeedifySDK.setAdapterMonthlyDataLimit ( @NonNull String  adapterID,
long  allowedBytes,
long  resetDay 
)

Set the data usage, in bytes, allowed on this adapter in a single month.

Setting allowedBytes to 0 will disable this limit. Current value available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDID of the adapterID
allowedBytesbytes that may be used in a single month. 0 for unlimited
resetDayday of the month that monthly usage is tracked from. 0 for last 30 days. unused if allowedBytes is 0
Since
5.8

◆ setAdapterOverlimitRatelimit()

final void com.speedify.speedifysdk.SpeedifySDK.setAdapterOverlimitRatelimit ( @NonNull String  adapterID,
long  bps 
)

Sets how to handle an adapter that has hit its daily or monthly data limit.

Current value available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDID of the adapterID
bpsrate limit, in bits per second. 0 to not use the adapter.
Since
6.0

◆ setAllowChaChaEncryption()

final void com.speedify.speedifysdk.SpeedifySDK.setAllowChaChaEncryption ( boolean  allowChaCha)

Allow or disallow use of ChaCha for connection encryptions.

Current value available from OnSettings.

Since
5.9
Parameters
allowChaChaallow use of ChaCha

◆ setAppName()

final void com.speedify.speedifysdk.SpeedifySDK.setAppName ( @NonNull String  name)

Sets the app name used for autoaccounts and SDK-generated UI elements, such as the foreground notification.

This is automatically called from the constructor with the name passed in. If calling this manually, do so before calling any login method.

Parameters
namenew app name
Since
11.8

◆ setConnectionEncryption()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectionEncryption ( @NonNull String  adapterID,
boolean  encrypted 
)

Change encryption settings per connection.

Current settings available from OnSettings.

Parameters
adapterIDguid of adapter, from adapters list
encryptedwhether to encrypt
Since
5.6

◆ setConnectionPriorities()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectionPriorities ( @NonNull String  adapterID,
ConnectionPriority  priority 
)

Change priorities of a connection.

Current priority available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDguid of adapter, from adapters list.
prioritypriority level
Since
5.6

◆ setConnectionRateLimit()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectionRateLimit ( @NonNull String  adapterID,
long  bps 
)

Set the speed rate limit on a connection.

Current rateLimit available on AdapterData objects returned from OnAdaptersList.

Parameters
adapterIDguid of adapter, from adapters list
bpsrate limit, in bits per second
Since
5.6

◆ setConnectionTransportMode()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectionTransportMode ( TransportMode  transportMode)

Sets the transport mode selection used for each connection.

Current value available from OnSettings.

Parameters
transportModeselection mode to use
Since
5.8

◆ setConnectMethodAuto()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectMethodAuto ( AutoConnectMethod  method)

Set the default connection method to an automatic selection method.

Current settings available from OnServerSettings.

Parameters
methodautomatic server selection method to use
Since
9.4

◆ setConnectMethodCity()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectMethodCity ( @NonNull String  country,
@NonNull String  city 
)

Set the default connection method to a specific city.

Current settings available from OnServerSettings.

Parameters
country2-char ISO country code
citycity name
Since
9.4

◆ setConnectMethodCountry()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectMethodCountry ( @NonNull String  country)

Set the default connection method to a specific country.

Current settings available from OnServerSettings.

Parameters
country2-char ISO country code
Since
9.4

◆ setConnectMethodServer()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectMethodServer ( @NonNull String  country,
@NonNull String  city,
int  num 
)

Set the default connection method to a specific server.

Current settings available from OnServerSettings.

Parameters
country2-char ISO country code
citycity name
numserver number
Since
9.4

◆ setConnectMethodServerExact()

final void com.speedify.speedifysdk.SpeedifySDK.setConnectMethodServerExact ( @NonNull String  country,
@NonNull String  city,
int  num 
)

Set the default connection method to a specific server, without fallback.

Current settings available from OnServerSettings.

Parameters
country2-char ISO country code
citycity name
numserver number
Since
14.0

◆ setDaemonLogSettings()

final void com.speedify.speedifysdk.SpeedifySDK.setDaemonLogSettings ( @NonNull DaemonLogSettings  daemon)

Set daemon log file settings Triggers OnLogSettings.

Requires daemon restart to take effect.

Parameters
daemondaemon log settings
Since
10.5

◆ setDirectoryDomain()

final void com.speedify.speedifysdk.SpeedifySDK.setDirectoryDomain ( @NonNull String  domain)

Change directory server used for user authentication and server management.

If using your own directory server, this must be called before login or loginAutoAccount. Triggers OnDirectorySettings, and (if logged in) OnDirectory on domain change.

Parameters
domaindirectory server domain, ie: directory.company.com
Since
7.5

◆ setDirectoryGatewayURI()

final void com.speedify.speedifysdk.SpeedifySDK.setDirectoryGatewayURI ( @NonNull String  gatewayUri)

Set an oauth gateway to use for directory server requests.

If using your own directory gateway, this must be called before loginOAuth. Triggers OnDirectorySettings, and (if logged in) OnDirectory on domain change.

Parameters
gatewayUridirectory gateway uri, ie: https://directory.company.com/my/path/
Since
10.5

◆ setDisconnectOnExit()

final void com.speedify.speedifysdk.SpeedifySDK.setDisconnectOnExit ( boolean  shouldDisconnect)

Sets the behavior of the VPN service upon task swipe/close all.

If true (default), the VPN will disconnect and its services will exit. Current value available from OnSettings.

Parameters
shouldDisconnectif the vpn service should disconnect and exit
Since
7.0

◆ setDNSServers()

final void com.speedify.speedifysdk.SpeedifySDK.setDNSServers ( @NonNull List< String >  dnsAddrs)

Set IP addresses of the DNS servers to use Current value available from OnPrivacySettings.

Parameters
dnsAddrsip addresses of the DNS server to use
Since
7.4

◆ setDoNotStoreCredentials()

final void com.speedify.speedifysdk.SpeedifySDK.setDoNotStoreCredentials ( boolean  doNotStore)

Sets if credentials will not be stored.

This includes passwords, OAuth tokens, and Safe Browsing init config. Triggers OnPrivacySettings. If true, automatic login and connect at boot will not work.

Parameters
doNotStoreIf credentials will not be stored
Since
10.5

◆ setDownstreamSubnets()

final void com.speedify.speedifysdk.SpeedifySDK.setDownstreamSubnets ( @NonNull List< Subnet subnets)

Set the downstream subnets available on this device.

Current value available from OnSettings.

Parameters
subnetsthe downstream subnets available on this device
Since
14.0

◆ setEnableDefaultRoute()

final void com.speedify.speedifysdk.SpeedifySDK.setEnableDefaultRoute ( boolean  enable)

Set whether the default route (0.0.0.0/0) goes over the VPN tunnel.

If connected, this triggers a reconnect. Current value available from OnSettings.

Parameters
enableif default route is added to the interface
Since
9.4

◆ setESNIEnabled()

final void com.speedify.speedifysdk.SpeedifySDK.setESNIEnabled ( boolean  enableEsni)

Sets if ESNI is used when talking to the directory domain If using your own directory server, this must be called before login or loginAutoAccount.

Triggers OnDirectorySettings, and (if logged in) OnDirectory on domain change.

Parameters
enableEsniis ESNI is used to talk to the directory
Since
10.4
Deprecated:
as of 14.3.2

◆ setExcludeDefaultPrivateIPRanges()

final void com.speedify.speedifysdk.SpeedifySDK.setExcludeDefaultPrivateIPRanges ( boolean  exclude)

Set whether the default private IP ranges are excluded from going over the VPN tunnel.

This range includes: 224.0.0.0/4, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 Current value available from OnSettings.

Parameters
excludeif default private IP ranges are excluded
Since
8.0.2

◆ setExcludedIPRanges()

final void com.speedify.speedifysdk.SpeedifySDK.setExcludedIPRanges ( @NonNull List< IPRange excludedRanges)

Set IP address ranges to exclude from going over the VPN tunnel.

If connected, this triggers a reconnect. This only has effect if enableDefaultRoute is true. Current value available from OnSettings. The following ranges are automatically excluded: 224.0.0.0/4, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16

Parameters
excludedRangesip ranges to exclude from the tunnel
Since
5.8

◆ setFirewallDomains()

final void com.speedify.speedifysdk.SpeedifySDK.setFirewallDomains ( @NonNull List< String >  domains)

Set domains to firewall.

Parameters
domainsdomain names to deny/allow Triggers OnFirewallSettings.
Since
9.2

◆ setFirewallIPv4()

final void com.speedify.speedifysdk.SpeedifySDK.setFirewallIPv4 ( @NonNull List< String >  ipv4)

Set IPv4 address to firewall.

Parameters
ipv4ipv4 addresses to deny/allow Triggers OnFirewallSettings.
Since
9.2

◆ setFirewallIPv6()

final void com.speedify.speedifysdk.SpeedifySDK.setFirewallIPv6 ( @NonNull List< String >  ipv6)

Set IPv6 address to firewall.

Parameters
ipv6ipv6 addresses to deny/allow Triggers OnFirewallSettings.
Since
9.3

◆ setFirewallMode()

final void com.speedify.speedifysdk.SpeedifySDK.setFirewallMode ( FirewallMode  mode)

Set the mode used by the firewall.

Parameters
modehow matches are treated Triggers OnFirewallSettings.
Since
9.2

◆ setFirewallPorts()

final void com.speedify.speedifysdk.SpeedifySDK.setFirewallPorts ( @NonNull List< FirewallPort ports)

Set ports to firewall.

Triggers OnFirewallSettings.

Parameters
portsports to be firewalled
Since
9.2

◆ setForwardPorts()

final void com.speedify.speedifysdk.SpeedifySDK.setForwardPorts ( @NonNull List< ForwardedPort ports)

Set ports to be forwarded to this client when connected to a dedicated server.

Current value available from OnSettings.

Parameters
portsports to be forwarded
Since
8.2

◆ setHandler()

final void com.speedify.speedifysdk.SpeedifySDK.setHandler ( @Nullable ISpeedifyHandler  newHandler)

Sets the main handler for event callbacks.

Parameters
newHandlerevent callback handler
Since
5.6

◆ setHeaderCompression()

final void com.speedify.speedifysdk.SpeedifySDK.setHeaderCompression ( boolean  enable)

Sets whether to allow header compression of packets over the VPN tunnel.

Current value available from OnSettings.

Parameters
enableallow header compression
Since
10.6

◆ setIPLeakProtection()

final void com.speedify.speedifysdk.SpeedifySDK.setIPLeakProtection ( boolean  enabled)

Sets if IP Leak protection is enabled.

When disabled, allows other apps to bind their sockets around the VPN tunnel, directly on other network adapters. This also allows apps to receive multicast. Current value available from OnPrivacySettings.

Parameters
enabledIf IP leak protection is enabled
Since
since 11.9.2

◆ setJumboPackets()

final void com.speedify.speedifysdk.SpeedifySDK.setJumboPackets ( boolean  useJumbo)

Sets whether to allow jumbo packets over the VPN tunnel.

Current value available from OnSettings.

Parameters
useJumboallow jumbo packets
Since
5.8

◆ setKillswitch()

final void com.speedify.speedifysdk.SpeedifySDK.setKillswitch ( boolean  enabled)

Sets if Internet Killswitch should be enabled.

When enabled, Internet connectivity is disabled if Speedify is not connected. Triggers OnPrivacySettings.

Parameters
enabledIf killswitch is enabled
Since
9.4

◆ setLanguage()

final void com.speedify.speedifysdk.SpeedifySDK.setLanguage ( @NonNull String  language)

Set the language used for error messages Triggers OnSettings.

Supported languages include 'en', 'ar, 'de', 'es', 'fr', 'pt', 'ro', 'ru', 'tr', 'zh', 'ja', 'it', 'ko', 'pl', 'uk', 'sv', 'nb'.

Parameters
language2-character ISO language code used for error messages, ie: 'en'
Since
10.8

◆ setLocalProxyDomains()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyDomains ( @NonNull List< String >  domains)

Set domains to proxy locally, instead of going through the VPN.

Parameters
domainsdomain names to redirect through the local proxy Triggers OnLocalProxySettings.
Since
9.2

◆ setLocalProxyDomainWatchlist()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyDomainWatchlist ( @NonNull List< LocalProxyDomainWatchlistItem domainWatchlist)

Set domain watchlist settings for the local proxy If connected, this triggers a reconnect.

Triggers OnLocalProxySettings.

Parameters
domainWatchlistdomain watchlist items
Since
9.3

◆ setLocalProxyDomainWatchlistEnable()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyDomainWatchlistEnable ( @NonNull String  title,
boolean  enabled 
)

Toggle a single domain watchlist item from being enabled over the local proxy.

Parameters
titlewatchlist item title
enabledif this watchlist item's domains should be included in the local proxy filter Triggers OnLocalProxySettings.
Since
9.3

◆ setLocalProxyEnabled()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyEnabled ( boolean  enabled)

Enables or disables the local proxy.

Parameters
enabledenable the local proxy Triggers OnLocalProxySettings.
Since
9.2

◆ setLocalProxyGlobalDomainWatchlistEnable()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyGlobalDomainWatchlistEnable ( boolean  watchlistEnabled)

Sets if settings in the local proxy domain watchlist entries are applied.

Parameters
watchlistEnabledif the domain watchlist is enabled Triggers OnLocalProxySettings.
Since
13.2

◆ setLocalProxyIPv4()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyIPv4 ( @NonNull List< String >  ipv4)

Set IPv4 address to proxy locally, instead of going through the VPN.

Parameters
ipv4ipv4 addresses to redirect through the local proxy Triggers OnLocalProxySettings.
Since
9.2

◆ setLocalProxyIPv6()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyIPv6 ( @NonNull List< String >  ipv6)

Set IPv6 address to proxy locally, instead of going through the VPN.

Parameters
ipv6ipv6 addresses to redirect through the local proxy Triggers OnLocalProxySettings.
Since
11.2

◆ setLocalProxyMatchMode()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyMatchMode ( ProxyMatchMode  matchMode)

Set the match mode used by the local proxy.

Parameters
matchModehow matches are treated Triggers OnLocalProxySettings.
Since
9.2

◆ setLocalProxyPackages()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyPackages ( @NonNull List< String >  packages)

Set packages route around the vpn, instead of going through the VPN.

If connected, this triggers a reconnect. Note that packages are routed around the VPN at the OS level, wherever other proxy options are routed through Speedify's internal local proxy. If the local proxy match mode is DENYLIST, then these package are the only packages allowed through the VPN.

Parameters
packagespackage names to redirect around the VPN. Triggers OnLocalProxySettings.
Since
11.1

◆ setLocalProxyPorts()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalProxyPorts ( @NonNull List< LocalProxyPort ports)

Set ports to proxy.

Triggers OnLocalProxySettings.

Parameters
portsports to be proxied
Since
9.9

◆ setLocalVendorSettings()

final void com.speedify.speedifysdk.SpeedifySDK.setLocalVendorSettings ( @NonNull JSONObject  settings,
boolean  merge 
)

Set local vendor settings Current value available from OnLocalVendorSettings.

Parameters
settingsa json object
mergeif true, settingsJson is merged in to existing local vendor settings. if false, settingsJson replaces existing local vendor settings
Since
9.2

◆ setMaximumConnectRetry()

final void com.speedify.speedifysdk.SpeedifySDK.setMaximumConnectRetry ( int  timeout)

Speedify follows a backoff pattern for repeated errors when logging in or connecting to VPN servers.

With each subsequent failure, the wait time increases before attempting to login or connect again. The backoff's timeout limit can be set with this call.

Parameters
timeoutTimeout in seconds
Since
14.6

◆ setMaximumTransportRetry()

final void com.speedify.speedifysdk.SpeedifySDK.setMaximumTransportRetry ( int  timeout)

When Speedify fails to establish VPN transport connections over an Internet connection, it will use a backoff pattern to wait before attempting to establish a transport over that connection again.

This call is used to set that backoff timeout limit.

Parameters
timeoutTimeout in seconds
Since
14.6

◆ setMode()

final void com.speedify.speedifysdk.SpeedifySDK.setMode ( BondingMode  mode)

Change the basic mode of operation, between optimizing for speed or maximizing reliability.

Current value available from OnSettings.

Parameters
modedesired mode
Since
5.6

◆ setNetworkSharingClientEnabled()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingClientEnabled ( boolean  enabled)

Sets whether network sharing client will be active.

Parameters
enabledallow network sharing client Triggers OnNetworkSharingSettings.
Since
14.0

◆ setNetworkSharingDisplayName()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingDisplayName ( String  displayName)

Sets the display name of this device.

Parameters
displayNamedisplayName Triggers OnNetworkSharingSettings.
Since
14.0

◆ setNetworkSharingHostEnabled()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingHostEnabled ( boolean  enabled)

Sets whether network sharing host will be active.

Parameters
enabledallow network sharing host Triggers OnNetworkSharingSettings.
Since
14.0

◆ setNetworkSharingPairRequestBehavior()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingPairRequestBehavior ( NetworkSharing.PairRequestBehavior  behavior)

Sets the behavior of pair requests from peers.

Parameters
behaviorhow peer pair requests should be handled Triggers OnNetworkSharingSettings.
Since
14.0

◆ setNetworkSharingPeerAllowAsClient()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingPeerAllowAsClient ( NetworkSharing.PeerUuid  peerUuid,
boolean  allowed 
)

Sets whether or not the peer at the given UUID may be treated as a client, i.e.

whether this device may share data with the client device at the given UUID.

Parameters
peerUuidThe UUID of the device to set the peer-client setting for.
allowedWhether to enable or disable the peer-client capability. Triggers OnNetworkSharesAvailable.
Since
14.0

◆ setNetworkSharingPeerAllowAsHost()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingPeerAllowAsHost ( NetworkSharing.PeerUuid  peerUuid,
boolean  allowed 
)

Sets whether or not the peer at the given UUID may be treated as a host, i.e.

whether this device may receive data from the host device at the given UUID.

Parameters
peerUuidThe UUID of the device to set the peer-host setting for.
allowedWhether to enable or disable the peer-host capability. Triggers OnNetworkSharesAvailable.
Since
14.0

◆ setNetworkSharingPeerAutoReconnect()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingPeerAutoReconnect ( NetworkSharing.PeerUuid  peerUuid,
boolean  allowed 
)

Sets whether this device should automatically reconnect on discovery to a known network share.

Parameters
peerUuidThe UUID of the device to set the auto-reconnect setting for.
allowedWhether to enable or disable auto-reconnect. Triggers OnNetworkSharesAvailable.
Since
14.0

◆ setNetworkSharingSameUserAutoPair()

final void com.speedify.speedifysdk.SpeedifySDK.setNetworkSharingSameUserAutoPair ( boolean  allow)

Sets if devices from the same user are automatically paired.

Parameters
allowwhether to allow auto pairing Triggers OnNetworkSharingSettings.
Since
14.2

◆ setNeverExitOnSwipe()

final void com.speedify.speedifysdk.SpeedifySDK.setNeverExitOnSwipe ( boolean  neverExitOnSwipe)

Setting this disables all disconnect/exit on swipe logic.

Your app will be responsible for calling ForceExit to close the daemon and foreground notification when you want to exit.

Parameters
neverExitOnSwipeif all swipe logic should be ignored
Since
10.7

◆ setNonVPNApplications()

final void com.speedify.speedifysdk.SpeedifySDK.setNonVPNApplications ( @NonNull List< String >  nonVpnApps)

Set applications that should not go over the VPN.

This change takes effect on the next VPN connect. Packages in this list are always routed around the VPN at the OS level, regardless of local proxy settings. Current value available from OnNonVPNApplications via refreshNonVPNApplications.

Parameters
nonVpnAppslist of package ids
Since
7.6.1

◆ setOverflowThreshold()

final void com.speedify.speedifysdk.SpeedifySDK.setOverflowThreshold ( double  mbpsOverflow)

Set the overflow threshold.

Current value available from OnSettings.

Parameters
mbpsOverflowoverflow threshold, in megabits per second
Since
5.6

◆ setPriorityOverflowThreshold()

final void com.speedify.speedifysdk.SpeedifySDK.setPriorityOverflowThreshold ( double  mbpsOverflow)

Set the priority overflow threshold, which is used when there is active priority traffic (i.e.

real-time streams). Current value available from OnSettings.

Parameters
mbpsOverflowpriority overflow threshold, in megabits per second
Since
12.0

◆ setReportingEncryptionKey()

final void com.speedify.speedifysdk.SpeedifySDK.setReportingEncryptionKey ( @Nullable String  key128bit)

Set reporting encryption key.

Parameters
key128bitA 16 byte ascii encoded, 32byte hex encoded, or base64 encoded string used to encrypt sensitive reports, or null to use default.
Since
6.3

◆ setRequestToDisableDoH()

final void com.speedify.speedifysdk.SpeedifySDK.setRequestToDisableDoH ( boolean  disableDoH)

Requests that browsers do not use DNS over HTTPS.

DoH can interfere with domain-based local proxy, firewall, and streaming settings. Triggers OnPrivacySettings.

Parameters
disableDoHIf DoH is requested to be disabled
Since
12.2

◆ setStartupConnect()

final void com.speedify.speedifysdk.SpeedifySDK.setStartupConnect ( boolean  enabled)

Set if Speedify should autmatically connect when the daemon starts.

Register a StartupBroadcastReceiver to obtain on-boot functionality. Triggers OnSettings.

Parameters
enabledautomatically connect
Since
9.4

◆ setStreamingDomains()

final void com.speedify.speedifysdk.SpeedifySDK.setStreamingDomains ( @NonNull List< String >  domains)

Set domains to be identified as streams.

Triggers OnStreamingSettings.

Parameters
domainsdomain names to be identified as streams
Since
10.9

◆ setStreamingIPv4()

final void com.speedify.speedifysdk.SpeedifySDK.setStreamingIPv4 ( @NonNull List< String >  ipv4)

Set IPv4 address to identified as streams.

Triggers OnStreamingSettings.

Parameters
ipv4ipv4 addresses tobe identified as streams
Since
10.9

◆ setStreamingIPv6()

final void com.speedify.speedifysdk.SpeedifySDK.setStreamingIPv6 ( @NonNull List< String >  ipv6)

Set IPv6 address to identified as streams.

Triggers OnStreamingSettings.

Parameters
ipv6ipv6 addresses to be identified as streams
Since
10.9

◆ setStreamingPorts()

final void com.speedify.speedifysdk.SpeedifySDK.setStreamingPorts ( @NonNull List< StreamingPort ports)

Set ports to identified as streams.

Triggers OnStreamingSettings.

Parameters
portsports to be identified as streams
Since
10.9

◆ setTunnelEncrypted()

final void com.speedify.speedifysdk.SpeedifySDK.setTunnelEncrypted ( boolean  encrypted)

Sets encryption status on all connections forming the tunnels.

This is equivalent to calling setConnectionEncryption for all adapterIDs. Current value available from OnSettings.

Parameters
encryptedwhether to encrypt
Since
5.8

◆ setUlpReportIntervalSeconds()

final void com.speedify.speedifysdk.SpeedifySDK.setUlpReportIntervalSeconds ( long  interval)

Sets the ULP reporting inverval in seconds.

Parameters
intervalThe interval in seconds.
Since
12.8

◆ setVendorUserData()

final void com.speedify.speedifysdk.SpeedifySDK.setVendorUserData ( @Nullable String  vendorUserData)

Set vendor user data Current value available from OnVendorUserData.

Parameters
vendorUserDatauser data string
Since
9.8

◆ startNetworkSharingDiscovery()

final void com.speedify.speedifysdk.SpeedifySDK.startNetworkSharingDiscovery ( )

Manually start (or restart) a discovery session.

This lasts for 30 seconds. Triggers OnNetworkSharingDiscovery.

Since
14.0

◆ startSpeedTest()

final void com.speedify.speedifysdk.SpeedifySDK.startSpeedTest ( )

Starts a new speed test Triggers OnSpeedTestResults.

Since
11.0

◆ startStreamTest()

final void com.speedify.speedifysdk.SpeedifySDK.startStreamTest ( )

Starts a new speed test Triggers OnSpeedTestResults.

Since
11.5

◆ subscribeToEvent()

static void com.speedify.speedifysdk.SpeedifySDK.subscribeToEvent ( String  event)
static

internal use

Parameters
eventevent to subscribe to

◆ unpairNetworkSharingPeer()

final void com.speedify.speedifysdk.SpeedifySDK.unpairNetworkSharingPeer ( NetworkSharing.PeerUuid  peerUuid)

Unpair from a device at the given UUID.

Reports the current settings. If the device at uuid was a currently-connected peer, this call will also reports the now-unpaired peer's state change.

Parameters
peerUuidThe UUID of the device to unpair from. Triggers OnNetworkSharesAvailable.
Since
14.0

◆ unregisterSdkStateReceiver()

final void com.speedify.speedifysdk.SpeedifySDK.unregisterSdkStateReceiver ( @NonNull ISdkStateReceiver  handler)

Unregister a receiver for SpeedifySDK state changes.

Parameters
handlerthe receiver to register
Since
11.9.2
Deprecated:
as of 14.7. use sdkStateReceivers.unregister instead

◆ Version()

static final String com.speedify.speedifysdk.SpeedifySDK.Version ( )
static

SpeedifySDK version.

Returns
string of the version, ie: 5.6.0.0
Since
5.6

Member Data Documentation

◆ EnableSDKHandlerFromBackground

boolean com.speedify.speedifysdk.SpeedifySDK.EnableSDKHandlerFromBackground = false
static

Enables ISdkStateReceiver callbacks for to be used from the sdk background process (:vpnservice).

Must be called prior to initializing the SpeedifySDK object.

Since
11.1

◆ foregroundServiceReceivers

final MultiReceiverManager<IForegroundServiceStateReceiver> com.speedify.speedifysdk.SpeedifySDK.foregroundServiceReceivers = new MultiReceiverManager<IForegroundServiceStateReceiver>()

Registers a new foreground service event receiver.

Receivers are WeakReferenced, so you must keep a reference to the receiver.

Parameters
receiverthe receiver to register
Since
14.7

◆ sdkStateReceivers

final MultiReceiverManager<ISdkStateReceiver> com.speedify.speedifysdk.SpeedifySDK.sdkStateReceivers = new MultiReceiverManager<ISdkStateReceiver>()

Registers a new SDK state receiver Receivers are WeakReferenced, so you must keep a reference to the receiver.

Parameters
receiverthe receiver to register
Since
14.7

The documentation for this class was generated from the following file: