Overview
VoxSDK/ConnectSDK is a client-side SDK for Android to enable Voice, Video, Messaging, Presence, Collaboration & more using Vox CPaaS platform.
ConnectSDK offers a simple and intuitive programming interface. Developers can use APIs, SDKs to quickly integrate below rich communication features into their mobile & web apps.
User Account Management: Manage users - user creation, validation using OTP, user login.
Multi Device Support: Users can login from multiple devices (iOS, Android & Web) using single login credentials. All devices will be synced.
Voice Calling: Voice calling between App, App to PSTN & PSTN to App.
Video Calling : High-quality video calls between app users
Instant Messaging : Personalized (one-one) chats and group chats, Sent/Delivered/Read reports, Typing Indicator, Send (photos, videos, documents, contact, location, …), Unicode support
Presence : Online / Offline presence and the last seen time
Contacts & Groups : Manage contacts, groups and user profile
History : All call and chat history are saved in device and can be retrieved by the app
Push Notifications : Notifications to keep user updated even if they are not using the app or the device
Security : Secure and faster communication
Sample Apps
We have various sample apps to get you started quickly. They serve as a ready reference to know how to implement any particular feature.
You could download the source code for sample apps from GitHub here:
https://github.com/vox-cpaas-public/Android-Samples
Getting Started with ConnectSDK
Developer Console
Developer tools and configuration options for ConnectSDK can be found in the Developer Console. Use it to create apps, update push credentials, view logs, and much more.
The first step to getting started is to create an account on the Vox CPaaS Developer Console here:
https://developer.vox-cpaas.com/#/signup
Once you create an account, you will receive a verification email.
Click the link in the verification email, and then log into the Developer Console.
System Requirements
Connect SDK is supported on API Level 16 & above.
Configuration
ConnectSDK is distributed as a android archive library. The Release package will contain ConnectSDK and its dependency libraries.
Configuring steps
Step 1: Create a New project using Android Studio
Below android studio configuration best suits for sdk dependences.
Gradle Version: 5.4.1
Android Plugin Version: 3.5.0
Step 2: Add dependencies in apps gradle
implementation 'vox-cpaas:connectsdk:1.4.2.4'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
Step 3:
This step can be skipped if JCenter repository is used to include ConnectSDK as shown in step2
Download ConnectSDK from
https://github.com/vox-cpaas-public/Android-VoxSDK
and copy to app libs folder
Write repository as below
repositories{
flatDir{
dirs'libs'
}
google()
}
Add dependencies in apps gradle as below
implementation (name: ConnectSDK_Vx.x.x.x, ext:'aar')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
Step 4: Set compileSdkVersion to 29 and set buildToolsVersion 29
Example:
compileSdkVersion 29
buildToolsVersion '29'
Step 5: Enable multidex support for the application.
Set target version to 29.
Set minimum supported api version to 16
Example:
minSdkVersion 16
multiDexEnabled true
targetSdkVersion 29
Step 6: Add Below compileOptions
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Step 7: Override allowBackup in Manifest file
tools:replace="allowBackup"
android:allowBackup="false"
Step 8: Enable Push Notifications in the app with below configuration
In Project-level build.gradle add below dependency
classpath 'com.google.gms:google-services:4.2.0'
In App-level build.gradle enable the google-services plugin
apply plugin: 'com.google.gms.google-services'
Place google-services.json file in the app/ directory.google-services.json file can be get by creating a Firebase Project
Server key which can be get from Firebase project console and app package name,should be provided in Application Dashboard in the back end
implement fcm services in the app
App should call
processPushMessage
or
processInstanceID
when ever a new push message arrives or fcm token refreshes
Step 9: To enable proguard Please add the following lines in the proguard rules.
-dontwarn com.google.firebase.messaging.**
-dontwarn org.joda.convert.**
-dontwarn org.joda.time.**
-keep class org.joda.time.** { *; }
-keep interface org.joda.time.** { *;}
-dontwarn org.webrtc.**
-keep class org.webrtc.** { *; }
-keepnames class com.amazonaws.** { *; }
-dontwarn com.amazonaws.**
-keep public class org.slf4j.** { *; }
-keep public class ch.** { *; }
-dontwarn java.awt.**
-dontwarn java.beans.Beans
-dontwarn javax.security.**
-keep class javamail.** {*;}
-keep class javax.mail.** {*;}
-keep class javax.activation.** {*;}
-keep class com.sun.mail.dsn.** {*;}
-keep class com.sun.mail.handlers.** {*;}
-keep class com.sun.mail.smtp.** {*;}
-keep class com.sun.mail.util.** {*;}
-keep class mailcap.** {*;}
-keep class mimetypes.** {*;}
-keep class myjava.awt.datatransfer.** {*;}
-keep class org.apache.harmony.awt.** {*;}
-keep class org.apache.harmony.misc.** {*;}
Now App is ready to use all features of ConnectSDK.
Step 10: Permissions and Explicit Broadcast Receivers
Below are the permissions that app need to get from user
CAMERA,READ_CONTACTS,RECORD_AUDIO,READ_PHONE_STATE,WRITE_EXTERNAL_STORAGE
App need to register explicit broadcast receivers with the sdk (see
registerExplicitEventReceivers
) for certain events and need to exclude those receivers from proguard
Step 11: Application class
App can extend
App
class to use Application class
Step 12: Third party libs and dependencies
If any third party library or App uses same library dependency as used in ConnectSDK thus giving errors like 'Program type already present',It would be suggestible to add ConnectSDK as module dependency instead library dependency
If any third party library or App depends on .so files,app optionally can enable building multiple APKs i.e one apk per ABI.ConnectSDK supports following archs
arm64-v8a
armeabi
armeabi-v7a
x86
x86_64