LogoLogo
LogoLogo
  • Adding Quack AI to your website
  • Adding Quack AI to you Help center
    • Document 360
  • Ticketing system
    • Overview - Ticketing systems
    • Zendesk
      • Setup ongoing sync
    • Front - setup ongoing sync
    • Freshdesk
    • Hubspot
  • API
    • Generating response using Quack AI
  • Chat
    • Connecting Quack AI to Zendesk Conversations API
    • Connecting Quack AI to Salesforce
  • Mobile
    • Adding Quack AI to your Swift app
    • Adding Quack AI to your Android App
    • Adding Quack AI to your React Native app
Powered by GitBook
On this page
  • Step 1: Add the Webview to your Layout
  • Step 2: Configure your Activity
  • Step 3: Pass in Metadata

Was this helpful?

  1. Mobile

Adding Quack AI to your Android App

There are plenty of resources online about adding a WebView to Android so this guide will focus primarily on what to put in your WebView!

Step 1: Add the Webview to your Layout

Go to your app's layout file (e.g., activity_main.xml) in the res/layout folder. Then, add the WebView Widget. For example:

<WebView
    android:id="@+id/webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

Step 2: Configure your Activity

Open the Java/Kotlin Activity File: For example, MainActivity.java or MainActivity.kt Then, initialize WebView:

  • Java:

javaCopy codeWebView myWebView = (WebView) findViewById(R.id.webview);
  • In Kotlin:

kotlinCopy codeval myWebView: WebView = findViewById(R.id.webview)

Finally, point the Webview to your unique URL that contains your mobile chat AI

myWebView.loadUrl("https://m.thequack.ai/sdk/<YOUR_TOKEN>");

Step 3: Pass in Metadata

You may pass in arbitrary, unique information about the user as metadata by adding URL params to the URL. This metadata will be saved along with each conversation. User ID is what unique identifies a user and allows conversation history to be saved across sessions. For example:

myWebView.loadUrl("https://m.thequack.ai/sdk/<YOUR_TOKEN>?userId=...&email=...");

That's it! You may find more in-depth guides on adding WebViews in Android on the internet if you need further assistance.

PreviousAdding Quack AI to your Swift appNextAdding Quack AI to your React Native app

Last updated 10 months ago

Was this helpful?