Install and Configure
This section contains how you can embed Channelize.io powered real-time messaging to your Android applications using Channelize.io Android API SDK.
NOTE: Here is an integration sample app that you should refer to make Channelize.io integration easier for you. Check it here Channelize.io Integration App.
Install and configure Android API SDK
Step 1: Create an application on Channelize.io
To initialize SDK you need to pass the Public Key of your application, which you will get from the Channelize.io dashboard under My Account > Application Settings for the respective application.
Step 2: Install the SDK
To install the SDK using .gradle, add the following lines to a build.gradle file at the app level.
dependencies {
implementation 'com.github.ChannelizeIO.Channelize-Android-SDK:channelizeapi:4.3.3'
}
Add below code at project level build.gradle file:
buildscript {
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.0.0'
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
maven { url "https://jitpack.io" }
}
}
Step 3: Grant system permissions
To use all features of Android API SDK grant system permissions by adding the below lines of code to the AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Add Google Places API KEY and Giphy API_KEY to the AndroidManifest.xml
file if you want to use the location sharing feature and Sticker/GIF feature.
<meta-data android:name="com.google.android.geo.API_KEY" android:value="API_KEY" />