Working with the Zoho GC SDK for Android - Online Help | Zoho Desk

Working with the Zoho GC SDK for Android

Mobile applications have proven to be a significant component of business with the advent of smartphones. Businesses offer a range of services through their mobile phone applications for better customer engagement. To improve users' interest in apps, developers endeavor to include top-notch customer service features.
The Guided Conversations (GC) mobile SDK for Android helps developers build a conversational self-service platform to achieve the best customer service. GC replaces human interactions with built-in conversations. It directs customers to appropriate solutions according to their responses during conversations. 

Setting up the SDK  

You need to integrate the GC widget within your Android app to create and register the add-on in Zoho Desk.
  1. In Zoho Desk, go to Setup > GENERAL > Guided Conversations.
  2.  In the Setup pane, on the left, under General, click Guided Conversations. Click GC Widgets.
    The GC Widgets pane will appear. It displays the created widgets. See more: how to create the widget.
  3.  Click the Share button () on the right side of the widget you want to embed. 
    A Share Options window will appear.
      4.      Click MOBILE SDK.

A new section called Code Snippet will appear. This section displays the following:
  • Org ID - Specifies the unique ID of the organization.
  • Widget ID - Specifies the unique ID of the selected widget.
  • Domain - Specifies the unique URL of your organization.
These details are essential for initializing the ZohoGCSDK in your app.

Integrating the SDK within the Android app  

After setting up the SDK, you need to integrate the ZohoGCSDK within the Android app using Maven.
To integrate the SDK within your app, include the following code in the root-level build.gradle file.
repositories {
maven { url 'https://maven.zohodl.com/' } 
maven { url 'https://downloads.zohocdn.com/wmslibrary' } 
}
Include the below dependency code in the dependencies section of the app level build.gradle file. 
dependencies {
implementation 'com.zoho.gc:chat:1.0.5'
}
The ZohoGCSDK is compatible with the following android versions
minSdkVersion = 21
compileSdkVersion = 33 
targetSdkVersion = 33 
kotlin_version = 1.5.20
Displaying Guided Conversations  
The following keys are essential to call the methods for displaying the conversation AI in your app.
  • orgId
  • widgetId
  • domain
The values of these keys appear under the Code Snippet section on the setup page of the ASAP add-on in Zoho Desk.  
SHOW BOT:
Kotlin
ZohoGC.getInstance(context).show(activity, orgId, widgetId, domain) 
Java
ZohoGC.Companion.getInstance(context).show(activity,orgId, widgetId, domain);

Setting up location block  

To enable location block, please follow the below steps:
1. Get the API key for Google Maps from Google.
    Learn how to get the API key from Google here.
2. Go to the Androidmanifet.xml file and add the below lines. Add the generated map API key as well. 
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_MAP_API_KEY" /> 
3. Open the strings.xml file and add the following line: 
<string name="zoho_gc_places_api_key">YOUR_MAP_API_KEY</string> 
Search option: 
The search option enables the user to search for a location and share it. This option will be displayed by default. If not required, follow the below method in your preferred language to hide it: 
Note: The "search option" for searching for an address is a paid service. 
 

  
Kotlin
ZohoGCUtil.setHideLocationSearch(true);
Java
ZohoGCUtil.setHideLocationSearch(true); 

Session Variables  

These variables are dynamically retrieved during the conversation. These variables are org-specific and accessible across flows.
Learn more: session variable
 
You can perform the following actions with the session variable:
Set Session Variable: 

Kotlin

val sessionVariableMap = HashMap<String, Any>()
sessionVariableMap.apply

      {
    this["name"] = "exampleName"
    this["value"] = "exampleValue"
}
      val sessionVariableList = ArrayList<HashMap<String, Any>>()
sessionVariableList.add(sessionVariableMap)
ZohoGC.getInstance(context).setSessionVariables(sessionVariableList)
Java
HashMap<String, Object> sessionVariableMap= new HashMap<>();
sessionVariableMap.put("name","exampleName");
sessionVariableMap.put("value","exampleValue");
ArrayList<HashMap<String,Object>> sessionVariableList= new ArrayList<>();
sessionVariableList.add(sessionVariableMap); 

Update Session Variable:   

Kotlin

val sessionVariableMap = HashMap<String, Any>()
sessionVariableMap.apply

       {
    this["name"] = "exampleName"
    this["value"] = "exampleValue"
}
      val sessionVariableList = ArrayList<HashMap<String, Any>>()
sessionVariableList.add(sessionVariableMap)
ZohoGC.getInstance(context).updateSessionVariables(sessionVariableList)
 Java
HashMap<String, Object> sessionVariableMap= new HashMap<>();
sessionVariableMap.put("name","exampleName");
sessionVariableMap.put("value","exampleValue");
ArrayList<HashMap<String,Object>> sessionVariableList= new ArrayList<>();
sessionVariableList.add(sessionVariableMap);

ZohoGC.Companion.getInstance(context).updateSessionVariables(sessionVariableList);

 Customizing the theme:  

You can also customize the default light and dark themes to make the SDK look more like your application.
Note: The default theme is the light theme. 
Kotlin
val light: ZDTheme = ZDTheme.Builder(false).build()	
Java
ZDTheme light = new ZDTheme.Builder(false).build();

 
If you want to switch the theme to dark mode, use the below method: 
Kotlin
val dark: ZDTheme = ZDTheme.Builder(true).build()
  Java
ZDTheme dark = new ZDTheme.Builder(true).build(); 
Theme Builder provides additional color customization options such as setColorAccent and setTextColorPrimary.


 

















Kotlin
        val light: ZDTheme = ZDTheme.Builder(false).build()
val dark: ZDTheme = ZDTheme.Builder(true).build()
ZohoGCUtility.themeBuilder = light 
Java
        ZDTheme light = new ZDTheme.Builder(false).build();
ZDTheme dark = new ZDTheme.Builder(true).build();
ZohoGCUtility.INSTANCE.setThemeBuilder(light);

Note: Updating the SDK's theme is different from setting a theme type. The SDK will either be in a dark or light theme, based on the theme type you have set.

Clearing local data 

Use the following method to delete any local data that has been saved inside the SDK, such as databases and files: 
Kotlin
ZohoGC.getInstance(context)
    .clearData(widgetId,object : ZDChatCallback.ZDClearDataCallback {
        override fun onSuccess() {}
        override fun onFailed(exception: Exception) {}
    })
Java
ZohoGC.Companion.getInstance(context).clearData(widgetId,new ZDChatCallback.ZDClearDataCallback() {
    @Override
    public void onSuccess() {

    }
    @Override
    public void onFailed(Exception exception) {

    }
});

SDK logging

By default, logs are disabled for the SDK. To get the debug logs printed in logcat, enable the logs by the following method: 
Kotlin
ZohoGC.getInstance(context).enableLog(true) 
Java
ZohoGC.Companion.getInstance(context).enableLog(true);

Release Notes

1.0.5

-Forced network protocol to use HTTP/1.1

1.0.4

-Enhanced visuals with a refreshed appearance.

-Resolved bugs and optimized performance for a smoother user experience.

-Expanded customization options with the introduction of new colors.

1.0_beta03 

-The location component was added. For more information, refer here.

1.0

-Will be required to call clearData method with widgetId.







    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION









                                      You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                          Manage your brands on social media

                                            Zoho Desk Resources

                                            • Desk Community Learning Series


                                            • Digest


                                            • Functions


                                            • Meetups


                                            • Kbase


                                            • Resources


                                            • Glossary


                                            • Desk Marketplace


                                            • MVP Corner


                                            • Word of the Day


                                              Zoho Marketing Automation

                                                Zoho Sheet Resources

                                                 

                                                    Zoho Forms Resources


                                                      Secure your business
                                                      communication with Zoho Mail


                                                      Mail on the move with
                                                      Zoho Mail mobile application

                                                        Stay on top of your schedule
                                                        at all times


                                                        Carry your calendar with you
                                                        Anytime, anywhere




                                                              Zoho Sign Resources

                                                                Sign, Paperless!

                                                                Sign and send business documents on the go!

                                                                Get Started Now




                                                                        Zoho TeamInbox Resources



                                                                                Zoho DataPrep Resources



                                                                                  Zoho DataPrep Demo

                                                                                  Get a personalized demo or POC

                                                                                  REGISTER NOW


                                                                                    Design. Discuss. Deliver.

                                                                                    Create visually engaging stories with Zoho Show.

                                                                                    Get Started Now









                                                                                                        • Related Articles

                                                                                                        • Working with the Zoho GC SDK for iOS

                                                                                                          Mobile applications have proven to be a significant component of business with the advent of smartphones. Businesses offer a range of services through their mobile phone applications for better customer engagement. To improve users' interest in apps, ...
                                                                                                        • Building the Guided Conversation flow

                                                                                                          A good practice to follow before setting out to build a conversation flow is to prepare a hand-written or digital outline of the conversation or process to ensure all the necessary inputs and outputs are in the right place in a sequential order. ...
                                                                                                        • Introducing ASAP Android SDK

                                                                                                          Equipping the Help Center services as widgets to deliver instant assistance to your customers The ASAP SDK for Android provides easy access to help your Android app's end users. Using this SDK, you can create and customize a help widget within your ...
                                                                                                        • Configuring Webhook Block in Guided Conversations

                                                                                                          The webhook block is one of the three action blocks available in Guided Conversations. This block enables the conversation flow to interact with Zoho Desk processes or other Zoho services or third-party services. The webhook block uses APIs from Zoho ...
                                                                                                        • FAQs: Basics of Guided Conversation

                                                                                                          What is Guided Conversations? Guided Conversations, also known as GC in Zoho Desk is a way to implement your self-service strategy. It is a GUI (Graphical User Interface) based, low-code, self-service platform aimed to deliver great customer ...
                                                                                                          Wherever you are is as good as
                                                                                                          your workplace

                                                                                                            Resources

                                                                                                            Videos

                                                                                                            Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                            eBooks

                                                                                                            Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                            Webinars

                                                                                                            Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                            CRM Tips

                                                                                                            Make the most of Zoho CRM with these useful tips.



                                                                                                              Zoho Show Resources