<img src="https://img.shields.io/badge/%20Android-V3-yellow?logo=android" style="float:left"/><br />

To add a player to your app, you must import the JWP SDK for Android and then configure your project. You can download the Android SDK using either the Gradle or Local approaches listed below.

ApproachNotes
[**Gradle**](🔗)  <strong>(Recommended)</strong>• No SDK download is required.<br />• Core and optional modules must be added to your app. <br />• ProGuard automatically applied. ProGuard protects the SDK classes.<br />• An existing app is required.
[**Local**](🔗)• JWP SDK for Android must be downloaded and unzipped.<br />• Core and optional modules must be imported.<br />• ProGuard must be configured. ProGuard protects the SDK classes.<br />• An existing app is required.

If you have any problems completing any of these tasks and have a valid JWP license, please [log a support ticket](🔗) for assistance.

<br />



You can also refer to our <a href="https://github.com/jwplayer/jwplayer-sdk-android-demo" target="_blank">JWP SDK for Android Open Source Demo</a>. The open-source demo is a basic demonstration app that allows you to experiment with the SDK. All modules are included. ProGuard automatically applied. <br /><br />

  1. Open Android Studio, click **Check out project from Version Control**, and select **Git**. The **Clone Repository** popup window appears.

  2. Fill out the **Clone Repository** popup window: <br />   • Enter `https://github.com/jwplayer/jwplayer-sdk-android-demo` for the **URL**.<br />   • Enter a **Directory** into which the repository should be cloned.

  3. Click **Clone**.

  4. Follow the Android Studio prompts to open the demo app.

  5. In the **AndroidManifest.xml** file assign your JWP license key to `android:value`.

<br /> <hr />

## Gradle

### Import the SDK into your project with Gradle

  1. From within Android Studio, open your app.

  2. In the _project_ **build.gradle **file, add the JWP Maven repository: `https://mvn.jwplayer.com/content/repositories/releases/`.



<br />

  1. In the _app_ **build.gradle** file, add the JWP and Android dependencies. When prompted by Android Studio, update the dependency versions.



<br />

  1. Also in the _app_ **build.gradle** file, configure `compileOptions` to support Java 8 language support and set `multiDexEnabled true` if your project is configured to `minSdkVersion 21`. If your `minSdkVersion` is less than 21, follow Google's instructions to add <a href="https://developer.android.com/studio/build/multidex#mdex-pre-l" target="_blank">Multidex support prior to Android 5.0</a>.



<br />

  1. In the **gradle.properties** file, set `android.useAndroidX` and `android.enableJetifier` to `true`. These plugin files <a href="https://developer.android.com/jetpack/androidx#using_androidx_libraries_in_your_project" target="_blank">enable you to use `androidx`-namespaced libraries in your project</a>. <br /><br />_If you are using a current version of Android Studio, the **gradle.properties** file should already contain these settings._


  1. Sync Gradle.

<br />

You have imported the JWP SDK for Android into your project. You can now [configure the manifest file](🔗). If necessary, you can also [configure ProGuard](🔗).

<br /> <hr />

## Local

### Download the Android SDK .zip file

  1. From your <a href="https://dashboard.jwplayer.com/#/players/downloads" target="_blank">Player Downloads & Keys</a> page, scroll down to the **Downloads** section. <br /><br />If you have more than one property in your account, select the property from the dropdown menu at the top of the page. Each property has a unique set of license keys.<br /><br />

  2. In the **Downloads** section, select a **VERSION** of the Android SDK from the dropdown menu.

  3. Click the icon in the **DOWNLOAD** column.

  4. On your computer, unzip the SDK .zip file.

<br />

### Add the SDK dependencies

  1. From within Android Studio, open your app.

  2. Click **File > New > New Module... > Import .JAR / .AAR Package**.

  3. Click **Next**.

  4. Select **jwplayer-core-x.x.x.aar** from your computer.

  5. Click **Finish**.

  6. Repeat the previous steps and add **jwplayer-common-x.x.x.aar**.

  7. Click **File > Project Structure... > Dependencies**. Under **Modules**, be sure that your app is selected.

  8. Click the plus sign in the main panel.

  9. Select **Module dependency**.

  10. Select **jwplayer-core-x.x.x** and **jwplayer-common-x.x.x**.

  11. Click **OK**.

  12. Click **Apply**.

  13. Click **OK**.

<br />

### Complete app and project configurations

  1. In the _app_ **build.gradle** file, add the JWP and Android dependencies. When prompted by Android Studio, update the dependency versions.



<br />

  1. Also in the _app_ **build.gradle** file, configure `compileOptions` to support Java 8 language support and set `multiDexEnabled true` if your project is configured to `minSdkVersion 21`. If your `minSdkVersion` is less than 21, follow Google's instructions to add <a href="https://developer.android.com/studio/build/multidex#mdex-pre-l" target="_blank">Multidex support prior to Android 5.0</a>.



<br />

  1. In the **gradle.properties** file, set `android.useAndroidX` and `android.enableJetifier` to `true`. These plugin files <a href="https://developer.android.com/jetpack/androidx#using_androidx_libraries_in_your_project" target="_blank">enable you to use `androidx`-namespaced libraries in your project</a>. <br /><br />_If you are using a current version of Android Studio, the **gradle.properties** file should already contain these settings._


  1. Sync Gradle.

<br />

You have imported the JWP SDK for Android into your project. You can now [configure the manifest file](🔗). If necessary, you can also [configure ProGuard](🔗).

<br />