Android SDK Integration
Add Helplane chat support to your Android app using our native SDK.
Requirements
- Android API 24 (Android 7.0) or higher
- Kotlin 1.8 or later
- Android Studio Arctic Fox or later
Installation
Gradle (JitPack)
Add JitPack to your project's settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}Add the dependency to your app's build.gradle.kts:
dependencies {
implementation("com.github.intigratech:helplane-android-sdk:Tag")
}Replace Tag with the latest version. Check tags for available versions.
Sync your project and the SDK will be downloaded.
Configuration
Initialize the SDK
In your Application class or main activity:
import io.helplane.sdk.HelpLaneclass MyApplication : Application() {
override fun onCreate() {
super.onCreate()
HelpLane.configure(
context = this,
brandToken = "your-brand-token"
)
}
}
Identify Users (Optional)
For logged-in users, identify them to maintain conversation history:
import io.helplane.sdk.HelpLane
import io.helplane.sdk.HelpLaneUserval user = HelpLaneUser(
externalId = "user-123",
name = "John Doe",
email = "[email protected]",
avatarURL = "https://example.com/avatar.jpg",
customAttributes = mapOf("plan" to "premium", "company" to "Acme Inc")
)
HelpLane.setUser(user)
Displaying the Chat
Launch Chat Activity
import io.helplane.sdk.HelpLaneclass MainActivity : AppCompatActivity() {
fun openChat() {
HelpLane.open(this)
}
}
XML Button Example
<Button
android:id="@+id/helpButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Help" />binding.helpButton.setOnClickListener {
HelpLane.open(this)
}Jetpack Compose
import io.helplane.sdk.HelpLane@Composable
fun SupportScreen() {
val context = LocalContext.current
Button(onClick = { HelpLane.open(context as Activity) }) {
Text("Get Help")
}
}
User Logout
When users log out, clear their identity:
HelpLane.clearUser()ProGuard Rules
If you use ProGuard or R8, add these rules to proguard-rules.pro:
-keep class io.helplane.sdk.<em></em> { *; }
-keepclassmembers class io.helplane.sdk.<em></em> { *; }Permissions
The SDK requires internet permission. Add to your AndroidManifest.xml if not already present:
<uses-permission android:name="android.permission.INTERNET" />Customization
The chat widget inherits your brand colors and styling configured in your Helplane dashboard under Settings > Chat Widget.