This is the official Kindly SDK for Android. This SDK allows you to integrate Kindly's chat functionality into your Android application.
Follow these steps to install the Kindly SDK into your Android project.
Add the following lines to your root build.gradle
file:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
pluginManagement {
repositories {
...
maven(url = "https://jitpack.io")
}
}
dependencies {
implementation "com.github.kindly-ai:sdk-chat-android:TAG"
}
dependencies {
implementation("com.github.kindly-ai:sdk-chat-android:TAG")
}
Find the latest version here
In your Application class, initialize the SDK as follows:
class App: Application() {
override fun onCreate() {
super.onCreate()
// 🌿 Initialize the SDK
KindlySDK.start(
application = this,
botKey = "BOT_KEY",
languageCode = "en",
)
}
}
After installing the SDK, you can now use it in your Android application.
To launch the chat, call KindlySDK.launchChat(context = context)
in your activity or fragment:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MyApplicationTheme {
Box(modifier = Modifier.fillMaxSize()) {
MyButton()
}
}
}
}
}
@Composable
fun MyButton() {
val context = LocalContext.current
Button(onClick = {
// 🌿 Display the SDK screen
KindlySDK.launchChat(context = context)
},) {
Text(text = "Click Here")
}
}
If you encounter any issues or require further assistance, feel free to create an issue in this repository or contact Kindly's support team.
For more information, please refer to the following resources: