Integrating Real-Time Collaboration into Your Android Application
With PSPDFKit Instant, it’s easier than ever to add real-time collaboration features to your PSPDFKit-powered app, allowing your users to seamlessly share, edit, and annotate PDF documents across Android, iOS, and Web apps. This article will guide you through integrating Instant into your own apps.
Requirements
-
PSPDFKit for Android with Instant
PSPDFKit and Instant are two separate Android libraries available in the same download.
-
A Document Engine 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 Document Engine 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 the
example/instant
project into 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 the port of Document Engine, while3000
is the 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 the activity.
-
Add annotations in the app or in the browser to see annotation syncing.
Integrating into Your App
PSPDFKit Instant for Android is part of the PSPDFKit for Android library. To add Instant to your project:
-
Add the specific dependencies required for Instant to your
build.gradle
file:dependencies { implementation 'com.squareup.okhttp3:okhttp:4.2.1' }
Manual Library File Integration
-
Integrate PSPDFKit following the manual library file integration.
-
Add the specific dependencies required for Instant to your
build.gradle
file:dependencies { implementation 'com.squareup.okhttp3:okhttp:4.2.1' }