This is the developer guide for Chat SDK v1. The new Chat SDK v2 for Android is now available and is the recommended version to integrate Chat into your mobile app.
Remember The Date app
Chat SDK Sample app
The Chat SDK Sample application provides examples of using the SDK. You can download the source code on Artifactory and see how it all works.
Requirements for the Chat SDK Sample app
We recommend using Android Studio to build the sample app. Building the app was tested with the following software versions and API levels:
- Android Studio: 3.3.1
- Minimum API level: 16
- Target API level: 28
- Android Gradle plugin version: 3.2.1
Importing the Chat Sample app
Select File > Import in Android Studio and select Import Project. In the file chooser, navigate to where you extracted the sample app's source code and select the build.gradle file at the top level of the directory structure.
Once installed, you may want to look at
EntryActivity.java, which is where you can see all the SDK components being used.
Configuring the sample app
Enter your Zendesk Chat account key into the AccountKey class under the ChatSample project module.
/** * Replace this key with your Zendesk Chat account key */ public static final String ACCOUNT_KEY = "your account key";
Because there are multiple samples of chat in the sample project, when you start a chat with the button 'Chat (Fragment)' you will see activities offering to handle
To configure the default intent receiver so that the choice is not shown in the sample set the intent-filter priority defined in the
<activity android:name=".SampleChatActivity" android:label="@string/app_name" android:theme="@style/ZopimChatTheme" android:windowSoftInputMode="stateUnspecified|adjustResize"> <!-- Increase the priority to receive RESUME_CHAT intent from the chat widget. ZopimChatActivity priority is -1000. To override set yours to -999 for instance. --> <intent-filter android:priority="-1000"> <action android:name="zopim.action.RESUME_CHAT"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity>
Sample apps Github repo
We have a Github repo containing several small demo apps built on top of the Zendesk mobile SDKs. Each sample is intended to show the smallest amount of code needed to achieve a complete functioning demonstration of a particular use-case or integration. The code is available on Github.