Quickstart
Use this guide to add a chat button to your Android app with the Zoho SalesIQ Android SDK (Mobilisten). It takes about five minutes and covers only the essential steps. For keys, permissions, ProGuard, backup rules, and troubleshooting, follow the complete Getting started guide.
For example, Zylker Bakes, an online bakery, has this button in its cake-ordering app. People who are about to order can ask a question, such as whether a cake can arrive before noon. The bakery's operators answer them in the chat.
Here's what you'll need:
- A SalesIQ account with a brand set up.
- Your App Key and Access Key. To learn how to generate them, see the Get your App Key and Access Key section.
- An app that targets Android 5.0 (Lollipop), API level 21, or higher.
1. Add the Maven repository
The SDK is published in the Zoho Maven repository. Add the repository to your
settings.gradle.kts file so Gradle can locate the SDK.
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://maven.zohodl.com") }
}
}
2. Add the dependency
Add the SDK dependency to your app-level build.gradle.kts file, then click Sync Now. Android
Studio downloads the SDK and adds it to your project.
dependencies {
implementation("com.zoho.salesiq:mobilisten:9.0.1")
}
3. Initialize in your Application class
Android creates your Application class before any screen of your app opens. Initialize the SDK in
its onCreate() method, so that the chat is ready on every screen. Replace APP_KEY and
ACCESS_KEY with your own keys. When initialization succeeds, the code shows the chat button.
- Kotlin
- Java
class MyApplication : Application() {
override fun onCreate() {
MobilistenActivityLifecycleCallbacks.register(this) // Call this before super.onCreate().
super.onCreate()
val config = SalesIQConfiguration.Builder("APP_KEY", "ACCESS_KEY").build()
ZohoSalesIQ.initialize(this, config) { result ->
if (result.isSuccess) {
ZohoSalesIQ.Launcher.show(ZohoSalesIQ.Launcher.VisibilityMode.ALWAYS)
}
}
}
}
public class MyApplication extends Application {
@Override
public void onCreate() {
MobilistenActivityLifecycleCallbacks.register(this); // Call this before super.onCreate().
super.onCreate();
SalesIQConfiguration config = new SalesIQConfiguration.Builder("APP_KEY", "ACCESS_KEY").build();
ZohoSalesIQ.initialize(this, config, result -> {
if (result.isSuccess()) {
ZohoSalesIQ.Launcher.show(ZohoSalesIQ.Launcher.VisibilityMode.ALWAYS);
}
});
}
}
Keep MobilistenActivityLifecycleCallbacks.register(this) before super.onCreate(). It lets the
SDK keep track of the screens of your app from the first one that opens.
Then register the class in your AndroidManifest.xml file:
<application android:name=".MyApplication" ... >
4. Run your app
Run your app. The floating chat button appears on the screen. Tap it and send a message, such as "Can I collect my order at 10 AM?"
The message appears on your SalesIQ dashboard, where you show up as a visitor. An operator can reply to you from there.
Check the result of initialize() to confirm that it succeeded, and make sure that you called Launcher.show(). For other common causes, see the Troubleshooting section.
Next steps
- The Getting started guide covers the rest of the setup, including permissions, ProGuard, backup rules, and WorkManager.
- To make the chat match the look of your app, see the Customization section.
- Set up Push notifications, so that visitors receive replies while your app is in the background.
- Before you release your app, read the Best practices. They cover the most common integration mistakes.