Updated on February 12, 2025

Previously, we presented a simple and practical guide to integrating a Dialogflow bot into a website. This article will explain the steps to do the same in an Android app. All you need to build a sample chatbot for an Android app is Dialogflow and Kommunicate.

Below is an example of a Kommunicate Support Bot developed in Android using Dialogflow. We use this bot on our website. If you wish to see the bot live in action, head here.

The actionable, rich messaging-powered bot can reply based on whether users are on chat for general queries, technical queries, or scheduling a demo.

CTA banner

You can use your existing Dialogflow or checkout bot samples to build a qualifying bot. Download the Kommunicate Support Bot from here and import it into your Dialogflow account.

Kommunicate Support Bot sample with Dialogflow

Step 1: Setup an account in Kommunicate

This is pretty simple. You can get a free account in Kommunicate. Signup and navigate to the Bot Integration section. Click on Dialogflow ES or CX integration.

Bot Integration with Kommunicate

Dialogflow ES Integration

Now, navigate to your Google Cloud console and download the service account key file. Here are the steps to locate the file:

  1. Login to Dialogflow ES console
  2. Go to Create Service Account Key in Google Cloud console. Make sure you have selected the correct project and select the New service account from the Service account list.
  3. In the Service account name field, enter a name.
  4. From the Role list, select Project > Owner.
  5. Click Create. A JSON file that contains your key will be downloaded to your computer.
  6. Upload the Service account private key (JSON).

You can also refer to this doc for Dialogflow integration with Kommunicate.

Dialogflow ES Integration with Kommunicate

Dialogflow CX Integration

To integrate Dialogflow CX into Kommunicate, follow the instructions above to download the JSON key and mention the Agent ID in the Kommunicate dashboard.

To get the Agent ID:

Go to Dialogflow CX console >> Select the Project >> In the Agent you have created >> Copy the agent name to the clipboard in the format mentioned below,  where the Agent ID is 54b0c663-2c01-4a09-a482-277ff39c0b05

Copy the agent ID for the agent you've created

Step 2: Install Dialogflow integrated Android Chatbot SDK into your app

Add Android SDK to your app

Installing Kommunicate in your Android app is easy and fast because the Kommunicate SDK comes with a pre-configured Dialogflow integration.


Installation
Add the following to your app in the build.gradle dependency:

implementation 'io.kommunicate:kommunicate: 2.1.6'

Initialize SDK
After the Gradle sync has finished with Kommunicate dependency, you can initialize the SDK by calling the below method:

Kommunicate.init(context, APP_ID);

You can get the Application ID by signing up on Kommunicate Dashboard.
For full documentation, refer here.

Sample Android app with Dialogflow Chatbot

We’ve prepared a sample Android app with a Dialogflow Chatbot. Download and run it in Android Studio to see how it works.

Step 3: Launch the Android chat app with Dialogflow integrated chatbot

Now, you can send the payload to Dialogflow through the chat screen and get text responses from your Dialogflow Agent.
Kommunicate provides a ready-to-use Chat UI, so you’ll only need to launch the chat screen in this step.

Here are the instructions for launching the chat with Dialogflow bot:

List<String> botList = new ArrayList(); botList.add("bot1"); //enter your integrated bot Ids
new KmChatBuilder(context).setChatName("Support")
                .setBotIds(botList)
                .launchChat(new KmCallback() {
            @Override
            public void onSuccess(Object message) {
                Utils.printLog(context, "ChatTest", "Success : " + message);
            }

            @Override
            public void onFailure(Object error) {
                Utils.printLog(context, "ChatTest", "Failure : " + error);
            }
        });

That’s all! Run the Android app and chat with the Dialogflow bot. You can easily integrate Dialogflow into Android apps in a few simple steps. If you need more information, you can check out the Kommunicate documentation.

Are you considering chatbots for your business? Download the Complete Beginner’s Guide to Chatbots for a more detailed explanation of chatbots’ capabilities, industry use cases, and a step-by-step guide on how to build one.

try for free ai chatbot cta

Dialogflow Android SDK

Dialogflow provides an Android Client SDK, making it easy to integrate speech recognition with API.ai natural language processing API on Android devices. If you want to develop your chat implementation and directly integrate Dialogflow into your Android app without kommunicate SDK, then integrate with the following SDK.
Github – Dialogflow Android Client SDK

Reduce response time, enhance support workflows, and improve customer          satisfaction with AI-driven email ticketing from Kommunicate!

Kommunicate makes it simple for you to build and deploy Dialogflow chatbots. Read more about it here:

  1. Integrate the Dialogflow (Api.ai) Bot into the Website
  2. Dialogflow vs Rasa – Which One to Choose?

At Kommunicate, we are envisioning a world-beating customer support solution to empower the new era of customer support. We would love to have you on board to have a first-hand experience with Kommunicate. You can sign up for free and start delighting your customers right away.

Write A Comment

Close

Eve from Kommunicate

Experience Your Own AI Chatbot!

Instantly create your own AI chatbot! Enter your URL and get started with just a click. No sign-up required

Create Your Chatbot Now!

You’ve unlocked 30 days for $0
Kommunicate Offer

Upcoming Webinar: Conversational AI in Fintech with Srinivas Reddy, Co-founder & CTO of TaxBuddy.

X