LiveKit (Android)
Nativeblocks provides hot-reloading and screen-sharing tools for developers
LiveKit is a powerful debugging and screen-sharing and hot-reloading utility for Android applications.
Get started
Make sure that your project meets these requirements:
- Uses Android API level 26 or higher
- Uses Jetpack (AndroidX)
- Initialized Nativeblocks Core SDK
Add LiveKit to your gradle app module
build.gradle
dependencies {
implementation("io.nativeblocks:nativeblocks-wandkit-android:1.0.0")
}
Let's get started by initializing the SDK, it can be inside of the onCreate's Activity or provide via dependency injection, but make sure liveKit calls after the Nativeblocks initialize
NativeblocksManager.getInstance().liveKit(
screenSharing = true, // Enables screen sharing feature
keepScreenOn = true, // Keeps the screen on during debugging
)
Debug builds config
Ensure LiveKit is only used in debug builds by wrapping the code with BuildConfig.DEBUG:
NativeblocksManager.getInstance().liveKit(
screenSharing = true, // Enables screen sharing feature
keepScreenOn = true, // Keeps the screen on during debugging
)
Here is an example of how to integrate LiveKit in an Android app:
package io.nativeblocks.sampleapp
import android.os.Bundle
import androidx.activity.ComponentActivity
import io.nativeblocks.wandkit.LiveKit
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
NativeblocksManager.initialize(
...
)
if (BuildConfig.DEBUG) {
NativeblocksManager.getInstance().liveKit(screenSharing = true, keepScreenOn = true)
}
...
}
}