Faster Integration with UI KitsIf you’re using CometChat UI Kits, voice and video calling can be quickly integrated:
- Incoming & outgoing call screens
- Call buttons with one-tap calling
- Call logs with history
Add the CometChat Dependency
Step 1: Add Repository
Add the CometChat repository URL to your project levelbuild.gradle file in the repositories block:
- Groovy
- Kotlin DSL
Step 2: Add Dependencies
Add the Calls SDK dependency to your app levelbuild.gradle file:
- Groovy
- Kotlin DSL
Step 3: Configure Java Version
Add Java 8 compatibility to theandroid section of your app level build.gradle:
- Groovy
- Kotlin DSL
Add Permissions
Add the required permissions to yourAndroidManifest.xml:
For Android 6.0 (API level 23) and above, you must request camera and microphone permissions at runtime before starting a call.
Initialize CometChat Calls
Theinit() method initializes the SDK with your app credentials. Call this method once when your application starts, typically in your Application class or main Activity.
CallAppSettings
TheCallAppSettings class configures the SDK initialization:
- Kotlin
- Java
Check Initialization Status
You can verify if the SDK has been initialized using theisInitialized() method:
- Kotlin
- Java