Initialization
To use the UnifiedSDK in your Android application, you must initialize it with your VPN backend URLs and carrier ID. You carrier ID is the unique project name that is assigned to your company when you access pango-cloud.com.
Initial SDK Setup
To initialize the UnifiedSDK in your Android application, use the following:
Java
Kotlin
In this example:
Use
addUrl()
to specify one or more URLs for your VPN backend API endpoints. You can calladdUrl()
multiple times to add additional URLs.Set your unique carrier ID by calling
carrierId()
with your carrier ID string.
Copy the code to the following:
Accessing the SDK Instance
After initializing the SDK, you can access the SDK instance from anywhere in your app code by using the following:
You must have already initialized the SDK with a
ClientInfo
object before callingUnifiedSdk.getInstance()
without any arguments. This method provides a convenience way to get the already-initialized SDK instance.Attempting to get the SDK instance before it has been initialized will result in an error. Always make sure to initialize the SDK following the steps in the "Initial SDK Setup" section before using
UnifiedSdk.getInstance()
to retrieve it.
Last updated