Pango Platform
HomeConsole
  • What is Pango Developer Platform
  • Getting started
    • Sign up on the Management Console
    • Create a new project
    • Switch projects
    • Change console settings
    • Edit your profile
    • Try out the demo app
    • Keep exploring
    • Deprecation and Sunset
  • Console details
    • Dashboard
      • General
      • Location loading
    • Users
      • User page
    • Active sessions
    • Network
      • Countries
      • Locations
      • Pools
        • Optimal location
        • Location rules
    • Settings
      • General
        • Project config description (JSON format)
          • Server selector (JSON format)
          • Request selector (JSON format)
      • Authentication methods
        • Auth Plugin requirements
      • VPN
        • General
        • VPN Bypass list
        • Client Networks
      • Member
    • Export Data
    • Log
  • SDK
    • Unified VPN SDK for Android
      • Setup
        • Application Setup
        • Proguard Rules, Notification, and Analytics Configurations
        • Backend URL Configuration
      • Usage
        • Initialization
        • VPN Interface
        • Backend interface
      • Features
        • Hydra Protocol
          • Location profile (Hydra only)
        • Custom sdk dependencies
        • Deferred VPN Service Initialization
        • Authentication
        • Client Network List (CNL)
        • OpenVPN transport
        • Wireguard Transport
        • Reconnection strategy
        • Single Protocol SDK
        • Killswitch
        • Domain route via VPN
        • Process route via VPN
        • Process Bypass
        • Domain Bypass
        • Traffic rules
        • VPN Node DNS Configuration
        • Multihop
          • Optimal Location
      • Exceptions
      • Version migration
      • Changelog
    • Unified VPN SDK for Apple
      • Setup
        • Application Setup
        • Network Extension Setup
          • Network Extension Setup for tvOS
        • Backend URL Configuration
      • Usage
        • Single Protocol SDK
        • Unified SDK
        • Logging
        • Decoding Encoded VPN SDK Logs
      • Features
        • Deferred VPN Service Initialization
        • Authentication
        • Wireguard Transport
        • Reconnection strategy
        • Killswitch
        • Domain Bypass
        • Multihop
          • Optimal Location
        • Client Network List (CNL)
        • Domain route via VPN
      • Changelog
      • API Reference
    • IPSEC VPN SDK for Apple
    • Unified VPN SDK for Windows
      • Setup
        • Backend URL Configuration
        • Service command line arguments
        • ARM Platform Support
      • Usage
        • CoreAPI
        • Events
        • Generating a Unique Device Identifier
        • Error processing
        • Pipe Messaging
      • Features
        • Traffic protection
          • Killswitch
          • Prevent IP Leaks
          • Block Local Networks
        • Other
          • Firewall
            • DNS Monitor
            • Process Bypass
            • Domain Bypass
            • Process route via VPN
            • Domain route via VPN
          • Throttling
          • Optimal Location
          • Common issues
        • Hydra Protocol
          • CustomDNS, UserDNS, MultiHop, VpnProfiles
        • OpenVPN Protocol
        • Wireguard Protocol
        • IPSec Protocol
      • Collecting Debug Logs
      • Changelog
    • Unified VPN SDK for Routers
      • SDK. Shared library.
      • Configuration Interface (CI)
        • Unix Domain Sockets CI
        • REST API CI
    • Unified VPN SDK Feature Comparison By Platform
    • Unified VPN SDK
      • Features
        • Personal Bridge
    • Tunnel Vision and Tunnel Crack Prevention
  • REST API
    • Partner API
  • Sample applications
    • Unified VPN SDK demo for Windows
    • Hydra VPN SDK demo for iOS
    • IPSEC VPN SDK demo for iOS
    • Unified VPN SDK demo for Android
    • Hydra VPN SDK demo for OpenWRT
    • OpenVPN configuration file
  • Resources
    • Use cases
      • Public VPN
      • Business VPN
        • Creating a Business VPN Project
        • Wi-Fi Security for Business
      • Application anti-blocking
    • How-to
      • Create a Firebase project for User Authentication
      • AWS CloudFront Distribution of the Platform URL
      • How can I get Shared Secret key from iTunes Connect for In-App Purchase
  • FAQ
    • General
      • VPN Platform Flow
      • What data is collected by the Platform?
      • What analytic data is collected by your SDK?
      • How the Platform restricts access to our data?
      • Why DNS Leak tests often indicate positive result?
      • Do we need to perform endpoint health checks?
      • How is the VPN exit node found?
      • How are streams re-marked if VPN is enabled/disabled on an active flow?
      • Is there a maximum number of supported devices?
      • Are both IPv4 and IPv6 supported?
      • What is the MTU of the tunnel?
      • Are any redundancy measures in terms of reliability provided?
      • Is there any load balancing?
      • Do you block broadcast and multicast to/from the VPN?
    • List of Open Source libs
Powered by GitBook
On this page
  • Prerequisites
  • Setup
  • Frequently Asked Questions
  • How can I configure the VPN SDK to exclude specific domains from using the VPN connection?
  • When connected to a VPN, the IP address you see in the app (current_server) is different from the IP address in the browser when checking public IP.
  • Documentation

Was this helpful?

  1. Sample applications

Unified VPN SDK demo for Android

This is a demo application for Android with basic usage of Unified VPN SDK.

PreviousIPSEC VPN SDK demo for iOSNextHydra VPN SDK demo for OpenWRT

Last updated 8 months ago

Was this helpful?

Prerequisites

The following prerequisites are required to use the SDK:

  • Android 21+

  • Latest version of Android Studio (recommended)

  • Java Development Kit (JDK) 17

Setup

  1. Clone app source code locally from .

  2. Launch and navigate to the folder containing the recently downloaded project from Github. Once the project is open, you need to sync the project with the Gradle files. To do this, follow these steps:

    1. Click on the File menu in the top menu bar. From the dropdown menu, select Sync Project with Gradle Files. Wait for the syncing process to complete. Android Studio will download any missing dependencies and build the project.

    2. Click on the Run menu in the top menu bar. From the dropdown menu, select Run 'app'. Wait for the process to complete. It should launch Android emulator and open the demo app.

  3. Sign in at .

  1. In Pango dashboard, create a project and use a name for your project as a Public key. Private key is optional.

5. Navigate to the Network tab from the navigation bar. Then, click on the Add location button.

6. In Pango dashboard, navigate to the dashboard and locate your project_id. Open the demo app in Android Studio and enter the project_id in the Carrier field.

Please note that while the application is titled "Hydra SDK Demo", it actually demonstrates the functionality of the Unified SDK.

7. You are ready to connect to the VPN. To initiate the VPN connection process in the demo app:

  • Click the "init" button. No visible change will occur, which is expected behavior.

  • Click the "LOGIN" button. The app should now display a "Logged in" message, indicating successful authentication.

  • Click the "Connect" button. The app will establish the VPN connection, and display a "Connected" message upon success.

  1. Your device is now connected to the VPN. To verify the connection:

  • Open the Chrome browser on your Android device.

  • Navigate to whatsmyip.com.

  • Observe that the IP address displayed is different from your device's actual IP address, confirming that traffic is being routed through the VPN.

  1. To terminate the VPN connection when finished, click the "DISCONNECT" button in the demo app. This will sever the connection and restore direct network access.

Frequently Asked Questions

How can I configure the VPN SDK to exclude specific domains from using the VPN connection?

The VPN SDK allows you to route network traffic through a VPN connection. By default, all internet traffic will use the VPN when the VPN is active. However, the SDK provides the ability to exclude specific domains from using the VPN connection.

In the example app, the domain ip.me is hardcoded to bypass the VPN and use the device's actual IP address. This is done to demonstrate how to configure the SDK to exclude certain domains from the VPN tunnel. The exclusion logic is implemented in the app's code, not the SDK itself. SDK users have the flexibility to specify any domains they wish to exclude from the VPN.

If you want ip.me to also use the VPN connection, simply comment out the line in the app code that excludes this domain. After relaunching the app, ip.me will then route its traffic through the VPN like all other domains.

protected void connectToVpn() {
...
    public void success(@NonNull Boolean aBoolean) {
    ...
        final ArrayList<String> domains = new ArrayList<>();
        // domains.add("example.com"); // Commented out the addition of "example.com" domain
        domains.add("ip.me"); // Added a new domain "example.com" instead
        UnifiedSdk.getInstance().getVpn().start(new SessionConfig.Builder()
            .withReason(TrackingConstants.GprReasons.M_UI)
    ...
...

When connected to a VPN, the IP address you see in the app (current_server) is different from the IP address in the browser when checking public IP.

This is due to the multi-layered infrastructure of the VPN. Here is a simplified overview of how the IP addresses work in a typical VPN setup:

(client) -> <connect IP> -> (VPN server) -> <out IP> -> (website)

  • The client (your device) connects to the VPN server using the server's connect IP address. This is the current_server IP that is visible to you.

  • The VPN server then sends your web requests out to the internet using a different IP address, known as the out IP.

  • When the requested website receives the web request, it sees the out IP of the VPN server, not the original IP of your client device.

In summary, the client sees the connect IP of the VPN server it is connected to, while the end website sees the out IP that the VPN server uses to relay the web requests. These two IP addresses are intentionally different in the VPN infrastructure.

Documentation

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 example.com. Please contact your sales representative to initiate account creation as part of the project and client onboarding process or . We apologize for any inconvenience.

For more detailed information, please refer to .

contact us
SDK documentation
this Github
Android Studio
pango-cloud.com