---
title: "Android PDF SDK integration — Gradle setup guide | Nutrient"
canonical_url: "https://www.nutrient.io/sdk/android/getting-started/"
md_url: "https://www.nutrient.io/sdk/android/getting-started.md"
last_updated: "2026-07-21T16:50:14.865Z"
description: "Learn how to integrate Nutrient Android SDK into your Android application. Step-by-step guide for adding PDF viewing, editing, and annotation features."
---

# Android PDF SDK — Gradle integration guide

This guide helps you integrate Nutrient Android SDK into either a new or existing Android project, using Gradle or manual AAR integration. It also shows how to display a PDF using either [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html) or Jetpack Compose’s [`DocumentView`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.views/-document-view.html).

**Jump to example**

Prefer to jump straight to code? View the example repo on GitHub.

[Read more](https://github.com/PSPDFKit/pspdfkit-android-catalog.git)

**Test without installing**

Explore SDK capabilities through our interactive demos.

[Read more](https://www.nutrient.io/guides/android/demo.md)

## Creating or opening your project

If you already have an Android project, open it in Android Studio. Otherwise, create a new one by following the steps below.

**Steps:**

1. Open Android Studio, select **File** > **New** > **New Project**.

2. Choose the **Empty Views Activity** or **Empty Activity** (Jetpack Compose) template.

3. Set your app name (for example, Nutrient Demo), desired save location, language (for example, Kotlin), and minimum SDK (21+ recommended).

4. Click **Finish** to create the project.

## Adding Nutrient to your project

You can add the SDK using Gradle (recommended) or [manually using an AAR file](https://www.nutrient.io/guides/android/advanced-integration/manual-library-integration.md). The Gradle method is outlined below.

Nutrient is published to Maven Central, which is included by default in new Android Studio projects, so no custom repository configuration is required.

In your `app/build.gradle.kts` file, add the Nutrient dependency:

```kotlin

dependencies {
   implementation("io.nutrient:nutrient-android-sdk:11.6.1")
}

```

> **Migrating from the Nutrient Maven repository?** Earlier versions were distributed only from

our own Maven repository at `https://my.nutrient.io/maven` using the `io.nutrient:nutrient`
coordinate. That repository continues to work during the transition period, so existing
integrations don't need to change immediately. To move to Maven Central, remove the
`maven { url = uri("https://my.nutrient.io/maven") }` repository and change your dependency
from `io.nutrient:nutrient` to `io.nutrient:nutrient-android-sdk`. The OCR add-on
(`io.nutrient:nutrient-ocr`) is not yet on Maven Central, so keep the custom repository if you
use OCR.

## Configuring your build

Ensure the following configuration in `app/build.gradle.kts`. Note that `compileSdk` and `targetSdk` should be set to the latest available versions:

```kotlin

android {
    compileSdk = <latest>

    defaultConfig {
        applicationId = "com.example.app"
        minSdk = 23
        targetSdk = <latest>
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }

    kotlinOptions {
        jvmTarget = "17"
    }
}

```

> With `minSdk` set to `21`, your app is available on more than [99.4 percent](https://www.appbrain.com/stats/top-android-sdk-versions) of Android devices (as of June 2025).

## Displaying a PDF

You can display PDFs using either [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html) (classic view system) or [`DocumentView`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.views/-document-view.html) (Jetpack Compose).

### PdfActivity (Classic views)

**Steps:**

1. Copy a PDF file to `src/main/assets/my-document.pdf`.

2. Add [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html) to `AndroidManifest.xml`:

   ```xml

   <application>...

       <activity
           android:name="com.pspdfkit.ui.PdfActivity"
           android:windowSoftInputMode="adjustNothing" />
   </application>
   ```

3. Launch it in your `MainActivity.kt`:

   ```kotlin

   class MainActivity : AppCompatActivity() {
       override fun onCreate(savedInstanceState: Bundle?) {
           super.onCreate(savedInstanceState)
           setContentView(R.layout.activity_main)

           val uri = Uri.parse("file:///android_asset/my-document.pdf")
           val config = PdfActivityConfiguration.Builder(this).build()
           PdfActivity.showDocument(this, uri, config)
       }
   }
   ```

### DocumentView (Jetpack Compose)

**Steps:**

1. Ensure you’re using `AppCompatActivity` and a compatible Compose theme:

   ```xml...
           <activity
               android:name=".MainActivity"...
               android:theme="@style/Theme.AppCompat.NoActionBar">
           </activity>
   <application>
   ```

2. Launch [`DocumentView`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.views/-document-view.html) inside your Compose user interface (UI):

   ```kotlin

   class MainActivity : AppCompatActivity() {
       override fun onCreate(savedInstanceState: Bundle?) {
           super.onCreate(savedInstanceState)
           setContent {
               Surface {
                   val uri = Uri.parse("file:///android_asset/my-document.pdf")
                   DocumentView(
                       documentUri = uri,
                       modifier = Modifier.fillMaxSize()
                   )
               }
           }
       }
   }
   ```

> The assets folder is read-only. For writing capabilities, copy PDFs to a writable directory. For more information, refer to our guide on [opening PDFs from URLs](https://www.nutrient.io/guides/android/miscellaneous/document-downloads.md).

## Next steps

- [Customize PdfActivity](https://www.nutrient.io/guides/android/basics/using-activity.md) to match your UI

- Use [`PdfFragment`](https://www.nutrient.io/guides/android/basics/using-fragment/) for modular PDF display

- [Load PDFs from custom sources](https://www.nutrient.io/guides/android/features/data-providers.md)

- [Add collaboration with Instant](https://www.nutrient.io/guides/android/pspdfkit-instant/getting-started.md)

- [Add OCR support](https://www.nutrient.io/guides/android/ocr/getting-started.md)

- Use [`DocumentState`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.interactors/-document-state/index.html) with [`DocumentView`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.jetpack.compose.views/-document-view.html) for interaction hooks.