Android VPN Manager SDK

Kape Android VPN Manager SDK

Overview

The Android VPN Manager is a module offering VPN capabilities to Android clients. It handles everything related to connections, from the selection of an optimal server given a list of them, to the managing of the OS service, communication with our services, and VPN protocol dependencies.

In order to establish connections additional information is needed - connection token and location information - which can be retrieved via the Kape Client SDK and needs to be handed over to the VPN Manager.

Implementation responsibilities

Feature

3rd Party Client

Android VPN Manager

Kape Client SDK / kp_client_sdk

Setup / handle Android VPN Service

Connect VPN server

Disconnect from the VPN server

Maintain VPN connection

Reconnect on network change (or no network)

Reconnect on initial connection issue (reconnection algo.)

The client has to trigger a new connection attempt, if any initial attempt ended in failure.

Retrieval and fetching of VPN location/endpoints

The client has to implement integration between Kape Client SDK and Android VPN Manager.

Determine the “best” or fastest VPN location for the client

Optional, implemented by the client.

✅ Given multiple Lightway servers, the library will attempt to connect to all of them and choose the one with the fastest time-to-connect

Display the IP of the client when on a VPN

Implemented by the client. As lightway uses multiple outgoing IPs and the server switches seamlessly between them for different services only one of the outgoing IPs can be determined and displayed.

User Authorization

  • Integration with Kape Client API and client user base.

  • Integration between Kape Client SDK and Android VPN Manager (bridge for access token.)

✅ provides the access token

Connection Authentication

✅ via access token

Handle routing

Handle DNS

Protocol Logs

Min OS Support

API Level 21

API Level 21

Requirements

  • Git (latest)

  • Android Studio (latest)

  • Java 17

Usage

As a client of the package, our main points of interest are:

  • KapeVPNManagerAPI - It presents the clients with the public capabilities of the module, and it is considered the main entry point of the module.

  • KapeVPNManagerBuilder - It offers the client a way to build an instance of the module that conforms to the public interface KapeVPNManagerAPI. It is also, where we set all the required client dependencies of the module.

An example of how to build an instance of the module would be as follows:

val vpnManagerApi: KapeVPNManagerAPI = KapeVPNManagerBuilder() .setContext(this) .setClientCoroutineContext(Dispatchers.Main) .setDebugLoggingDependency(...) .setPermissionsDependency(...) .build()


Last updated