> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beyondwords.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Android SDK

The BeyondWords Android SDK allows you to embed the BeyondWords player directly into your Android applications.

The SDK uses the BeyondWords web player under the hood and provides a native Kotlin interface for interacting with the underlying JavaScript API. As a result, most player functionality and properties are shared across the Android SDK and web player.

You can compare supported properties in the [player properties reference](/docs-and-guides/distribution/player/developer-guides/player-properties).

Before you begin, make sure you have created a project and generated some content.

## Installation

### Add the JitPack repository

Add the JitPack repository to your root `build.gradle` file:

```groovy theme={null}
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
```

### Add the dependency

Add the SDK dependency to your app `build.gradle` file:

```groovy theme={null}
dependencies {
    implementation 'com.github.beyondwords-io:player-android:+'
}
```

## Load content

### Add PlayerView to your view hierarchy

You can either add `PlayerView` to your layout XML:

```xml theme={null}
<io.beyondwords.player.PlayerView
    android:id="@+id/player_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
```

Or add it programmatically:

```kotlin theme={null}
val playerView = PlayerView(context)
playerViewParent.addView(playerView)
```

### Load content into the player

```kotlin theme={null}
playerView.load(PlayerSettings(
    projectId = YOUR_PROJECT_ID,
    contentId = YOUR_CONTENT_ID
))
```

Replace `YOUR_PROJECT_ID` with your numeric project ID and `YOUR_CONTENT_ID` with your content ID.

Once your app is running, the player will automatically load the specified content.

<Note>
  Call `playerView.release()` after the PlayerView has been removed from the view hierarchy. No other methods should be called on the PlayerView after it has been released.
</Note>

## Configuration

The preferred way to configure the player is by going to **Distribution → Player → Settings** in your project dashboard.

However, you can override properties at the app level:

```kotlin theme={null}
playerView.load(PlayerSettings(
    projectId = YOUR_PROJECT_ID,
    contentId = YOUR_CONTENT_ID,
    playerStyle = "large",
    callToAction = "Listen to this recipe",
    backgroundColor = "yellow"
))
```

### Update properties after loading

You can also update properties after the player has loaded:

```kotlin theme={null}
playerView.setPlayerStyle("large")
playerView.setBackgroundColor("yellow")
playerView.setPlaybackRate(1.5F)
```

## Example app

The example app demonstrates core player functionality, including how to build a custom player UI. You can explore the source code on GitHub or download a precompiled version from the latest release.

<CardGroup cols={2}>
  <Card title="Example app" icon="mobile" href="https://github.com/beyondwords-io/player-android/tree/main/example" target="_blank">
    Explore the example application on GitHub.
  </Card>

  <Card title="Download example app" icon="download" href="https://github.com/beyondwords-io/player-android/releases" target="_blank">
    Download a precompiled version from the latest release.
  </Card>
</CardGroup>

## GitHub repository

<Card title="Android SDK repository" icon="android" href="https://github.com/beyondwords-io/player-android" target="_blank">
  View the source code, releases, and API documentation on GitHub.
</Card>
