Add Talk Using Applozic in five mins – DZone Mobile
Add Talk Using Applozic in five mins
In this tutorial, you’ll learn how to use Applozic Talk SDK to add talk and in-app messaging to your android app in five mins.
Join the DZone community and get the utter member practice.
Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.
Overview
In this tutorial, you’ll learn how to use Applozic Talk SDK to add talk and in-app messaging to your android app in five mins.
What You’ll Learn
- Add WhatsApp like talk to your android app.
- Enabling 1-1 Talk, Group talk, Typing Indicator and File attachment
What You’ll Need
- Application Key from Applozic, you can get it free by signing up at https://www.applozic.com/signup.html
- The sample code.
- Android Studio.
What You’ll Get
- A finish talk solution with utter fledged UI.
- Source code of sample talk app.
- Talk UI layout with the demo design:
Instructions
Get the Sample Code
Clone the GitHub repository from the guideline line if you want to get began with a sample code:
Skip downloading the sample app code if you are integrating talk into your own application code.
Create Applozic Application
Sign up at Applozic to get the application key.
Gradle Dependency
Add the following in your build.gradle dependency
Add the following in gradle android target:
Add Permissions, Services, Receiver and Activities
Add the following Permissions, Activities, Services and Receivers in androidmanifest.xml
Note: Add meta-data,Activities,Services and Receivers within application Tag <application> </application>
Note: Add Permissions outside the application Tag <application>
Note: If you are not using gradle build you need to substitute $ with your Android app package name
Define Attachment Folder Name in your string.xml.
Broadcast Registration For PushNotification:
Note: If you are not using gradle build you need to substitute $ with your Android app package name
Paste the following in your androidmanifest.xml:
Substitute APP_PARENT_ACTIVITY with your app’s parent activity.
Login/Register User
Applozic creates a fresh user if the user doesn’t exist. userId is the unique identifier for any user, it can be anything like email, phone number, or uuid from your database.
If it is a fresh user, a fresh user account will get created else existing user will be logged in to the application.
Thrust Notification Setup
Go to Applozic Dashboard, Edit Application. Under Module section, update the GCM Server Key.
GCM Is Already Enabled in My App
If you already have GCM enabled in your app, then paste PushNotificationTask code at the place where you are getting the GCM registration id in your app.
Don’t Have GCM Code?
In case, if you don’t have the existing GCM related code, then copy the thrust notification related files from Applozic sample app to your project
And add this in your androidmanifest.xml file
Setup GCM in UserLoginTask "onSuccess".
After registering the project at https://console.developers.google.com, substitute the value of GCM_SENDER_ID in GCMRegistrationUtils.java with your own project gcm sender id. SenderId is a unique numerical value created when you configure your API project (given as "Project Number" in the Google Developers Console).
Receiving Shove Notifications
Add the following in your GcmListenerService onMessageReceived method.
Initiate Talk
For beginning the messaging activity:
For beginning individual conversation thread, set "userId" in intent:
Logout User
Call the following when user logout from your app:
Check Out Documentation for More Details:
The source code is also open source, you can download the source code from Github:
Congrats on completing talk integration using Applozic.
Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing – learn more in this white paper, brought to you in partnership with Sauce Labs.
Add Talk Using Applozic in five mins – DZone Mobile
Add Talk Using Applozic in five mins
In this tutorial, you’ll learn how to use Applozic Talk SDK to add talk and in-app messaging to your android app in five mins.
Join the DZone community and get the total member practice.
Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.
Overview
In this tutorial, you’ll learn how to use Applozic Talk SDK to add talk and in-app messaging to your android app in five mins.
What You’ll Learn
- Add WhatsApp like talk to your android app.
- Enabling 1-1 Talk, Group talk, Typing Indicator and File attachment
What You’ll Need
- Application Key from Applozic, you can get it free by signing up at https://www.applozic.com/signup.html
- The sample code.
- Android Studio.
What You’ll Get
- A finish talk solution with total fledged UI.
- Source code of sample talk app.
- Talk UI layout with the demo design:
Instructions
Get the Sample Code
Clone the GitHub repository from the directive line if you want to get embarked with a sample code:
Skip downloading the sample app code if you are integrating talk into your own application code.
Create Applozic Application
Sign up at Applozic to get the application key.
Gradle Dependency
Add the following in your build.gradle dependency
Add the following in gradle android target:
Add Permissions, Services, Receiver and Activities
Add the following Permissions, Activities, Services and Receivers in androidmanifest.xml
Note: Add meta-data,Activities,Services and Receivers within application Tag <application> </application>
Note: Add Permissions outside the application Tag <application>
Note: If you are not using gradle build you need to substitute $ with your Android app package name
Define Attachment Folder Name in your string.xml.
Broadcast Registration For PushNotification:
Note: If you are not using gradle build you need to substitute $ with your Android app package name
Paste the following in your androidmanifest.xml:
Substitute APP_PARENT_ACTIVITY with your app’s parent activity.
Login/Register User
Applozic creates a fresh user if the user doesn’t exist. userId is the unique identifier for any user, it can be anything like email, phone number, or uuid from your database.
If it is a fresh user, a fresh user account will get created else existing user will be logged in to the application.
Shove Notification Setup
Go to Applozic Dashboard, Edit Application. Under Module section, update the GCM Server Key.
GCM Is Already Enabled in My App
If you already have GCM enabled in your app, then paste PushNotificationTask code at the place where you are getting the GCM registration id in your app.
Don’t Have GCM Code?
In case, if you don’t have the existing GCM related code, then copy the thrust notification related files from Applozic sample app to your project
And add this in your androidmanifest.xml file
Setup GCM in UserLoginTask "onSuccess".
After registering the project at https://console.developers.google.com, substitute the value of GCM_SENDER_ID in GCMRegistrationUtils.java with your own project gcm sender id. SenderId is a unique numerical value created when you configure your API project (given as "Project Number" in the Google Developers Console).
Receiving Thrust Notifications
Add the following in your GcmListenerService onMessageReceived method.
Initiate Talk
For embarking the messaging activity:
For commencing individual conversation thread, set "userId" in intent:
Logout User
Call the following when user logout from your app:
Check Out Documentation for More Details:
The source code is also open source, you can download the source code from Github:
Congrats on completing talk integration using Applozic.
Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing – learn more in this white paper, brought to you in partnership with Sauce Labs.