Research Article Impact Factor: 4.226 ISSN: 2319-507X

Research Article
Impact Factor: 4.226
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
ISSN: 2319-507X
IJPRET
INTERNATIONAL JOURNAL OF PURE AND
APPLIED RESEARCH IN ENGINEERING AND
TECHNOLOGY
A PATH FOR HORIZING YOUR INNOVATIVE WORK
ANDROID CLOUD TO DEVICE MESSAGING TECHNOLOGY
ASHVINI K. CHATULE1, DR. G. R. BAMNOTE2
1. M.E. 1st year, Computer Science & Engineering. Prof. Ram Meghe Institute of Technology & Research, Badnera.
2. Professor & HOD, Computer Science & Engineering, Prof. Ram Meghe Institute of Technology & Research, Badnera.
Accepted Date: 05/03/2015; Published Date: 01/05/2015
Abstract: Google Cloud Messaging for Android (GCM) is a service that helps developers to
send data from servers to their Android applications on Android devices. The service
provides a simple, lightweight mechanism that servers can use to tell mobile applications to
contact the server directly, to fetch updated application or user data. The C2DM service
handles all aspects of queuing of messages and delivery to the target application running on
the target device. The GCM service handles all aspects of queuing of messages and delivery
to the target Android application running on the target device. It is completely free whatever
your messaging needs are and it can be used in some applications like smart notification
systems.
Keywords: Cloud Computing; Android; Push Messaging; C2DM
\
Corresponding Author: MR. ASHVINI K. CHATULE
Access Online On:
www.ijpret.com
How to Cite This Article:
PAPER-QR CODE
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
Available Online at www.ijpret.com
555
Research Article
Impact Factor: 4.226
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
ISSN: 2319-507X
IJPRET
INTRODUCTION
Google Cloud Messaging (GCM) is a free service that helps Android developers to send data
from servers to their Android applications, and upstream messages back to the cloud from the
user’s device. This can be a lightweight message telling the Android app that there is a new data
to be fetched from the server or it can be a message containing up to 4kb of payload data. The
GCM service handles all the aspects of queuing of messages and delivery to the target Android
application running on the target device. Google Cloud Messaging have been announced last
year as a replacement of Google Cloud to Device Messaging. This is a service that allows mobile
developer to notify mobile devices (but also Chrome browser) about important changes on the
server-side component of the application. It makes it possible for the device to stay up to date,
without the need to use polling .Polling is about checking periodically for updates on your
server and is bad for several reasons:
 It consumes lot of battery, periodically waking up the mobile device network stack.
 It consumes a lot of useless resources on the server as most of this resource lead to a "no
update reply"
 It introduces latency as the request for new data can happen long after the data availability
Push notification avoid all those drawbacks, saving battery life, providing lower lattency,
reducing server load. As a permantely connected session to Google server, it get the important
notification messages as soon as they happen, in a battery efficient way. Being a service that
runs at device level, it can be optimized across application running on the same device and
perform further battery saving benefits.
1.1 About Android:
Android is a Linux-based operating system for mobile devices such as smart phones and tablet
computers. It is developed by the Open Handset Alliance, led by Google, and other companies.
Google purchased the initial developer of the software, Android Inc., in 2005. The unveiling of
the Android distribution in 2007 was announced with the founding of the Open Handset
Alliance, a consortium of 86 no of hardware, software & telecommunication companies
devoted to advancing open standards for mobile devices. Android has a large community of
developers writing applications (”apps”) that extend the functionality of the devices. Due to the
nature of being open source, Android is not limited to any device manufacturer or service
provider.
Available Online at www.ijpret.com
556
Research Article
Impact Factor: 4.226
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
ISSN: 2319-507X
IJPRET
2. Cloud to Device Messaging:
Cloud to Device Messaging (C2DM) was made available from Android 2.2, where the goal was
to make it easier for mobile applications to sync data with servers. The technology is used in
several standard Google applications including
Gmail, Contacts and Calendar. When messages are received on the Android client, the system
will wake up the application via an Intent broad-cast, and pass the message data.
The message limit is set to 1024 bytes and developers are encouraged to send short messages,
essentially notifying the mobile application that updated information can be retrieved from the
server. C2DM is a free service, and the maximum number of messages that can be sent is
approximately 200,000 per day; however this can be in-creased if there is a need for more
resources. Google offers standard libraries for Android that makes it possible to use C2DM
directly.
3. Related Work:
a) Components: The physical items involved in the GCM steps

Mobile Devices: The device that is running an android application that uses GCM.

Third party application server : The third party application server sends data to an android
application on the device via GCM server

GCM Server: The Google server used in taking messages from third party application server
and sending them to a device.
b) Credentials: The IDs that are used in different stages of GCM to achieve the authentication,
and to be sure that the message is going to the correct application and the correct Android
device.

Sender ID - The sender ID is used in the registration process to identify a 3rd-party
application server that is permitted to send messages to the device.

Application ID - The Android application that is registering to receive messages.

Registration ID - An ID issued by the GCM servers to the Android application that allows it
to receive messages. Once the Android application has the registration ID, it sends it to the
Available Online at www.ijpret.com
557
Research Article
Impact Factor: 4.226
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
ISSN: 2319-507X
IJPRET
3rd-party application server, which uses it to identify each device that has registered to
receive messages for a given Android application.

Sender Auth Token - An API key that is saved on the 3rd-party application server that gives
the application server authorized access to Google services. The API key is included in the
header of POST requests that send messages
4. Architectural Overview:
How these components interact.
1. Messages from 3rd-party application servers are taken by Google-provided GCM
Connection Servers and sent to GCM-enabled Android application running on a device.
Currently, connection servers for HTTP and XMPP are provided by Google.
2. The 3rd Party Application Server is a component which we implement to work with our
chosen GCM connection server(s). App servers send messages to GCM connection server;
the connection server queues and stores the message, and then sends it to the device when
the device is online.
3. The Client App is a GCM-enabled Android application running on a device. This app must be
registered with GCM and have a registration ID to receive GCM messages. The client app
can send “upstream” messages back to the connection server if we are using XMPP (CCS)
connection server.
Fig: Architectural Overview
Available Online at www.ijpret.com
558
Research Article
Impact Factor: 4.226
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
ISSN: 2319-507X
IJPRET
4.1 Life Cycle Flow:

Enable GCM - Android application running on a mobile device registers to receive messages.

Send A Message - A 3rd-party application server sends messages to the device.

Receive A Message - Android application receives a message from GCM server.

Enable GCM
To use the messaging service on Android application for the first time, it needs to call the
Google Cloud Messaging method register (). The register () method returns a registration ID
which should be stored by our Android application for later use.

Send A Message: Here is the sequence of events that occurs when the application server
sends a message.

Message is sent to GCM servers by the application server.

Google enqueues and stores the message in case the device is offline.

When the device is online, Google sends the message to the device.

On the device, the system broadcasts the message to the specified Android application via
Intent broadcast with proper permissions, so that only the targeted Android application
gets the message. This wakes the Android application up. The Android application does not
need to be running beforehand to receive the message.

The Android application processes the message. If the Android application is doing nontrivial processing, you may want to grab a Power Manager Wake Lock and do any
processing in a service.

Receive A Message: This is the sequence of events that occurs when an Android application
installed on a mobile device receives a message.

The system receives the incoming message and extracts the raw key/value pairs from the
message payload, if any.

The system passes the key/value pairs to the targeted Android application in a
com.google.android.c2dm.intent.RECEIVE Intent as a set of extras.
Available Online at www.ijpret.com
559
Research Article
Impact Factor: 4.226
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
o
ISSN: 2319-507X
IJPRET
The
Android
application
extracts
the
raw
data
from
com.google.android.c2dm.intent.RECEIVE Intent by key and processes the data.
the
5. Characteristics of GCM:
The GCM service has many characteristics as described in:

It allows third party application servers (Java, Dot Net or even Php server) to send messages
to their Android applications.

Using the GCM Cloud Connection Server, you can receive upstream messages from the
user’s device.

An Android application on an Android device doesn’t need to be running to receive
messages. The system will wake up the Android application via Intent broadcast when the
message arrives, as long as the application is set up with the proper broadcast receiver and
permissions.

It does not provide any built-in user interface or other handling for message data. GCM
simply passes raw message data received straight to the Android application. Handling data
is up to the developer.

For example, the application might post a notification, display a custom user interface, or
silently sync data.

It requires devices running Android 2.2 or higher that also have the Google Play Store
application installed, or an emulator running Android 2.2 with Google APIs.

It uses an existing connection for Google services. For pre-3.0 devices, this requires users to
set up their Google account on their mobile devices. A Google account is not a requirement
on devices running Android 4.0.4 or higher.
6. CONCLUSION:
Update to Google Cloud Messaging is really a big update for developers, increasing the number
of situation this platform is relevant. There is work going on supporting those improvements on
our push notification platform to help you all benefits of those improvements. Stay tuned for
more information on this support very soon. As a future work, investigate other push
notification options available for Android including Extensible Messaging and Presence Protocol
Available Online at www.ijpret.com
560
Research Article
Impact Factor: 4.226
Ashvini K. Chatule, IJPRET, 2015; Volume 3 (9): 555-561
ISSN: 2319-507X
IJPRET
(XMPP) [20], and Message Queue Telemetry Transport (MQTT) in terms of performance and
energy efficiency, and compare them with GCM for time sensitive app scenarios.
REFERENCES:
1. “Google Cloud Messaging for Android — Android Developers.” [Online]. Available:
http://developer.android.com/google/gcm/index.html
2. http://developer.android.com/google/gcm/gcm.html
3. http://www.codeproject.com/Articles/102065/Android-A-beginner-s-guide,
4. http://en.wikipedia.org/wiki/Android_Cloud_to_Device_Messaging_Service
5. http://en.wikipedia.org/wiki/Android_(operating_system).
6. https://developers.google.com/android/c2dm
Available Online at www.ijpret.com
561