Get started integrating Apryse Android SDK

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.

Gradle Integration

Prerequisites

  • Android Studio
  • Project specifications:
    • Minimum API: 16 (using AndroidX)
    • Compile API: 34
    • Recommended target API: 34
    • 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.

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 to purchase a commercial key or if you need any other license key assistance.

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).

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:

Groovy

1dependencyResolutionManagement {
2 repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
3 repositories {
4 google()
5 mavenCentral()
6 maven {
7 url "https://pdftron-maven.s3.amazonaws.com/release"
8 }
9 jcenter() // Warning: this repository is going to shut down soon
10 }
11}

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 .

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

Groovy

1android {
2 defaultConfig {
3 // ... Anything that was already here
4 multiDexEnabled true
5 vectorDrawables.useSupportLibrary = true
6 manifestPlaceholders = [pdftronLicenseKey:PDFTRON_LICENSE_KEY]
7 }
8}
9
10dependencies {
11 // ... Anything that was already here
12 implementation "com.pdftron:pdftron:11.0.0"
13 implementation "com.pdftron:tools:11.0.0"
14
15 implementation 'androidx.multidex:multidex:2.0.1'
16}

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 . If you would like to use the standard version instead, please take a look at this guide

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

sh

1# Add the PDFTRON_LICENSE_KEY variable here.
2# For trial purposes leave it blank.
3# For production add a valid commercial license key.
4PDFTRON_LICENSE_KEY=
  1. Open your AndroidManifest.xml file and add a <metadata> tag inside the <application> tag to be a placeholder for the license key:

XML

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

Next step

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales