Unified VPN SDK for Android

Supports Hydra, OpenVPN, Wireguard protocols

Current version: 5.0.10

General

The Android SDK is part of the Pango Partner SDK, providing client-side libraries and server-side applications for implementing custom VPN infrastructure.

The SDK software is not available to be downloaded as an executable directly here. Rather, in a later step, the SDK will be added as a dependency. When you build your app, the SDK will be downloaded as a set of libraries and modules, the same way as other dependencies.

Prerequisites

The following prerequisites are required to use the SDK:

  • Android 5.0 (API Level 21) and higher (API Level 29 or higher for OpenVPN)

  • An IDE for development. The pictures in the rest of the API documentation will be showing Android Studio which can be downloaded here.

Additionally, in order to be able to use the SDK, the following steps have to be done:

  • Sign in at pango-cloud.com.

  • Create a project and use a name for your project as a Public key. Private key is optional.

  • Use SDK where carrierId equals given Public Key and backend url equals default SDK url or url provided by Pango team.

Note that at this time, it is not possible for users to create their own accounts directly if they do not already have an account established with us. Please contact your sales representative to initiate account creation as part of the project and client onboarding process or contact us. We apologize for any inconvenience.

Supported Protocols

The Android SDK supports the following VPN protocols:

Supported Features

Feature
Description

The SDK supports overriding default backend API URLs by adding a new raw resource file named pango_default_urls.json to your project.

Allows you to override and customize parts of the VPN SDK's internal logic, such as the logger, OkHttp client, backend URL rotator, and notification builder.

Ability to defer VPN service initialization and enable it later using PackageManager API.

Supports OAuth authentication with a partner's OAuth server as the primary authentication method.

Allows configuring, starting, stopping, updating, and monitoring VPN sessions, and supports useful features like transport fallback, DNS/proxy rules, and permission handling.

Supports listing available VPN locations and countries, handling purchases and deletions, and retrieving information about the current user's remaining traffic and account details.

Supports automatically starting and stopping VPN sessions based on a configurable client network list (CNL).

Provides the ability to categorize domains, route traffic through a VPN, and perform specified actions like allowing, blocking or redirecting requests based on the category.

Configure domain-based and IP-based traffic rules to control DNS resolution and routing of traffic through Hydra VPN using the addDnsRule and addProxyRule methods.

Supports changing the DNS server used on the VPN node to resolve DNS requests.

Supports custom location profiles for VPN sessions.

Provides the ability to connect to a desired location through another location as a proxy.

Automatically select the best VPN server for your connection.

Supports adding OpenVPN transport to enable VPN connections over TCP.

Allows apps to enable fast and secure VPN connections on Android devices using the Wireguard protocol.

Automatically handles network reconnection when switching between networks.

Setting up a project in Android Studio

Configuring Android Studio

Step 1. After downloading Android Studio, select ‘New Project’

Step 2. Choose the template that is most appropriate for your application. This guide will follow the ‘Empty Activity’ template as seen in the corresponding picture.

Step 3. Create a name for your project

Step 4. Select the minimum SDK requirements for your project. Our SDK is compatible with API 21 (Lollipop”; Android 5.0) and newer. For the sake of this walkthrough, we will be selecting API 21.

Click ‘Finish’ after all your selections have been made

Step 5. The following screen will be a install screen. The installation is relatively quick. The associated picture to this step shows the screen after the install is complete.

Click ‘Finish’

Step 6. You will be taken to a page in Android Studio that looks like this

Step 7. You will be taken to a page within Android Studio that looks like this

Configuring the SDK Dependency

Add dependencies in build.gradle of your app module. Version name is available at the top of this document.

dependencies {
    implementation 'co.pango:sdk:{VERSION_NAME}'
}

Step 1. In the left hand menu select the tab build.gradle.kts (Module :app) which is nested under the Gradle Scripts folder.

Step 2. Once in the build.gradle.kts (Module :app) file, scroll down until you see the dependencies list at the bottom

Step 3. Insert the code snippet below into the dependency list. Be sure to include the most recent version of the SDK within that snippet which can be found at the top of this document.

implementation("co.pango:sdk:x.y.z")

Step 4. Click on the Light Bulb icon that appears after entering the line of code. Then click ‘Sync Now’.

It will take a minute or longer to sync. There will be a status bar at the top letting you know that it is syncing and it will also let you know when the sync is successful.

After the Sync is complete, you will receive this message at the bottom of the Android Studio screen:

Sample App

You can find source code of sample app with integrated sdk on GitHub.

Version Migration

For migration between versions, check this

Versioning convention

Android SDK versioning is in format MAJOR.MINOR.PATCH and should be associated with version in Jira. See conventioning rules.

The Android SDK provides API containing:

  • Classes and methods to authorize client users

  • Ability to connect to backend VPN service

Changelog

The SDK version history and changes are documented here.

Support

If you encounter any issues or have questions regarding integrating the SDK, please visit our Github.

Last updated

Was this helpful?