NAV

Overview

MegoChat is one of the module of MegoGrid. So here I am explaining what MegoChat is and how it works for an Android App Developer.

Now a days , Mobile Technology is becoming too vast for the ease of the world, keeping the KISS principle (Keep It Short and Simple), Developers are doing their best to make the world Techno Freak. As their time is too precious, Frameworks are being developed to save the time. So, Every developer needs details of their application users, by which they could kept record of each and every brief detail of their user, which he/she could use accordingly.

Now I am sure, Everybody have some questions in their mind, So lets start knowing What, Why and How? about MegoChat.

MegoChat Demo is an app which provides real time enviroment for singlechat, groupchat and chatrooms. This app is available in Google Play and its source code available on Github.You can take all reference of source code and how we integrate a power platform of Mego Chat to initiate chatting in any of the described chat type said earlier.In this document we will represent and guide you how we can integrate Mego Chat to an App and how this power framework makes chat mechanism so simple whether it is registered by our MegoUser SDK or any custom self registration provided by you. (How you can integrate your self registration mechanism with this module is described later in this document).

This tutorial is divided into several parts, each focusing on a different aspect of our Mego Grid Demo App. Feel free to read them in any order, but we recommend that you download the source code and refer to it while reading. Some parts of the code were omitted or changed in this tutorial in order to keep it clear and concise, so you may find it useful to keep the full version close at hand.

MegoChat demo architecture

MegoChat contains two main activities: SplashActivity which intializes configuration process that takes around 5 Seconds,MainActivity shows the number verification prompt, where user needs to enter his/her valid phone number. If the entered number is valid then user will get an OTP (One Time Password). If the currently used device contains the same phone number it will be auto filled into the respective field, otherwise he has to manually enter the OTP. After entering the OTP it will take few seconds to authenticate the user with our server and he will be redirected to the chat screen.

Aside from basic functinality we had integrate our MeGoGrid Api in differnt section of application

Getting Started

Authorization

To use the MegoChat SDK first of all you need to authenticate your application/device with our server. So to authenticate your application/device use the Authentication-Layer SDK and call the below mentioned code in your app launcher Activity.

Integrating Authorization SDK in your Android app

Inside the onCreate() method of your SplashActivity configure MegoAuthorizer SDK .

MegoAuthorizer megoAuthorizer = new MegoAuthorizer(SplashActivity.this);
megoAuthorizer.intializeSDK();

Authentication

The MegoGrid Demo app represents here the use of MegoChat SDK. MegoChat use the two way mechanism to the user to register his/her device/application on our server. These are as described below:

Here we have provide the integration of MegoChat with option one described above along with MegoUser SDK.

Integrating MegoChat SDK in your Android app

Before integrating MegoChat SDK you have to configure the required details on our MegoGrid CMS Panel provided to you by us for MegoUser SDK and MegoChat SDK both. Here you have to provide the SMS option, a user of your app will have for registration of their devices/application.

For this Demo App we have already configured all the detials (dummy configuration) so that you can download and check how this unique system works or you can check if it suits your developemnt need.

Below are the step by step guide how we have integrated this SDK into our Demo app inside onCreate() method of our MainActivity

1.Call the below code inside the onCreate() method of your app MainActivity and initiate the MeUserSDK.

 new MeUser.getInstance(SplashActivity.this)
                .initSDK();

After that you have to call the below code to initiate the MegoChat SDK:

Chat

Overview

In this demo app we have represent following types of chats which is represent in this demo application of chat

To intiate chatting in demo application we have call this method in MainActivity “s oncreate method as

MegoChat chatApi= MegoChat.getInstance(SplashActivity.this);
chatApi.setChatHeaderName("Chat Demo”);
chatApi.initConfiguration();

This part of stuff and now chat demo app is ready





© 2015-2016 Megogrid Inc. / Term of service / Licenses / Privacy Policy 913 N Market Street Suite 200 Wilmington DE 19801 USA