Google Cloud Messaging Talk delivered by Mr.Prajyot Mainkar ( C.E.O, SPM Softwares) at Droidcon 2012,Bangalore under the topic name "Deep Dive in GCM".
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Deep Dive into GCM Architecture and Features
1. Deep Dive in
GCM
Google Cloud Messaging for Android
By – Mr.Prajyot Mainkar ( @prajyotm)
Founder & C.E.O, SPM Softwares & Designers,
Android Developer and Editor in Chief – Androcid.com
2. SO WHAT’s IN PLATE
KEY TOPICS
Topics Time Duration
Introduction 5 mins
C2DM to GCM Migration 15 mins
About GCM Features 10 mins
4. POLLING
Key Points
1. Simple to Implement
2. Device Periodically Asks Server For New Data
3. Used widely where the content changes constantly
Any New Updates?
No
Any New Updates? Publisher/Centr
No al Server
Any New Updates?
Yes
Smartphone
6. Pushing
Minimizing pain of Regular Updates
Push Technology or Server Push Defines type of internet
based communication where request for transaction is
initiated by publisher/server
1. Constant Connection
2. Less Battery Consumption
3. Harder to implement
Data Publisher/Centr
al Server
Smartphone
7. What is GCM ?
Breaking the ice
Google Cloud Messaging for Android (GCM) is a service that
helps developers send data from servers to their Android
applications on Android devices.
The GCM service handles all aspects of queueing of messages
and delivery to the target Android application running on the
target device.
4.7 Millisecond* – when GCM receives the message till the time
GCM sends the message. ( 1/10th sec globally )
9. The Focus
The focus of GCM is as follows:
1.Ease of use.
2.No Buggy sign-up forms.
3.Limitless Quotes (unlike C2DM)
4.GCM and C2DM stats are available through the Android
Developer Console.
5. Battery efficiency.
6. Rich set of new APIs.
10. GCM Registration
ABC News Server GCM
3. ID
Re n
io n
gi rat tio
s tra gist ra
s t es t
ti o Re gi u
e q
n
ID 2. . R Re
1
4.Message Received by the
Device from the server
11. GCM Uninstall State
ABC News Server GCM
Device Not
Registered
er
rv
Se
e
th
y
ti f
No
Uninstalled App
18. … And they are Different
1. Simple API Key
2. Sender ID
3. JSON format
4. Multicast messages
5. Multiple senders
6. Time-to-live
7. Messages with payload
8. Canonical registration ID
23. Message with payload
ABC News Server GCM
Full Sync
•Up to 100 messages before initiating full sync
•4K size per message
Mobile Application
24. GCM Reliability
Ensuring Data Containership RMQ
GCM
RMQ GCM
Re-Connects when Device is
Message Lost Due to Offline Online
Device
ACK Bunch
News App News App
25. GCM Optimization
4K
World cup Server GCM
4K 8K
4K 8K 16K
World Cup App
26. GCM Optimization
Delete All The
4K Messages
World cup Server GCM
4K 8K
4K 8K 16K
Sync-Process
World Cup App
27. PEEKING UNDER THE HOOD
Cautious Points
Feature Feature Description
Background Service Honor Background settings, start when network is available
Heartbeats Maintain persistent connection with server - Use Heartbeats
to detect dead connections
Collapse Keys Latest messages replace the old ones with same key
Efficiency Minimize Heartbeat frequency, concurrent connection and
per connect over head
Attenuation Messages may not be delivered to app immediately, so
avoid constant radio wake up
Delay While Idle Device tells app server when the screen is off.
Screen off == Device Idle
Avoid Wake up of the device with unnecessary updates
28. GET IN TOUCH
CONTACT US
http://facebook.com/prajyotmainkar
http://twitter.com/prajyotm
http://linkedin.com/in/prajyotm
+ Prajyot Mainkar
Phone: +91-9822987513
Email: prajyotm@msn.com