# Application Setup

This document provides instructions for installing, updating, and uninstalling the SDK in an Android project.

## Installing the SDK

To install the SDK in your Android project, follow these steps:

1. Open your project's file, `build.gradle.kts (Module: app)` (kotlin) file, or `build.gradle (Module: app)` (groovy) file.

<figure><img src="https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-def126334cfe9e05baebed5c70a097401f9a1663%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Add the following line to the \`dependencies\` block:

For Kotlin (`build.gradle.kts`):

```
dependencies {
    implemmentation("co.pango:sdk:${VERSION_NAME}")
}
```

For Groovy (`build.gradle`):

```groovy
dependencies {
    implementation 'co.pango:sdk:' + VERSION_NAME
}
```

Replace `VERSION_NAME` with the desired version of the [SDK](https://pango.gitbook.io/paas/sdk/vpn-sdk-for-android).

3. 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\\

   <figure><img src="https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-a28736ff16867ac079f31c6a711d13b063e6184c%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Updating the SDK

To update the SDK to a newer version:

1. Open your project's `build.gradle` file. Open your project's `build.gradle.kts (Module :app)` (Kotlin) or `build.gradle (Module :app)` (Groovy) file.
2. Locate the line where the SDK dependency is declared.\\

   <figure><img src="https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-3bb21a087b9a31cf38e2c1f726957f7e10a211d3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Change the `{VERSION_NAME}` to the new SDK version you want to use. You can find the most recent version [here](https://pango.gitbook.io/paas/sdk/vpn-sdk-for-android).
4. Click on the Light Bulb icon that appears after entering the line of code. Then click `Sync Now`. It will take some time 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.\
   \\

   <figure><img src="https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-dcd4cdc35fc8e5f583756f7dc1af6efead2b810b%2Fimage%20(102)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

## Uninstalling the SDK

When the application is uninstalled from an Android device, the Android system automatically removes all SDK-related files and data. No additional action is required.

However, if you want to remove the SDK integration from your project:

1. Open your project's `build.gradle.kts (Module :app)` (Kotlin) or `build.gradle (Module :app)` (Groovy) file.
2. Remove the SDK dependency line from the \`dependencies\` block.\\

   <figure><img src="https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-7d9a1ec982fcd6b2eaf6ca129670a90a4e2739f8%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Delete the following files from the application cache directory:

* `rndseq`
* `sd_cur.data`
* `vpr_wnd_counter_scanned_connections`\
  \
  ![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-75dd68d3794525ca8916290972b823c3cecba21b%2Fimage.png?alt=media)\
  \
  Go to View -> Tool Windows -> Device Explorer:\
  \
  ![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-6e57970e97c04d3702e4f3ad8fddf8f5891d1247%2Fimage.png?alt=media)

Within Device File Explorer, expand the following path:\
\
`/data/data/[your.package.name]/cache/`

\
Replace `[your.package.name]` with your actual app package name.

<figure><img src="https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-9562f1f5f8182be10a16c205afc2141a630bc911%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-2441de15fae017d31da6c88b2c1288a0a9681327%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Delete the following files from the application databases directory:

* `key_value_store.db`
* `anchorfree-ucr.db`\
  \
  ![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-4808668ee696e0f14eecccc836349b337d2dca25%2Fimage.png?alt=media)

5. Rebuild your project.
