Key concepts:
- Device: A physical Android device or emulator running your app
- Worker: A worker created by the Uplink SDK inside your app (one app can create multiple workers)
- Session: An authenticated connection that pairs your worker with a JavaScript SDK client
Requirements
- Android API 21 (Android 5.0) or later
- Kotlin 2.1 or later
- Java 11 or later
Installation
The Android SDK is distributed as a Maven artifact.A fully public Maven distribution is coming soon. In the meantime, reach out to Uplink for access credentials and use the repository configuration below.
1
Add the Maven repository
In your root
settings.gradle.kts (or build.gradle.kts):2
Add the dependency
In your app module’s
build.gradle.kts:3
Declare the internet permission
In
AndroidManifest.xml:Quick example
Initialization
worker(context, group)
Creates a new Worker and mounts the SDK’s WebView into the provided ViewGroup.
context: An AndroidContext— typically yourActivitygroup: TheViewGroupthat will host the SDK’s web view
Worker ready to connect to a session
Obtaining a session
Your backend creates a session using the JavaScript SDK’suplink.session() and delivers the resulting session URL to the app. How you deliver it — a backend API response, an app link, a QR code — is up to you.
Connecting and accepting
worker.connect(session)
Connects the worker to an Uplink session.
session: The session URL provided by your backend
worker.accept()
Begins accepting commands from the JavaScript SDK client. accept() suspends until the worker closes, so launch it in a coroutine scope that matches your app’s lifecycle.
Cleanup
worker.close()
Closes the worker and releases its resources.
Complete example
A minimalActivity that starts an Uplink worker and tears it down on destroy:
Related
iOS SDK
Integrate Uplink into your iOS app
JavaScript SDK
Control your worker from server-side code
Sessions
How sessions are created and secured
Core concepts
Architecture overview