SaleAssist for Developers
HomeDashboardAPI DocsBook A Demo
  • 👋Welcome
  • Introduction
  • Onboarding Steps
  • Admin Account Creation
  • Getting Started
  • Features Overview
    • Live Video Calling
      • Outbound Calls
        • Schedule Video Meets
        • Instant Video Meets
      • Inbound Calls
        • How to use ?
        • Integration
        • Desktop Call Management
    • Live Stream Selling
      • How to go Live?
      • Get RTMP and Stream Key from social channels.
    • Shoppable Videos Tiles
      • How to use?
      • Integration
    • Strike
      • AI Videos
    • Co-Browsing
  • Integration Guide
    • Mobile SDK integration
      • Cobrowse - Flutter SDK
      • React Native SDK
      • IOS SDK
      • Android SDK
      • How to delete my account?
      • Cobrowse - Android SDK
      • Cobrowse - IOS SDK
      • Identify your devices for Cobrowse
      • Use 6-digit codes
      • Redact sensitive data
      • Start and Stop Cobrowsing
      • Listening for events
    • User Experience
    • Agent Mapping
    • Nudges
    • Agent Feedback
    • AI Chat (Add Context)
    • API Integration
    • Webhook Integration
    • FAQ & Troubleshooting
    • Lead Management
    • Task Management
    • SaleAssist Whatsapp Feature
    • Sales/Conversion Tracking - Widget
    • Sales/Conversion Tracking - Video Tiles
    • Integrate meetings lite dashboard
  • Assets Managment
    • Media
    • Products
    • Orders
  • Organization Settings
    • Profile
    • Organization
    • Users & Roles
    • SMTP Integration
    • Custom Domain
    • Notification Manager
  • Addons
    • Transcription & Summarization
    • Video QR Codes
    • Video Emails
    • Live Chat
    • Outbound Phone Calling
    • Book In-store appointment
    • Schedule Call
    • Shoppable Video Links
      • How to use?
      • Integration
    • Video FAQs
      • How to use?
      • Integration
    • WhatsApp Onboarding steps
  • Analytics
    • Widget Insights
    • Video tiles insights
    • Reporting
    • SaleAssist Mobile Application
    • How to manage calls on Mobile Application
    • Admin Controls
  • Troubleshooting
    • Troubleshoot Video Call Permissions
  • Release Logs
    • v24.11.24
    • v24.11.30
    • v24.12.10
    • v25.01.10
    • v25.01.18
    • v25.01.29
    • v25.02.05
    • v25.02.05
Powered by GitBook
On this page
  • Part 1: To Add Floating Chat Icon:
  • Part 2: Adding Slider View

Was this helpful?

  1. Integration Guide
  2. Mobile SDK integration

Android SDK

This document assumes that you understand the basic terms of Android app development in Kotlin language

Part 1: To Add Floating Chat Icon:

  • Step 1 : Add a WebView in your layout file where you want to add your floating chat button


Code Sample

<androidx.cardview.widget.CardView
        android:id="@+id/fab"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_gravity="bottom|end"
        android:layout_margin="16dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="8dp"
        app:elevation="6dp"
        app:cardCornerRadius="40dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent">


        <WebView
            android:id="@+id/floatingWebView"
            android:layout_width="80dp"
            android:layout_height="80dp" />


        <View
            android:id="@+id/touchView"
            android:layout_width="80dp"
            android:layout_height="80dp"/>


    </androidx.cardview.widget.CardView>

  • Step 2: Bind the webview to an activity in your code

floatingWebView = findViewById(R.id.floatingWebView)
// Configure WebView settings
val webSettingsFloating: WebSettings = floatingWebView.settings
webSettingsFloating.javaScriptEnabled = true // Enable JavaScript (optional)

// Load a URL in the WebView

floatingWebView.loadUrl("URL From Sales Assist Dashboard")
floatingWebView.webViewClient = object : WebViewClient() {
    override fun onPageFinished(view: WebView?, url: String?) {
        super.onPageFinished(view, url)

        val cssCode = "video::-webkit-media-controls-play-button, video::-webkit-media-controls-start-playback-button { display: none !important; }"
        floatingWebView.loadUrl("javascript:(function() { var style = document.createElement('style'); style.innerHTML = '$cssCode'; document.head.appendChild(style); })();")
    }
}

With This, you will see a floating chat icon in your app

Now we need to open the chat window with the click of the floating chat icon.

but before that, we need to create a web view for the opening window

  • Step 3: Create A new Activity and layout with webview

<WebView
        android:id="@+id/webViewNext"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.webkit.WebSettings
import android.webkit.WebView

class NextWebViewActivity : AppCompatActivity() {
    private lateinit var webViewNext: WebView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_next_web_view)

        // Find the WebView by its ID
        webViewNext = findViewById(R.id.webViewNext)

        // Configure WebView settings
        val webSettings: WebSettings = webViewNext.settings
        webSettings.javaScriptEnabled = true // Enable JavaScript (optional)

        // Load a URL in the WebView
        webViewNext.loadUrl("your URL from sale assist dashboard")

    }
}

  • Step4: Setup Touch Event with the floating chat icon

val touchView: View = findViewById(R.id.touchView)
        touchView.setOnClickListener {
            // Add your action here
            // For example, navigate to another activity
             val intent = Intent(this, NextWebViewActivity::class.java)
             startActivity(intent)
        }

Part 2: Adding Slider View

  • Step 1 : Add a Webview in your layout file

<WebView
        android:id="@+id/webView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="48dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="48dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@+id/webView"
        app:layout_constraintEnd_toEndOf="@+id/webView"
        app:layout_constraintStart_toStartOf="@+id/webView"
        app:layout_constraintTop_toTopOf="@+id/webView" />

  • Step 2 : Connect webview to Activity and load the URL in it

webView = findViewById(R.id.webView)
progressBar = findViewById(R.id.progressBar)
val webSettings: WebSettings = webView.settings


webSettings.javaScriptEnabled = true // Enable JavaScript (optional)


webView.webViewClient = object : WebViewClient() {
            @SuppressLint("NewApi")
            override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
                super.onPageStarted(view, url, favicon)
                progressBar.visibility = View.VISIBLE
            }


            @SuppressLint("NewApi")
            override fun onPageFinished(view: WebView?, url: String?) {
                super.onPageFinished(view, url)
                progressBar.visibility = View.GONE
            }
        }
webView.loadUrl("URL From Sales Assist Dashboard")

PreviousIOS SDKNextHow to delete my account?

Last updated 1 year ago

Was this helpful?