Managed UI Preview + Headless

Android Kotlin SDK

Use the Kotlin SDK for native Android CRM, support, marketplace, banking, or customer apps. It includes an Easy/Managed UI preview for fast installs and a Headless object model for custom screens while platform-specific transport details stay internal.

Use this page for app implementation

Android setup, Managed UI view, Headless object methods, microphone/camera permissions, FCM token registration, ringtone, 16 KB support, and video view injection belong in this guide.

Use Scalar for REST details

Open Scalar when you need exact endpoint fields, response schemas, auth schemes, status codes, or generated client details.

Open Scalar API Reference

Chat

Create conversations and messages from a native Android screen.

AI

Ask AI and prepare for streaming callbacks through SDK objects.

Calls

Create audio/video call sessions through a simple product API.

Token flow

Android apps call the customer backend for a short-lived runtime token. The customer backend stores the Ringnity Server API key and never ships it in the APK.

Package shape

Download the Kotlin source package from the SDK downloads page, then include it as a local Gradle project during pilot installs. CI builds it with Java 17 and Gradle wrapper. The package includes the core Kotlin SDK and Android UI module.

Easy / Managed UI preview

Use this when the Android app wants Ringnity to draw the support screen. The view includes Chat, AI, audio/video call controls, ringtone hooks, and optional video view injection.

import com.ringnity.sdk.Ringnity
import com.ringnity.sdk.RingnityConfig
import com.ringnity.sdk.RingnityCallMode
import com.ringnity.sdk.android.RingnityAndroidCallAdapter
import com.ringnity.sdk.android.RingnityAndroidManagedView

val callAdapter = RingnityAndroidCallAdapter(applicationContext)
val ringnity = Ringnity.create(
    RingnityConfig(
        tokenProvider = ::fetchRingnityToken,
        callMode = RingnityCallMode.BASIC,
        mediaAdapter = callAdapter,
        notificationAdapter = callAdapter,
        realtimeTransport = RingnitySocketIoRealtimeTransport()
    )
)

val supportView = RingnityAndroidManagedView(this)

// Optional: inject your own native video views.
supportView.setRemoteVideoView(remoteVideoView)
supportView.setLocalPreviewView(localPreviewView)

supportView.bind(
    ringnity = ringnity,
    conversationSubject = "Android customer support"
)

setContentView(supportView)

Modular native views

Use these when the Android app owns navigation and wants only one Ringnity surface on a screen.

val chatView = RingnityAndroidChatView(this)
chatView.bind(
    ringnity = ringnity,
    conversationSubject = "Android customer support"
)

val aiView = RingnityAndroidAiView(this)
aiView.bind(ringnity)

val callView = RingnityAndroidCallView(this)
callView.setRemoteVideoView(remoteVideoView)
callView.setLocalPreviewView(localPreviewView)
callView.bind(
    ringnity = ringnity,
    conversationSubject = "Android customer support"
)

Headless Kotlin object model

val callAdapter = RingnityAndroidCallAdapter(applicationContext)
val permissions = callAdapter.permissions(video = true)

if (!permissions.canStartVideo) {
    // Request microphone/camera permission with your Activity permission flow.
}

val ringnity = Ringnity.create(
    RingnityConfig(
        tokenProvider = {
            val token = customerBackend.fetchRuntimeToken()
            RingnityRuntimeToken(
                token = token.token,
                expiresIn = token.expiresIn
            )
        },
        callMode = RingnityCallMode.BASIC,
        mediaAdapter = callAdapter,
        notificationAdapter = callAdapter,
        notifications = RingnityNotificationPreferences(
            incomingCall = RingnityRingtoneOptions(
                soundName = "ringnity_default",
                vibrate = true
            )
        )
    )
)

val readiness = ringnity.account.readiness()

val conversation = ringnity.chat.createConversation(
    subject = "Need help"
)
val conversationId = conversation["conversationId"] as String

ringnity.devices.registerPushToken(
    platform = RingnityPushPlatform.ANDROID,
    provider = RingnityPushProvider.FCM,
    token = firebaseMessagingToken,
    audience = RingnityPushAudience.CUSTOMER,
    externalId = "customer-123",
    appId = "com.example.customer"
)

ringnity.chat.sendMessage(
    conversationId = conversationId,
    body = "Hi, I need help."
)

ringnity.chat.subscribe(
    conversationId = conversationId
).collect { conversation ->
    println(conversation["messages"])
}

ringnity.chat.subscribeEvents(
    conversationId = conversationId
).collect { event ->
    println("${event.type}: ${event.data}")
}

ringnity.calls.subscribeEvents().collect { event ->
    println("${event.type}: ${event.data}")
}

val call = ringnity.calls.startVideo(
    conversationId = conversationId
)
ringnity.notifications.previewRingtone()
ringnity.notifications.stopRingtone()
call.mute()
call.setVideoEnabled(false)
call.end()

val existingCall = ringnity.calls.getSession(
    callSessionId = "call-session-id"
)

Ringtone behavior

// Add Android asset: app/src/main/res/raw/ringnity_default.*

ringnity.notifications.previewRingtone()

ringnity.notifications.playIncomingRingtone()

// Stop when the customer answers, declines, or the call expires.
ringnity.notifications.stopRingtone()

Production readiness notes

The Android SDK includes generated OpenAPI operation wiring, device push token registration, a native call adapter, Socket.IO realtime chat and call lifecycle transport with polling fallback for chat, Managed UI preview, modular native Chat/AI/Call views, headless call session lookup, and Maven local publishing validation. Production readiness work continues through device QA, optional Android Telecom integration, and token exchange smoke testing.

Open API Reference

Turn Your Website Into a Real-Time Call Center

Let customers call your team directly from your website, no phone numbers and no apps required. Just add one <script>.