{"id":25595393,"url":"https://github.com/livekit/client-sdk-android","last_synced_at":"2025-05-16T08:05:43.623Z","repository":{"id":37456804,"uuid":"339892560","full_name":"livekit/client-sdk-android","owner":"livekit","description":"LiveKit SDK for Android","archived":false,"fork":false,"pushed_at":"2025-05-09T16:04:14.000Z","size":2868,"stargazers_count":238,"open_issues_count":84,"forks_count":99,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-05-09T17:23:08.759Z","etag":null,"topics":["android","kotlin","video","webrtc"],"latest_commit_sha":null,"homepage":"https://docs.livekit.io","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livekit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-18T00:29:36.000Z","updated_at":"2025-05-09T16:03:58.000Z","dependencies_parsed_at":"2023-11-20T05:22:36.464Z","dependency_job_id":"507b6945-1332-4d8b-aacc-daa1ff4ce959","html_url":"https://github.com/livekit/client-sdk-android","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livekit","download_url":"https://codeload.github.com/livekit/client-sdk-android/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","kotlin","video","webrtc"],"created_at":"2025-02-21T11:20:57.708Z","updated_at":"2025-05-16T08:05:38.616Z","avatar_url":"https://github.com/livekit.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"\u003c!--BEGIN_BANNER_IMAGE--\u003e\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"/.github/banner_dark.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"/.github/banner_light.png\"\u003e\n  \u003cimg style=\"width:100%;\" alt=\"The LiveKit icon, the name of the repository and some sample code in the background.\" src=\"https://raw.githubusercontent.com/livekit/client-sdk-android/main/.github/banner_light.png\"\u003e\n\u003c/picture\u003e\n\n\u003c!--END_BANNER_IMAGE--\u003e\n\n# Android Kotlin SDK for LiveKit\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.livekit/livekit-android/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.livekit/livekit-android)\n\u003c!--BEGIN_DESCRIPTION--\u003e\nUse this SDK to add realtime video, audio and data features to your Android/Kotlin app. By connecting to \u003ca href=\"https://livekit.io/\"\u003eLiveKit\u003c/a\u003e Cloud or a self-hosted server, you can quickly build applications such as multi-modal AI, live streaming, or video calls with just a few lines of code.\n\u003c!--END_DESCRIPTION--\u003e\n\n# Table of Contents\n\n- [Docs](#docs)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Permissions](#permissions)\n    - [Publishing camera and microphone](#publishing-camera-and-microphone)\n    - [Sharing screen](#sharing-screen)\n    - [Rendering subscribed tracks](#rendering-subscribed-tracks)\n    - [Audio modes](#audio-modes)\n    - [@FlowObservable](#flowobservable)\n- [Sample App](#sample-app)\n- [Dev Environment](#dev-environment)\n    - [Optional (Dev convenience)](#optional-dev-convenience)\n\n## Docs\n\nDocs and guides at [https://docs.livekit.io](https://docs.livekit.io).\n\nAPI reference can be found\nat [https://docs.livekit.io/client-sdk-android/index.html](https://docs.livekit.io/client-sdk-android/index.html)\n.\n\n\u003e [!NOTE]\n\u003e This is v2 of the Android SDK. When migrating from v1.x to v2.x you might encounter a small set of breaking changes.\n\u003e Read the [migration guide](https://docs.livekit.io/recipes/migrate-from-v1/) for a detailed overview of what has changed.\n\n## Installation\n\nLiveKit for Android is available as a Maven package.\n```groovy title=\"build.gradle\"\n...\ndependencies {\n  def livekit_version = \"2.14.0\"\n\n  implementation \"io.livekit:livekit-android:$livekit_version\"\n  // CameraX support with pinch to zoom, torch control, etc.\n  implementation \"io.livekit:livekit-android-camerax:$livekit_version\"\n\n  // Snapshots of the latest development version are available at:\n  // implementation \"io.livekit:livekit-android:2.14.1-SNAPSHOT\"\n}\n```\n\nCompose-based apps should check out our [Android Components SDK](https://github.com/livekit/components-android) for composables support.\n\nYou'll also need JitPack as one of your repositories. In your `settings.gradle` file:\n\n```groovy title=\"settings.gradle\"\ndependencyResolutionManagement {\n    repositories {\n        google()\n        mavenCentral()\n        //...\n        maven { url 'https://jitpack.io' }\n\n        // For SNAPSHOT access\n        // maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }\n    }\n}\n```\n\n## Usage\n\n### Permissions\n\nLiveKit relies on the `RECORD_AUDIO` and `CAMERA` permissions to use the microphone and camera.\nThese permission must be requested at runtime. Reference\nthe [sample app](https://github.com/livekit/client-sdk-android/blob/4e76e36e0d9f895c718bd41809ab5ff6c57aabd4/sample-app-compose/src/main/java/io/livekit/android/composesample/MainActivity.kt#L134)\nfor an example.\n\n### Publishing camera and microphone\n\n```kt\nroom.localParticipant.setCameraEnabled(true)\nroom.localParticipant.setMicrophoneEnabled(true)\n```\n\n### Sharing screen\n\n```kt\n// create an intent launcher for screen capture\n// this *must* be registered prior to onCreate(), ideally as an instance val\nval screenCaptureIntentLauncher = registerForActivityResult(\n    ActivityResultContracts.StartActivityForResult()\n) { result -\u003e\n    val resultCode = result.resultCode\n    val data = result.data\n    if (resultCode != Activity.RESULT_OK || data == null) {\n        return@registerForActivityResult\n    }\n    lifecycleScope.launch {\n        room.localParticipant.setScreenShareEnabled(true, data)\n    }\n}\n\n// when it's time to enable the screen share, perform the following\nval mediaProjectionManager =\n    getSystemService(MEDIA_PROJECTION_SERVICE) as MediaProjectionManager\nscreenCaptureIntentLauncher.launch(mediaProjectionManager.createScreenCaptureIntent())\n```\n\n### Rendering subscribed tracks\n\nLiveKit uses `SurfaceViewRenderer` to render video tracks. A `TextureView` implementation is also\nprovided through `TextureViewRenderer`. Subscribed audio tracks are automatically played.\n\n```kt\nclass MainActivity : AppCompatActivity() {\n\n    lateinit var room: Room\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        setContentView(R.layout.activity_main)\n\n        // Create Room object.\n        room = LiveKit.create(applicationContext)\n\n        // Setup the video renderer\n        room.initVideoRenderer(findViewById\u003cSurfaceViewRenderer\u003e(R.id.renderer))\n\n        connectToRoom()\n    }\n\n    private fun connectToRoom() {\n\n        val url = \"wss://your_host\"\n        val token = \"your_token\"\n\n        lifecycleScope.launch {\n\n            // Setup event handling.\n            launch {\n                room.events.collect { event -\u003e\n                    when (event) {\n                        is RoomEvent.TrackSubscribed -\u003e onTrackSubscribed(event)\n                        else -\u003e {}\n                    }\n                }\n            }\n\n            // Connect to server.\n            room.connect(\n                url,\n                token,\n            )\n\n            // Turn on audio/video recording.\n            val localParticipant = room.localParticipant\n            localParticipant.setMicrophoneEnabled(true)\n            localParticipant.setCameraEnabled(true)\n        }\n    }\n\n    private fun onTrackSubscribed(event: RoomEvent.TrackSubscribed) {\n        val track = event.track\n        if (track is VideoTrack) {\n            attachVideo(track)\n        }\n    }\n\n    private fun attachVideo(videoTrack: VideoTrack) {\n        videoTrack.addRenderer(findViewById\u003cSurfaceViewRenderer\u003e(R.id.renderer))\n        findViewById\u003cView\u003e(R.id.progress).visibility = View.GONE\n    }\n}\n```\n\nSee\nthe [basic sample app](https://github.com/livekit/client-sdk-android/blob/main/sample-app-basic/src/main/java/io/livekit/android/sample/basic/MainActivity.kt)\nfor the full implementation.\n\n### Audio modes\n\nBy default, the audio is configured for two-way communications.\n\nIf you are building a livestreaming or media playback focus app, you can use the preset\n`MediaAudioType` when creating the `Room` object for better audio quality.\n\n```kt\nval room = LiveKit.create(\n    appContext = application,\n    overrides = LiveKitOverrides(\n        audioOptions = AudioOptions(\n            audioOutputType = AudioType.MediaAudioType()\n        )\n    )\n)\n```\n\nNote: audio routing becomes automatically handled by the system and cannot be manually controlled.\n\nFor more control over the specific audio attributes and modes, a `CustomAudioType` can be\npassed instead.\n\n### `@FlowObservable`\n\nProperties marked with `@FlowObservable` can be accessed as a Kotlin Flow to observe changes\ndirectly:\n\n```kt\ncoroutineScope.launch {\n    room::activeSpeakers.flow.collectLatest { speakersList -\u003e\n        /*...*/\n    }\n}\n```\n\n## Sample App\n\n**Note**: If you wish to run the sample apps directly from this repo, please consult\nthe [Dev Environment instructions](#dev-environment).\n\nWe have a basic quickstart sample\napp [here](https://github.com/livekit/client-sdk-android/blob/main/sample-app-basic), showing how to\nconnect to a room, publish your device's audio/video, and display the video of one remote\nparticipant.\n\nThere are two more full featured video conferencing sample apps:\n\n- [Compose app](https://github.com/livekit/client-sdk-android/tree/main/sample-app-compose/src/main/java/io/livekit/android/composesample)\n- [Standard app](https://github.com/livekit/client-sdk-android/tree/main/sample-app/src/main/java/io/livekit/android/sample)\n\nThey both use\nthe [`CallViewModel`](https://github.com/livekit/client-sdk-android/blob/main/sample-app-common/src/main/java/io/livekit/android/sample/CallViewModel.kt)\n, which handles the `Room` connection and exposes the data needed for a basic video conferencing\napp.\n\nThe respective `ParticipantItem` class in each app is responsible for the displaying of each\nparticipant's UI.\n\n- [Compose `ParticipantItem`](https://github.com/livekit/client-sdk-android/blob/main/sample-app-compose/src/main/java/io/livekit/android/composesample/ParticipantItem.kt)\n- [Standard `ParticipantItem`](https://github.com/livekit/client-sdk-android/blob/main/sample-app/src/main/java/io/livekit/android/sample/ParticipantItem.kt)\n\n## Dev Environment\n\nTo develop the Android SDK or running the sample app directly from this repo, you'll need:\n\n- Clone the repo to your computer\n- Ensure the protocol submodule repo is initialized and updated\n\n```\ngit clone https://github.com/livekit/client-sdk-android.git\ncd client-sdk-android\ngit submodule update --init\n```\n\n---\n\nFor those developing on Macs with Apple silicon (e.g. M1, M2, etc.), please add below to $HOME/.gradle/gradle.properties\n\n```\nprotoc_platform=osx-x86_64\n```\n\n### Optional (Dev convenience)\n\n1. Download webrtc sources from https://webrtc.googlesource.com/src\n2. Add sources to Android Studio by pointing at the `webrtc/sdk/android` folder.\n\n\u003c!--BEGIN_REPO_NAV--\u003e\n\u003cbr/\u003e\u003ctable\u003e\n\u003cthead\u003e\u003ctr\u003e\u003cth colspan=\"2\"\u003eLiveKit Ecosystem\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003eLiveKit SDKs\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/client-sdk-js\"\u003eBrowser\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-swift\"\u003eiOS/macOS/visionOS\u003c/a\u003e · \u003cb\u003eAndroid\u003c/b\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-flutter\"\u003eFlutter\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-react-native\"\u003eReact Native\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/rust-sdks\"\u003eRust\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/node-sdks\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/python-sdks\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-unity\"\u003eUnity\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-unity-web\"\u003eUnity (WebGL)\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eServer APIs\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/node-sdks\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-go\"\u003eGolang\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-ruby\"\u003eRuby\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-kotlin\"\u003eJava/Kotlin\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/python-sdks\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/rust-sdks\"\u003eRust\u003c/a\u003e · \u003ca href=\"https://github.com/agence104/livekit-server-sdk-php\"\u003ePHP (community)\u003c/a\u003e · \u003ca href=\"https://github.com/pabloFuente/livekit-server-sdk-dotnet\"\u003e.NET (community)\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eUI Components\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/components-js\"\u003eReact\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/components-android\"\u003eAndroid Compose\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/components-swift\"\u003eSwiftUI\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eAgents Frameworks\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/agents\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/agents-js\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/agent-playground\"\u003ePlayground\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eServices\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/livekit\"\u003eLiveKit server\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/egress\"\u003eEgress\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/ingress\"\u003eIngress\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/sip\"\u003eSIP\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eResources\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://docs.livekit.io\"\u003eDocs\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples\"\u003eExample apps\u003c/a\u003e · \u003ca href=\"https://livekit.io/cloud\"\u003eCloud\u003c/a\u003e · \u003ca href=\"https://docs.livekit.io/home/self-hosting/deployment\"\u003eSelf-hosting\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/livekit-cli\"\u003eCLI\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c!--END_REPO_NAV--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Fclient-sdk-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivekit%2Fclient-sdk-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Fclient-sdk-android/lists"}