CometChat Pro enables you to add voice, video & text chat for your website & app.
This guide demonstrates how to add chat to an Android application using CometChat Pro. Before you begin, we strongly recommend you read the Key Concepts guide.
Signup for CometChat and then:
- Create a new app: Enter a name & hit the + button
- Head over to the API Keys section and note the API Key and App ID (for Auth Only key)
- Download the latest aar file.
- Navigate to your project in Android Studio.
- Click on File and select New -> Module
- Now select Import.JAR/AAR package from the available options.
- Specify the path to the .aar file dowloaded earlier.
- Now open the app level build.gradle file and under the dependencies section add the below line:
implementation project(path: ':pro-android-chat-sdk-$version')
where $version is the version of the aar downloaded.
Now that the CometChat module is successfully added to your project, you need to follow the below steps to add CometChat Pro dependency bundle to your project.
- Open the project level build.gradle file and in the
repositories
section underallprojects
add the below line:
allprojects {
repositories {
maven {
url "https://dl.bintray.com/cometchat/pro"
}
}
}
- Now open the app level build.gradle file and add the below line under the
dependencies
section:
implementation 'com.cometchat:dependencybundle:2.0.0'
If you do not wish to add the CometChat Pro dependency as a module, you can directly add the CometChat Pro SDK to your project using gradle. You can refer to the below link for instructions on how to do so:
https://prodocs.cometchat.com/docs/android-quick-start#section-add-the-cometchat-dependency
Please refer to our Developer Documentation for more information on how to setup the CometChat Pro SDK and implement various features using the same.