TeleMessage Android SDK
Version Control Information:
Version
|
Date
|
Author
|
Changes
|
1.0
|
19/Dec/2016
|
Ori Solomon
|
Original version
|
1.1
|
02/Jan/2017
|
Ori Solomon
|
Customization section
|
1.2
|
09/Feb/2017
|
Ofer Dangoor
|
Reformatting
|
|
|
|
|
|
|
|
|
|
|
|
|
Contents
1.General 3
2.Setting up your project in Firebase 3
3.Add the TeleMessage SDK library to your project using Android Studio 4
4.Modifying your build.gradle 7
5.GUI based SDK 8
a.Launching TeleMessage app 8
b.SDK Customization: Adding your own resources and changing the app’s colors 9
i.Drawables: 9
ii.Bubbles (9Patch): 11
iii.Colors: 12
6.Feature based SDK 13
a.Functionality 13
General
The SDK may be utilized as a full featured GUI supported library, or for methods utilization as a way to implement specific functionality of the service.
The TeleMessage SDK library supports Android version 4.1 and higher.
Setting up your project in Firebase
-
Go to the Firebase console:
https://console.firebase.google.com/
-
Click on ‘Create New Project’.
-
Insert your project name and choose a country. Click ‘Create Project’.
-
Click on ‘Add Firebase to your Android app’. Insert your package name and click ‘Add App’.
-
A file named ‘google-services.json’ was downloaded to your computer. Follow the directions on the Firebase console to add this file to your project and click ‘Continue’.
-
Follow the directions on the Firebase console to modify your build.gradle files and click ‘Finish’.
Add the TeleMessage SDK library to your project using Android Studio
-
Right click on your project in Android Studio and choose ‘Open Module Settings’:
-
Click on ‘+’ at the top left corner:
-
Choose ‘Import .JAR/.AAR Package’ and click ‘Next’:
-
Choose the TeleMessage SDK .aar file that you downloaded earlier and click ‘Finish’. A gradle sync will start automatically.
-
Click ‘OK’ to close the ‘Project Structure’ window.
Modifying your build.gradle
-
Open your app-level build.gradle file.
-
Under ‘android’, add the following lines:
dexOptions {
preDexLibraries = false
jumboMode = false
javaMaxHeapSize = “2048M”
}
-
Under ‘dependencies’, add the following lines:
compile ‘com.android.support:multidex:1.0.1’
compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-messaging:9.8.0'
compile project(‘:TeleMessageClientApp-telemessage-debug’)
-
At the end of the build.gradle file, add the following line:
Apply plugin: ‘com.google.gms.google-services’
-
Click ‘Sync Project with Gradle Files’.
*Note: If one or more of these lines already exist, do not add them again.
GUI based SDK
The GUI supported version enable you to utilize the full capabilities and design of the app.
Using the full GUI version is being done by calling the main activity of the TeleMessage app from the hosted app.
The TeleMessage app may be modified to use the hosted application branding as described below.
Launching TeleMessage app
Send your ‘google-services.json’ file to TeleMessage.
On your activity call TeleMessage splash screen:
Intent intent;
intent = new Intent(MainActivity.this, SplashActivity.class);
startActivity(intent);
MainActivity is the activity on your app that calls TeleMessage app
SDK Customization: Adding your own resources and changing the app’s colors
You can customize the SDK by overriding some of the drawables in the app. In order to do that, just replace the existing drawables.
Drawables:
Image
|
Drawable Name
|
Purpose
|
|
logo.png
|
sign up logo
|
|
icon_notification.png
|
notification icon
|
|
ic_logo.png
|
logo on thread header
|
|
conversation_list_bg.png
|
Conversation list background
|
|
chatbg.png
|
Chat list background
|
|
sky_blue_header.9.png (9Patch)
|
Actionbar image
|
|
land_bg.png
|
Landscape background
|
|
ic_actions_send.png
|
Send
|
|
ic_actions_send_down.png
|
|
ic_actions_sendic_actions_d.png
|
|
|
|
Bubbles (9Patch):
Image
|
Drawable Name
|
Purpose
|
|
balloon_blue.9.png
|
Outgoing
|
|
balloon_blue_press.9.png
|
|
balloon_blue_s.9.png
|
|
balloon_blue_s_press.9.png
|
|
balloon_white.9.png
|
Incoming
|
|
balloon_white_press.9.png
|
|
balloon_white_s.9.png
|
|
balloon_white_s_press.9.png
|
|
|
|
Colors:
To edit colors change the value on you colors.xml file.
Action bar background:
<color name="ColorPrimary">#ff0000color>
Pressable links inside messages:
<color name="link_color">#0096D4color>
ActionBar subtitle color:
<color name="subtitle_color">#000000color>
Feature based SDK
The feature based SDK enable you to build your own GUI and application logic while utilizing specific methods from the TeleMessage SDK.
Functionality
The SDK expose interface for the following functionalities:
-
Registration and Authentication – the SDK allow the developer to utilize 2 processes:
-
TeleMessage registration/ authentication process
-
Embedding within the customers’ registration/authentication process.
-
Send a message – utilize the SDK to send a message thru the TeleMessage servers
-
Receive a message – implement a broadcast listener to intercept the incoming messages
| Page
Share with your friends: |