Docs
DashboardRelease Notes
  • What is DeepConverse?
  • Chatbots
    • Basics
      • Building chatbot intents
      • Intent action responses
      • Chatbot Persistence mode
      • Publishing changes
    • Advanced Functionality
      • Connection Override
      • User Identity Verification
      • Announcements
      • Channel Specific Functionality
        • Zendesk Sunshine Conversations
          • How to handle image and file uploads in Zendesk Sunshine Conversations?
        • Zendesk Chat (Classic)
          • How to handoff conversations to Zendesk Chat (Classic) ?
        • Calendly
    • Branding
    • Deploy
      • Chatbot Versioning
      • iOS SDK
        • iOS (Custom Webview)
      • Android SDK
      • Adding widget to your Zendesk Help Center
      • Adding widget to your website
      • Custom Initialization and Passing Metadata
      • Open chatbot via Javascript
      • Adding widget to your Shopify Store
        • Adding the widget to Shopify via the Theme editor embed block
    • Localization
    • Customizations
      • Adding a link to your Privacy Policy in Chatbot window
  • Voice Bot
    • Getting Started with Voice Bots
    • Voice Bot Architecture
    • Supported use cases for Voice Bot
    • Setup and Configuration
  • Ticket Automation
    • Setup Zendesk email and ticket automation
  • Guides
    • Building Guides
    • Guide Theme Customization
    • Embedding Guides on your website
    • Embedding Guides in Chatbots
    • How to copy Guides across sites
  • Conversational Flow Builder
    • What is the Conversation Flow Builder?
    • Assign Parameters in Conversations
      • Predefined Parameters
    • How to use Rules in Conversations
    • Conversation Blocks
      • Question
      • Salesforce Blocks
        • Agent Availability Block
        • Live Agent Handover
      • Guide Blocks
        • Guide Step (Guide Flow)
        • Solved Block
        • Unsolved Block
        • Guide (Chatbot)
      • HTTP Request
      • Client Events
      • Policy
      • Zendesk Sunshine Conversations Handoff (In Widget)
    • Data Tables
      • How to read or search data from Data Tables?
  • Analytics
    • Chatbot Analytics
    • Viewing Chat Conversations
    • Message Viewer
    • Integrating with Google Analytics
    • Export API
      • Conversations Endpoint
      • Messages Endpoint
  • Integrations
    • Supported Integrations
      • Zendesk
      • Zendesk Sunshine Conversations
      • Salesforce
      • Gorgias
  • Account
    • Adding Users
    • Permissions and Roles
    • Multiple Sites
  • Security
    • DeepConverse Public IPs
    • Subprocessors
    • Data Request Policy
    • Technical and Organizational Security Measures
    • Reporting Security Vulnerabilities
      • Log4Shell Vulnerability
    • Generative AI - Technical Security Measures
  • Support
    • Contacting Support
    • Service Levels and Response Times
    • Platform Stability
Powered by GitBook
On this page
  • Installation
  • Setup

Was this helpful?

  1. Chatbots
  2. Deploy

Android SDK

DeepConverse provides an easy to use SDK for integrating the chatbot into your app. To setup the SDK follow the steps below.

Installation

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.converselabs:android-sdk:1.0.6'
}

Setup

Here is a sample ViewController showing how you can include the SDK and load the bot on the click action of a button. You can also pass in metadata to the chatbot.

You will require DOMAIN and BOT_NAME which can be found from the dashboard.

package com.sample.webviewapp;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import androidx.appcompat.app.AppCompatActivity;

import com.deepconverse.android_sdk.DeepConverseSDK;
import com.deepconverse.webviewapp.R;

import java.util.HashMap;
import java.util.Map;




public class MainActivity extends AppCompatActivity implements DeepConverseSDK.WebViewCallback {

    private Button openWebViewButton;
    private LinearLayout webUrlContainer;
    private DeepConverseSDK deepConverseSDK;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        openWebViewButton = findViewById(R.id.openWebViewButton);
        webUrlContainer = findViewById(R.id.webUrlContainer);

        openWebViewButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (deepConverseSDK != null) {
                    // Remove the existing WebUrlView if present
                    webUrlContainer.removeView(deepConverseSDK);
                    deepConverseSDK.destroyView();
                }

                // Create a new instance of WebUrlView
                Map<String, String> metadata = new HashMap<>();
                metadata.put("draft", "true");
                deepConverseSDK = new DeepConverseSDK(MainActivity.this, DOMAIN,
                        BOT_NAME, metadata);
                deepConverseSDK.setLayoutParams(new LinearLayout.LayoutParams(
                        LinearLayout.LayoutParams.MATCH_PARENT,
                        LinearLayout.LayoutParams.MATCH_PARENT));
                deepConverseSDK.setWebViewCallback(MainActivity.this);
                deepConverseSDK.load();
                webUrlContainer.addView(deepConverseSDK);

                // Show the webUrlContainer and trigger a layout pass
                webUrlContainer.setVisibility(View.VISIBLE);
                webUrlContainer.requestLayout();
            }
        });
    }

    @Override
    public void onViewClosed() {
        // Remove the WebUrlView from the container
        if (deepConverseSDK != null) {
            webUrlContainer.removeView(deepConverseSDK);
            deepConverseSDK.destroyView();
            deepConverseSDK = null;
            webUrlContainer.setVisibility(View.GONE);
        }
    }
}

Android Releases

PreviousiOS (Custom Webview)NextAdding widget to your Zendesk Help Center

Last updated 10 months ago

Was this helpful?

https://github.com/converselabs/android-sdk/releases