Speedify SDK for Android  15.0.0
Initializing the SDK

Implementing AutoConstruct

In your Application class, implement SpeedifySDK.AutoConstruct:

// Implement SpeedifySDK.AutoConstruct
public class MyApplication extends Application implements SpeedifySDK.AutoConstruct {
// ...
@Override
public SpeedifySDK getSpeedifySDK(Context context) {
// instantiate a new SDK object
return new SpeedifySDK(context, "My App Title", new SpeedifyHandler() {
// override wanted methods here
});
}
// ...
}

Starting the Speedify SDK

Before you use the Speedify SDK in your app, you must initialize VPN permission.

// check for vpn permission, and request it if needed
if (!SpeedifySDK.hasVPNPermission(this)) {
SpeedifySDK.initializeVPNPermission(this);
}

When you want to start the Speedify SDK, call this to get an instance of the SDK.

SpeedifySDK sdk = SpeedifySDK.getInstance(context);

Optional: Application onCreate

The Speedify SDK starts up a background process to run the VPN. If you initialize other components in your Application's onCreate, you may need to return early to avoid initializing them in this process as well.

@Override
public void onCreate() {
super.onCreate();
// ... common initialization ...
if (SpeedifySDK.IsBackgroundProcess(this)) return;
// ... other initialization that you only want to run in your app's UI process ...
}

Optional: Handlers

If you do not specify a custom SpeedifyHandler in getSpeedifySDK, you can call setHandler on your SpeedifySDK object to set one later. Note that some callbacks on the ISpeedifyHandler happen in Speedify SDK's background process. If you want to implement these, use the SpeedifySDK.AutoConstruct method above.

Optional: SDK Cleanup

To close down the SDK entirely without exiting your application, call SpeedifySDK.ForceExit(context). To restart the SDK, you must either obtain a new SpeedifySDK object or call restartServices on your old SpeedifySDK object.