Android
The Voximplant Android SDK allows you to easily embed real-time voice and video communication, peer-to-peer and conference calling support into your native Android applications.
For your initial integration, we recommend using Android SDK v3, which features a modular architecture, improved flexibility, and a simplified integration flow.
API reference and migration
Platform requirements
- Minimum Kotlin version 2.0
- Minimum JDK 17
Add Voximplant libraries to your project
The Voximplant Android SDK is modular and uses a Bill of Materials (BOM) to simplify dependency management. By using the BOM, you only specify the SDK version once, and all other modules automatically use compatible versions.
Add the BOM and the modules your app needs to your module-level build file (build.gradle.kts or build.gradle). You can find the latest version and library sizes in the changelog.
android-sdk-core— Required for initialization, connection, and user authentication.android-sdk-calls— Required to support audio and video calling features.android-sdk-renderer-compose— Provides Jetpack Compose components and utilities to render video streams (like local or remote camera feeds) in a declarative Compose-based user interface.
The SDK requires Java 17 support. Configure it in your build file (build.gradle.kts):
Permissions
The Voximplant Android SDK automatically handles manifest declarations, but standard Android runtime permission requirements still apply depending on the features you implement.
Automatic Manifest Declarations
The SDK declares all required permissions in its internal manifest. When you build your application, Android’s build tools automatically merge these into your app’s final AndroidManifest.xml file. You do not need to manually add them:
android.permission.INTERNET— To connect to the Voximplant Cloud.android.permission.ACCESS_NETWORK_STATEand android.permission.CHANGE_NETWORK_STATE — To monitor network connectivity changes.android.permission.MODIFY_AUDIO_SETTINGS— To configure audio routing (speaker, earpiece, headset).android.permission.RECORD_AUDIO— To capture microphone input for voice and video calls.android.permission.CAMERA— To capture video for video calls.android.permission.BLUETOOTH— To support Bluetooth audio routing.android.permission.WRITE_EXTERNAL_STORAGE— To support logging/caching when troubleshooting.
Runtime Permissions
For security, sensitive permissions should be requested from the user at runtime before starting or accepting calls.
- Audio Calls: Request
Manifest.permission.RECORD_AUDIObefore initiating or answering a voice call. - Video Calls: Request both
Manifest.permission.RECORD_AUDIOandManifest.permission.CAMERAbefore starting or answering a video call.
You can request these permissions in your Activity or Fragment using standard Android APIs (such as the modern registerForActivityResult API with the ActivityResultContracts.RequestMultiplePermissions() contract).
Initialize the SDK
Before using any Voximplant features, you should initialize the SDK’s core system by calling VICore.initialize(context).
While you can initialize the SDK anywhere in your application (for example, in your MainActivity or a custom manager class) as long as you pass a valid Context, we highly recommend doing it once in a custom Application class. This ensures the SDK is fully prepared and globally available as soon as your application starts.
After the core is initialized, connection and user authentication are managed via the singleton Client instance. You can obtain this thread-safe client anywhere in your codebase:
Connect and log in
To use Voximplant communication features, your application should first establish a connection to the Voximplant Cloud and authenticate a registered user.
The connection and login flow involves three key asynchronous listeners and callbacks:
- ClientSessionListener — Handles global state events such as unexpected disconnections.
- ConnectionCallback — Handles the success or failure of a specific Client.connect() attempt.
- LoginCallback — Handles the success or failure of a specific Client.login() credential validation attempt.
When initializing and connecting the SDK to the Voximplant cloud, you need to specify the node to connect to. Your node is bound to your Voximplant account. To find which node your account belongs to, log in to your control panel and see the Credentials for working with API, SDK, SIP section on the main dashboard.
Connection and authentication flow
Here is a complete example demonstrating how to configure global session listeners, connect to your specified Voximplant node, and authenticate a user upon a successful connection:
Android SDK demos
To accelerate your integration, we provide a complete, feature-rich reference application showcasing best practices for Android SDK v3:
Android SDK v3 Demo Repository — A modern sample application built with Kotlin, Jetpack Compose, and Hilt. It features a modular codebase architecture and fully implements:
- User authentication: Logging in with credentials and silent token-based authentication.
- Audio calling: Initiating, receiving, and managing audio call routing.
- Video calling: Building full-featured video communication feeds using android-sdk-renderer-compose to display local and remote camera streams.
Note: Older v2-based demo applications remain accessible inside our legacy repositories, but we recommend referencing the v3 demo for any first-time integrations.
Android SDK v2 (Legacy)
Use SDK v2 only when maintaining an existing application. For all new integrations, SDK v3 should be used to take advantage of its modular architecture and modern Android ecosystem support.
SDK v2 will be supported until Dec 31, 2027. Support for SDK v2 is limited to bug fixes, while new features and functionality will be added exclusively to SDK v3.
To upgrade an existing project, refer to the Android Migration Guide.
Monolithic Dependency Configuration
Unlike SDK v3, SDK v2 is distributed as a monolithic package. Add it to your build configuration along with Java 11 compatibility options:
Legacy connection and authentication flow
In SDK v2, connection and login are handled through IClient instance listeners. Below is a standard Kotlin setup demonstrating client instantiation, connection state management, and user authentication:
For detailed documentation on the legacy API, see the Android SDK v2 reference.