Integrate the Uplink native SDK into your Android app
The Uplink Android SDK embeds a worker inside your Android app, making the device controllable from server-side code written with the JavaScript SDK. Use it when you want Uplink automation to run inside your own branded app.
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
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):
Creates a new Worker and mounts the SDK’s WebView into the provided ViewGroup.
fun worker(context: Context, group: ViewGroup): Worker
Parameters:
context: An Android Context — typically your Activity
group: The ViewGroup that will host the SDK’s web view
Returns: A new Worker ready to connect to a session
val worker = worker(activity, container)
The ViewGroup you pass in must remain in the view hierarchy for the lifetime of the worker. Tearing down the containing Activity or Fragment will close the worker.
Your backend creates a session using the JavaScript SDK’s uplink.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.
val sessionUrl: String = // from your backend, deep link, or QR code
See Sessions for how sessions are created on the server side.
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.