← All developer systems
Built and testedAndroid

Integrate ScreenSteer with Android

Connect the Kotlin device agent to LiveKit, publish MediaProjection capture, and expose only registered application actions.

The Kotlin/JVM protocol core and contract suite pass on Kotlin 2.0.

Download and install

Embed ScreenSteer in a native Kotlin app and pair the validated device agent with LiveKit and MediaProjection.

Requirements

  • Kotlin 2.0+
  • LiveKit Android SDK
  • MediaProjection screen sharing
Unzip and add :screensteer-client to your Gradle project
QUICKSTART

Start with explicit consent

Replace pk_dev_… with the Development key shown once when you create it in the console. Use the one-time pk_live_… key from the Production environment after paid activation.

SupportSession.kt
Kotlin
val client = ScreenSteerClient(ScreenSteerConfig(
  baseUrl = "https://screensteer.com",
  publishableKey = "pk_dev_…",
))

// Start only after your consent UI is approved.
val session = client.createSession(externalUserId = user.id)
// Connect LiveKit, publish MediaProjection, then start DeviceAgent.
STEP 1

Add the module and LiveKit

Add the downloaded screensteer-client module to the Gradle build and include the LiveKit Android SDK.

The ScreenSteer core has no Android framework dependency. The host app owns the LiveKit Room and MediaProjection lifecycle.

build.gradle.kts
Kotlin
dependencies {
  implementation(project(":screensteer-client"))
  implementation("io.livekit:livekit-android:2.+")
}
STEP 2

Create the attended session

After the user approves your view-consent UI, call createSession off the main thread. Connect LiveKit with the returned URL and device token, then begin MediaProjection screen sharing.

Implement ScreenSteerTransport over the connected room’s data events and publishData method.

STEP 3

Register actions and geometry

Register an ActionDefinition for each permitted operation. Report normalized view rectangles whenever layout, scroll position, or device orientation changes.

Hidden or disabled controls should be removed or disabled in the registry so the agent receives not_available.

STEP 4

Start DeviceAgent and handle consent

Start DeviceAgent only after the room, screen track, registry, and callbacks are ready.

Use onControlRequested to show a device-side approval sheet. Post the decision to ScreenSteer and update the local agent’s consent state.

What the device enforces

  • No raw input injection; only registered application handlers execute.
  • Session, expiry, sequence, controller lease, and layout revision checks.
  • Reliable commands receive acknowledgements.
  • The device controls screen capture, consent, quality changes, and teardown.

Smoke test

  1. 1Run the bundled Kotlin/JVM tests.
  2. 2Start a session only after the MediaProjection explanation and consent.
  3. 3Join from the console and confirm the expected screen-share track.
  4. 4Approve control and invoke a registered action.
  5. 5Rotate or scroll and verify old geometry fails closed.
  6. 6Revoke control and stop from the Android app.

Troubleshooting

The room connects but no video appears

Verify MediaProjection permission was granted and the screen-share track is published after room connection.

Actions return not_available

Confirm the action is enabled and updateRect ran after the latest layout pass.

Data commands never reach DeviceAgent

Check that the LiveKit Room events are mapped to ScreenSteerTransport with the original topic.