Getting Started

Requirements

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.

  1. Run PSPDFKit Server locally using one of our Example Projects.
  2. Add a document to the server using the ‘Upload PDF’ button.
  3. Select the document to view it with PSPDFKit for Web.
  4. Import example/instant project into the Android Studio and run it.
  5. 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).
  6. Once the example app is running, you can use http://localhost:3000 as a host name to access your local example server.
  7. Tap the document in the app to download it and show it in activity.
  8. Add annotations in the app or in the browser to see annotation syncing.

Automated Integration Using Gradle

To add Instant to your project:

  1. Integrate PSPDFKit

  2. Also add specific dependencies to your build.gradle file, required for Instant:

    build.gradle
    1
    2
    3
    
    ...
    compile "com.pspdfkit:pspdfkit-instant:5.0.1"
    compile "com.squareup.okhttp3:okhttp:3.8.0"
    

Manual Library File Integration

  1. Integrate PSPDFKit following manual library file integration

  2. Also add specific dependencies to your build.gradle file, required for Instant:

    build.gradle
    1
    2
    3
    
    ...
    compile 'com.pspdfkit:pspdfkit-instant:[email protected]'
    compile "com.squareup.okhttp3:okhttp:3.8.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