Google Android SDK

Try our SDK in your Android application

1. Integrate dependencies

To integrate our SDK into your application edit your build.gradle:

  • Add this block to the root section:

allprojects {
    repositories {
        //...
        maven {
            url "https://jitpack.io"
        }
    }
}
  • Add this block to the dependencies section:

implementation 'com.github.FendAiCorp.fendvpn-android:sdk:<VERSION>'

2. Configurate SDK

To start using the SDK, you need to create a WireSdk instance. Initialize FendSDK with a WireConfig:

val sdk = WireSdk.provide(
    WireConfig("backend url", "project id", "app version")
)

Value

Description

backend URL

Base URL for the API calls (login, fetching locations, etc.)

project id

A unique identifier of the project

app version

The application version for analytics purposes

For backend URL and project ID please contact partners@fend.ai

3. Use API

After SDK initialization you need to authenticate the user on the backend and acquire the list of available locations to connect.

3.1 Authentication

3.2 Available locations

4. Manage VPN

After getting a virtual location configuration, you are ready to start a VPN session.

4.1 Start / Stop

4.2 Statistics

An active VPN connection provides statistics on amount of traffic, connection start time, and the chosen VPN server IP.

4.3 State

The SDK can provide information on current VPN tunnel state.

Value

Description

VpnState.IDLE

No active VPN connection exists

VpnState.CONNECTING

Establishing a VPN connection right now

VpnState.CONNECTED

A VPN connection is established and active

VpnState.ERROR

A VPN connection process has failed

Last updated

Was this helpful?