Getting Started
Requirements
-
PSPDFKit for Android with Instant
PSPDFKit and Instant are two separate Android libraries available in the same download. Download the latest release.
-
A PSPDFKit Server instance
See the Example Projects guide to get an instance up and running.
Quick Start With the Example Project
Instant comes with an example Android project named instant-example
, which connects to either of our example server apps.
- Run PSPDFKit Server locally using one of our Example Projects.
- Add a document to the server using the ‘Upload PDF’ button.
- Select the document to view it with PSPDFKit for Web.
- Import
example/instant
project into the Android Studio and run it. - Run
adb reverse tcp:5000 tcp:5000 && adb reverse tcp:3000 tcp:3000
to forward emulator/device ports to host ports. (5000 is port of PSPDFKit Server, 3000 is port of our web example). - Once the example app is running, you can use
http://localhost:3000
as a host name to access your local example server. - Tap the document in the app to download it and show it in activity.
- Add annotations in the app or in the browser to see annotation syncing.
Automated Integration Using Gradle
To add Instant to your project:
-
Also add specific dependencies to your
build.gradle
file, required for Instant:build.gradle 1 2 3
... implementation 'com.pspdfkit:pspdfkit-instant:5.2.0' implementation 'com.squareup.okhttp3:okhttp:3.11.0'
Manual Library File Integration
-
Integrate PSPDFKit following manual library file integration
-
Also add specific dependencies to your
build.gradle
file, required for Instant:build.gradle 1 2 3
... implementation 'com.pspdfkit:pspdfkit-instant:[email protected]' implementation 'com.squareup.okhttp3:okhttp:3.11.0'
Note that Gradle looks for either pspdfkit-instant.aar
or pspdfkit-instant<version>.aar
file, so inclusion will not work if you rename the aar file.
Proguard
There is no need to specify additional ProGuard rules since PSPDFKit uses consumersProguardFiles
to keep from obfuscating everything it requires. If you want to check, which rules are there, you should take a look into proguard.txt
located inside PSPDFKit aar
:
1 2 3 | cd [YOUR_AAR_LOCATION] unzip [YOUR_AAR_NAME].aar -d aar-contents cat aar-contents/proguard.txt |