# Unified VPN SDK demo for Android

For the latest quickstart guide, see [Quickstart](/paas/getting-started/quickstart.md).

[JitPack](https://jitpack.io/#AnchorFreePartner/hydra-sdk-android)

## 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 [this Github](https://github.com/AnchorFreePartner/hydrasdk-demo-android).
2. Launch [Android Studio](https://developer.android.com/studio) 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.

      <figure><img src="/files/huQ2SBfNEibBIqCTFSRi" alt=""><figcaption><p>Android Studio</p></figcaption></figure>
3. Sign in at [pango-cloud.com](https://www.pango-cloud.com) .

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>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 <a href="https://www.pango.co/contact-us/">contact us</a>. We apologize for any inconvenience.</p></div>
4. In Pango dashboard, create a project and use a name for your project as a Public key. Private key is optional.

   ![](/files/-MTdmSl9bInIFE0xvpS4)
5. Navigate to the `Network` tab from the navigation bar. Then, click on the `Add location` button.

   ![](/files/-M5NwGesc5UcsMQreoKA)
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.

   ![](https://lh7-us.googleusercontent.com/slFs9We3ZUU_7Rb16xdDsqKoXPtF8R9riWQf9VX64mewm0NN3TTwAFodfjz57WhBH4H8rqxngVPjg7zPDiNoiYVKSTULF_ShKnWQUGhubVvoQ03B2P_ufPlT1e8BFwpyU3mwJei7oyj_eycAg4sFTPY)

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Please note that while the application is titled "Hydra SDK Demo", it actually demonstrates the functionality of the Unified SDK.</p></div>
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.
8. 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.
9. 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.

## More Information

See [SDK documentation](/paas/sdk/vpn-sdk-for-android.md)

See [Troubleshooting](/paas/sdk/vpn-sdk-for-android/troubleshooting.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pango.gitbook.io/paas/sample-applications/anchorfree-hydra-vpn-sdk-demo-for-android.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
