> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/android/get-started/integration.md).

# Get started integrating Apryse Android SDK

Integrate a free trial of Apryse Android SDK into your Android Studio projects with ease. Follow this comprehensive guide for seamless integration using Gradle or .aar files. Get unlimited trial usage

Welcome to Apryse. This guide will help you integrate a free trial of Apryse Android SDK into your Android Studio projects. You can either integrate Apryse packages automatically using Gradle, or install them manually using .aar files by downloading the SDK. Pick whichever your option you prefer, but integrating with Gradle is the recommended approach. Your free trial includes unlimited trial usage and support from solution engineers.

{% tabs %}
{% tab title="Integrate with Gradle" %}

## Gradle Integration

## Prerequisites

* [Android Studio](https://developer.android.com/studio/)
* Project specifications:
  * Minimum API: 21 (using AndroidX)
  * Compile API: 35
  * Recommended target API: 35
  * If your app is using AndroidX you will also need to add `android.useAndroidX=true` and `android.enableJetifier=true` in your `gradle.properties` file. For more, check out our [FAQ about AndroidX](/android/get-started/faq/androidx.md).

{% hint style="info" %}
**No trial license key required.**

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please [contact sales](https://apryse.com/form/contact-sales) to purchase a commercial key or if you need any other license key assistance.
{% endhint %}

{% hint style="warning" %}
**Keep your license keys confidential.**

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
{% endhint %}

## Setup

Create a new project on Android Studio called `myApp`.

For the purposes of this guide, you can start with an `Empty Activity`.

## Integrate Apryse SDK into your Android application

1. Open the `settings.gradle` file located **in your project's root directory** and add the Apryse Maven repository:

{% code lineNumbers="true" %}

```groovy
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://pdftron-maven.s3.amazonaws.com/release"
        }
        jcenter() // Warning: this repository is going to shut down soon
    }
}
```

{% endcode %}

{% hint style="info" %}
Apryse SDK for Android is hosted on a private Maven repository in Amazon S3, so an access token is required to download it. The project **only communicates with Amazon S3 in order to download Apryse SDK for Android**. Otherwise, no other communication between your environment and Amazon S3 (or any other external service) is required. If you prefer not to use Amazon S3, you can find an [alternative approach here ](#manual-integration).
{% endhint %}

1. Open the `build.gradle` file in your **app module's directory**:Edit it to add a dependency for the full version of Apryse:

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-de976e195a6eedd3ef6d4d7c01ba38351331de65%2F46a8e0ad578cf1bea7a5c3abb31913e19787c013-410x501.png?alt=media)

{% code lineNumbers="true" %}

```groovy
android {
    defaultConfig {
        // ... Anything that was already here
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        manifestPlaceholders = [pdftronLicenseKey:PDFTRON_LICENSE_KEY]
    }
}

dependencies {
    // ... Anything that was already here
    implementation "com.pdftron:pdftron:11.0.0"
    implementation "com.pdftron:tools:11.0.0"

    implementation 'androidx.multidex:multidex:2.0.1'
}
```

{% endcode %}

{% hint style="info" %}
The next part of this guide will use DocumentActivity to open and view a document which requires the **full version** of Apryse SDK. The **standard version** has lighter set of features to reduce the size of the APK.You can find out more about the differences between the two versions [here ](/android/get-started/faq/full-vs-standard.md). If you would like to use the standard version instead, please take a look at this [guide](/android/get-started/faq/standard-version.md)
{% endhint %}

1. **In your project's root directory**, find the `gradle.properties` file. Copy the following line to it:

{% code lineNumbers="true" %}

```sh
# Add the PDFTRON_LICENSE_KEY variable here. 
# For trial purposes leave it blank.
# For production add a valid commercial license key.
PDFTRON_LICENSE_KEY=
```

{% endcode %}

1. Open your `AndroidManifest.xml` file and add a `<metadata>` tag inside the `<application>` tag to be a placeholder for the license key:

{% code lineNumbers="true" %}

```xml
<application>
<!-- Add license key in meta-data tag here. This should be inside the application tag. -->
    <meta-data android:name="pdftron_license_key" android:value="${pdftronLicenseKey}"/>
</application>
```

{% endcode %}

## Next step

<a href="/android/get-started/viewdoc.md" class="button primary">View a document</a>
{% endtab %}

{% tab title="Integrate Manually" %}

## Manual Integration

## Prerequisites

* [Android Studio](https://developer.android.com/studio/)
* Project specifications:
  * Minimum API: 21 (using AndroidX)
  * Compile API: 35
  * Recommended target API: 35
  * If your app is using AndroidX you will also need to add `android.useAndroidX=true` and `android.enableJetifier=true` in your `gradle.properties` file. For more, check out [adding Apryse using AndroidX](/android/get-started/faq/androidx.md).
* Apryse Android SDK

Download the SDK

[Download](https://pdftron.s3.amazonaws.com/downloads/PDFNetAndroid.zip)

{% hint style="info" %}
**No trial license key required.**

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please [contact sales](https://apryse.com/form/contact-sales) to purchase a commercial key or if you need any other license key assistance.
{% endhint %}

{% hint style="warning" %}
**Keep your license keys confidential.**

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
{% endhint %}

## Setup

1. Extract the folder from the .zip file.**This article will assume that the path into the extracted `PDFNetAndroid` library bundle is called PDFTRON\_BASE**

{% code lineNumbers="true" %}

```sh
PDFTRON_BASE=path/to/your/extraction/folder/PDFNetAndroid/
```

{% endcode %}

1. Create a new project on Android Studio called `myApp`. Find the path to the `app/libs` folder. If the `libs` folder does not exist, create one in the module (for example, `myApp/app/libs`)For the purposes of this guide, you can start with an `Empty Activity`.

## Integrate Apryse SDK into your Android application

1. Copy all of the following files into your `libs` directory:You can learn more at [Apryse Android viewer](/android/viewer/viewer-overview.md).Now, your `app/libs` folder should look like this:

* `PDFTRON_BASE/lib/full/pdftron.aar`
* `PDFTRON_BASE/lib/tools.aar`

{% code lineNumbers="true" %}

```sh
app
├── ...
└── libs
    ├── pdftron.aar
    └── tools.aar
```

{% endcode %}

1. Open the `build.gradle` file in your **app module's directory**:Edit it to include the following inside the `android.defaultConfig` section:Also edit the `dependencies section` and include:

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-de976e195a6eedd3ef6d4d7c01ba38351331de65%2F46a8e0ad578cf1bea7a5c3abb31913e19787c013-410x501.png?alt=media)

{% code lineNumbers="true" %}

```groovy
android {
    defaultConfig {
        // ... Anything else you already had
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        manifestPlaceholders = [pdftronLicenseKey:PDFTRON_LICENSE_KEY]
    }
}
```

{% endcode %}

{% code lineNumbers="true" %}

```groovy
dependencies {
    // ... Anything else you had here before

    implementation files('libs/pdftron.aar')
    implementation files('libs/tools.aar')

    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation "androidx.preference:preference:1.1.0"

    implementation "commons-io:commons-io:2.4"
    implementation "org.apache.commons:commons-lang3:3.18.0"
    implementation "com.google.code.gson:gson:2.8.0"
    implementation "io.reactivex.rxjava2:rxjava:2.2.2"
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
    implementation "com.github.clans:fab:1.6.4"
    implementation "androidx.exifinterface:exifinterface:1.3.3"
    implementation "com.squareup.picasso:picasso:2.71828"
    implementation "org.ccil.cowan.tagsoup:tagsoup:1.2.1"

    implementation 'androidx.multidex:multidex:2.0.1'
    implementation "androidx.room:room-runtime:2.4.2"
    annotationProcessor "androidx.room:room-compiler:2.4.2"
}
```

{% endcode %}

1. **In your project's root directory**, find the `gradle.properties` file. Copy the following line to it:

{% code lineNumbers="true" %}

```sh
# Add the PDFTRON_LICENSE_KEY variable here. 
# For trial purposes leave it blank.
# For production add a valid commercial license key.
PDFTRON_LICENSE_KEY=
```

{% endcode %}

1. Open your `AndroidManifest.xml` file and add a `<metadata>` tag inside the `<application>` tag to be a placeholder for the license key:

{% code lineNumbers="true" %}

```xml
<application>
<!-- Add license key in meta-data tag here. This should be inside the application tag. -->
    <meta-data android:name="pdftron_license_key" android:value="${pdftronLicenseKey}"/>
</application>
```

{% endcode %}

## SDK package overview

Download the SDK

[Download](https://pdftron.s3.amazonaws.com/downloads/PDFNetAndroid.zip)

Apryse for Android contains the following key files and folders:

| File/Folder Name | Description                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| docs             | Contains the Apryse Android API reference documentation                                                                                                                                                                                                                                                                                                                                                     |
| lib              | Contains the Apryse AAR libraries and the source files to the [open-source UI](/android/viewer/viewer-overview.md) - `/full`: Contains [full](/android/get-started/faq/full-vs-standard.md) version of **pdftron.aar** - `/standard`: Contains [standard](/android/get-started/faq/full-vs-standard.md) version of **pdftron.aar** - `/src`: Contains source code for **tools.aar**, **pdftron-collab.aar** |
| samples          | Contains the Java and Kotlin sample projects: [Showcase ](/android/samples/package-samples/sample-showcase.md), [CompleteReader ](/android/samples/package-samples/sample-complete-reader.md), and [MiscellaneousSamples](/android/samples/package-samples/run-sample.md#miscellaneoussamples-app)                                                                                                          |
| legal.txt        | Legal and copyright information                                                                                                                                                                                                                                                                                                                                                                             |
| license.pdf      | Apryse Software License agreement                                                                                                                                                                                                                                                                                                                                                                           |

## Next step

<a href="/android/get-started/viewdoc.md" class="button primary">View a document</a>
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/android/get-started/integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
