SlideShare una empresa de Scribd logo
1 de 29
Introduction to Android

Google Cloud Messaging
                          Amrit Sanjeev
             Organizer – Bangalore Android User Group
About me



• Android hacker.

• Organizer, Bangalore Android User
  Group ( www.blrdroid.org )

• Research Engineer at Philips R&D
Bangalore Android User Group ( www.BlrDroid.org)

• Largest open Android developer community in
  the country and second largest in the world.

• Over 2500 members

• 19 meetups

• 3 hackathons

• Active participation in events like Droidcon,
  Global Android Developer hackathon etc
What we will be discussing today.


             Why do we          How it is
  What is                     implemented ?
  GCM?       need GCM?




                         Google Cloud Messaging
What is GCM?



               Google Cloud Messaging
GCM definition

GCM stands for Google Cloud Messaging .

It is a free service that allows developers to send
 data from third party servers to their applications
 running on android devices

Handles queuing of messages and delivery to the
 target application running on the target device.

Intended use is not to send huge amount of data to
 the client device
Things to keep in mind
   Application on the android device DOES
   NOT need to be running to receive
   messages.


   Requires user to set up a Google account
   on the device.



   It is purely a routing component



   There is no guaranteed delivery of
   messages to the device .
Focus of GCM



                                              GCM stats are
 Ease of use. No                             available through
                           No quotas.
  sign-up forms.                               the Android
                                            Developer Console.



                                   Rich set of new
           Battery efficiency.
                                        APIs
Difference between GCM and C2DM

  Simple API Key from Google
  APIs console page.


  Sender id is the project id rather
  than email address


  Supports data in JSON format
  and plain text
Difference between GCM and C2DM

  Multicast message support


  Multiple senders


  Messages have time to live ( 0 ~
  4 weeks ) eg. Expiring invitations


  Payload up to 4kb
Why do we need GCM?



                The why part
The need to use GCM

Client server architecture is the most
 common architecture .
  Most application do all the heavy lifting and
   processing at the servers and then use the
   processed data within the applications .
Scalability & extensibility
More computing power
The need to use GCM

Background process polling server for
 information at regular intervals is a bad
 design
  Battery performance
  System resource usage ( memory , CPU )
  Complicated coding


Application does not need to be running in
 the background for receiving data messages.

Lower cost and better tracking than SMS.
The need to use GCM



Less coding required
  Not need to worry about queuing of
   messages
  Differed delivery


Simpler application flow
The need to use GCM




 In a nutshell it makes application design
   much more simple, improves battery
  performance and makes better use of
           system resources .
How it is implemented?



                 The internals
Major components



       Your application server

         GCM servers

       Mobile device
Typical sequence of events

                                          The application
                                          server sends a
                                         message to GCM
                                             servers.




                                                                        Google queues
            The Android
                                                                         and stores the
            application
                                                                        message in case
           processes the
                                                                          the device is
             message
                                                                             offline.




                     On the device,
                       the system
                                                            When the device
                     broadcasts the
                                                            is online, Google
                     message to the
                                                                sends the
                    specified Android.
                                                             message to the
                     This wakes the
                                                                 device.
                         Android
                     application up.
Minimum requirements ( device side )

Android 2.2 +

Android market place should be installed

Emulator with Google APIs

Internet connection

Google account ( device version < 4.0.4 )
.
Minimum requirements ( server side )

HTTPS application server that should be
  Able to communicate with your client.
  Able to fire off HTTP requests to the GCM
   server.
  Able to handle requests and queue data as
   needed. For example, it should be able to
   perform exponential back off.
  Able to store the user device registration id .
Android application



  Copy the                Add a               Wire it up
  required              broadcast              in your
    libs                 receiver              activity
              Make
                                    Add an
             changes
                                     Intent
              to the
                                    service
             manifest
Alternate Infrastructures


• Alternative to GCM is required under
  following conditions
   Limited connectivity to internet services
   Security requirement
   Guaranteed delivery
   SLAs on delivery
   No quota limits
• Downsides
   Complicated design
   Battery consumption on device is higher.
Thank you
In case you have more queries please feel free to contact
     Amrit.sanjeev@gmail.com (+91 97407 44557 )
                    @amsanjeev
BACKUP SLIDES
Add required libs



Install Google Cloud Messaging for
 android using SDK manager.

Copy gcm.jar from
  YOUR_SDK_ROOT/extras/google/gcm-client/dist to
  libs in your project folder
Changes to Manifest file

Add <use-sdk … >
Declare & use a custom permission
Add additional permissions
   internet
   get_accounts
   wake_lock
Write Intentservice

 subclass of
 com.google.android.gcm.GCMBaseIntentService
 must contain a public constructor,
 Generally named my_app_package.GCMIntentService
 Override the following functions with appropriate logic
   onRegistered
   onUnRegistered
   onMessage
   onError
   onRecoverableError
Add boardcast receiver

 add a broadcast receiver with the custom
 permissions and following actions
   <action android:name="com.google.android.c2dm.intent.RECEIVE" />
   <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

Should be defined in the manifest and not
 programmatically
Finally the activity

CheckDevice ()
CheckManifest()
getRegistrationId()
Register()

Más contenido relacionado

La actualidad más candente

Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging Sandip Jadhav
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentationNiraj Singh
 
GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017ketan Bordekar
 
Firebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to DeviceFirebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to DeviceTakuma Lee
 
GCM with Pushbots
GCM with PushbotsGCM with Pushbots
GCM with PushbotsAshish RAj
 
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew KurniadiID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew KurniadiDicoding
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messagingBhavana Sharma
 
Implementing Microservices Security Patterns & Protocols with Spring
Implementing Microservices Security Patterns & Protocols with SpringImplementing Microservices Security Patterns & Protocols with Spring
Implementing Microservices Security Patterns & Protocols with SpringVMware Tanzu
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big PictureSriyank Siddhartha
 
Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)brendankowitz
 
Intro To Serverless Architectures
Intro To Serverless ArchitecturesIntro To Serverless Architectures
Intro To Serverless ArchitecturesAdi Challa
 

La actualidad más candente (17)

GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentation
 
GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017
 
Firebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to DeviceFirebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to Device
 
Gcm tutorial
Gcm tutorialGcm tutorial
Gcm tutorial
 
Magda badita gcm
Magda badita  gcmMagda badita  gcm
Magda badita gcm
 
GCM with Pushbots
GCM with PushbotsGCM with Pushbots
GCM with Pushbots
 
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew KurniadiID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
 
Implementing Microservices Security Patterns & Protocols with Spring
Implementing Microservices Security Patterns & Protocols with SpringImplementing Microservices Security Patterns & Protocols with Spring
Implementing Microservices Security Patterns & Protocols with Spring
 
Firebase
FirebaseFirebase
Firebase
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big Picture
 
Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)Real time web applications with SignalR (BNE .NET UG)
Real time web applications with SignalR (BNE .NET UG)
 
Bulk SMS gateway integration in asp.net
Bulk SMS gateway integration in asp.netBulk SMS gateway integration in asp.net
Bulk SMS gateway integration in asp.net
 
Intro To Serverless Architectures
Intro To Serverless ArchitecturesIntro To Serverless Architectures
Intro To Serverless Architectures
 
Mule (aws)sns
Mule (aws)snsMule (aws)sns
Mule (aws)sns
 

Destacado

Google Cloud Messaging
Google Cloud MessagingGoogle Cloud Messaging
Google Cloud MessagingArvind Devaraj
 
Ankara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud Sunumu
Ankara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud SunumuAnkara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud Sunumu
Ankara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud Sunumuİbrahim Gürses
 
A Hybrid Cloud Approach for Secure Authorized De-Duplication
A Hybrid Cloud Approach for Secure Authorized De-DuplicationA Hybrid Cloud Approach for Secure Authorized De-Duplication
A Hybrid Cloud Approach for Secure Authorized De-DuplicationEditor IJMTER
 
Android Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App EngineAndroid Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App EngineLars Vogel
 
secure data retrieval for decentralized disruption-tolerant military networks
secure data retrieval for decentralized disruption-tolerant military networkssecure data retrieval for decentralized disruption-tolerant military networks
secure data retrieval for decentralized disruption-tolerant military networksswathi78
 
Akamai company profile
Akamai company profileAkamai company profile
Akamai company profilerahulp9999
 
Mobile Cloud Computing
Mobile Cloud ComputingMobile Cloud Computing
Mobile Cloud ComputingSimeon Oriko
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testingSoftheme
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobiGnosis
 
Mobile App Development- Project Management Process
Mobile App Development- Project Management ProcessMobile App Development- Project Management Process
Mobile App Development- Project Management ProcessBagaria Swati
 
5G Wireless Technology
5G Wireless Technology5G Wireless Technology
5G Wireless TechnologyNiki Upadhyay
 
cloud computing and android
cloud computing and androidcloud computing and android
cloud computing and androidMohit Singh
 

Destacado (17)

Google Cloud Messaging
Google Cloud MessagingGoogle Cloud Messaging
Google Cloud Messaging
 
Pitch that matters
Pitch that mattersPitch that matters
Pitch that matters
 
Ankara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud Sunumu
Ankara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud SunumuAnkara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud Sunumu
Ankara Cloud Meetup 6. Etkinlik Scaling Real-Time Messaging on Cloud Sunumu
 
A Hybrid Cloud Approach for Secure Authorized De-Duplication
A Hybrid Cloud Approach for Secure Authorized De-DuplicationA Hybrid Cloud Approach for Secure Authorized De-Duplication
A Hybrid Cloud Approach for Secure Authorized De-Duplication
 
Android Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App EngineAndroid Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App Engine
 
secure data retrieval for decentralized disruption-tolerant military networks
secure data retrieval for decentralized disruption-tolerant military networkssecure data retrieval for decentralized disruption-tolerant military networks
secure data retrieval for decentralized disruption-tolerant military networks
 
cloude computing
cloude computingcloude computing
cloude computing
 
Java project-presentation
Java project-presentationJava project-presentation
Java project-presentation
 
Akamai company profile
Akamai company profileAkamai company profile
Akamai company profile
 
Mobile Cloud Computing
Mobile Cloud ComputingMobile Cloud Computing
Mobile Cloud Computing
 
Android Report
Android ReportAndroid Report
Android Report
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testing
 
4 healthcare forum deploying vocera on aruba wlan_kevin huey
4 healthcare forum deploying vocera on aruba wlan_kevin huey4 healthcare forum deploying vocera on aruba wlan_kevin huey
4 healthcare forum deploying vocera on aruba wlan_kevin huey
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training Presentation
 
Mobile App Development- Project Management Process
Mobile App Development- Project Management ProcessMobile App Development- Project Management Process
Mobile App Development- Project Management Process
 
5G Wireless Technology
5G Wireless Technology5G Wireless Technology
5G Wireless Technology
 
cloud computing and android
cloud computing and androidcloud computing and android
cloud computing and android
 

Similar a Introduction to google cloud messaging in android

GCM Technology for Android
GCM Technology for AndroidGCM Technology for Android
GCM Technology for AndroidRanjitha R_14
 
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...ijistjournal
 
Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)Mike Willbanks
 
Android Cloud To Device Messaging
Android Cloud To Device MessagingAndroid Cloud To Device Messaging
Android Cloud To Device MessagingFernando Cejas
 
Android cloud to device messaging
Android cloud to device messagingAndroid cloud to device messaging
Android cloud to device messagingFe
 
Real Time Tracking of Complete Transport System Using GPS
Real Time Tracking of Complete Transport System Using GPSReal Time Tracking of Complete Transport System Using GPS
Real Time Tracking of Complete Transport System Using GPSMit mysore
 
Android™ application development
Android™ application developmentAndroid™ application development
Android™ application developmentDeepika Chaudhary
 
A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...
A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...
A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...ijasuc
 
Introduction to AWS Greengrass - DevDay Los Angeles 2017
Introduction to AWS Greengrass - DevDay Los Angeles 2017Introduction to AWS Greengrass - DevDay Los Angeles 2017
Introduction to AWS Greengrass - DevDay Los Angeles 2017Amazon Web Services
 
Raleigh DevDay 2017: AWS Greengrass Technical Deep Dive with Demo
Raleigh DevDay 2017: AWS Greengrass Technical Deep Dive with DemoRaleigh DevDay 2017: AWS Greengrass Technical Deep Dive with Demo
Raleigh DevDay 2017: AWS Greengrass Technical Deep Dive with DemoAmazon Web Services
 
Automate+ Final Presentation
Automate+ Final PresentationAutomate+ Final Presentation
Automate+ Final PresentationSanat Maharjan
 
A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)
A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)
A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)Chinnayya Math
 
我的GCM時代-推送訊息的實做分享
我的GCM時代-推送訊息的實做分享我的GCM時代-推送訊息的實做分享
我的GCM時代-推送訊息的實做分享Morning Kao
 

Similar a Introduction to google cloud messaging in android (20)

GCM Technology for Android
GCM Technology for AndroidGCM Technology for Android
GCM Technology for Android
 
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
 
Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)Push to Me: Mobile Push Notifications (Zend Framework)
Push to Me: Mobile Push Notifications (Zend Framework)
 
AutoMate+
AutoMate+AutoMate+
AutoMate+
 
Workshop: Android
Workshop: AndroidWorkshop: Android
Workshop: Android
 
GCCP Session 3
GCCP Session 3GCCP Session 3
GCCP Session 3
 
Android Cloud To Device Messaging
Android Cloud To Device MessagingAndroid Cloud To Device Messaging
Android Cloud To Device Messaging
 
Android cloud to device messaging
Android cloud to device messagingAndroid cloud to device messaging
Android cloud to device messaging
 
Real Time Tracking of Complete Transport System Using GPS
Real Time Tracking of Complete Transport System Using GPSReal Time Tracking of Complete Transport System Using GPS
Real Time Tracking of Complete Transport System Using GPS
 
Android™ application development
Android™ application developmentAndroid™ application development
Android™ application development
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
GCM aperitivo Android
GCM aperitivo AndroidGCM aperitivo Android
GCM aperitivo Android
 
A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...
A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...
A NOVEL THIN CLIENT ARCHITECTURE WITH HYBRID PUSH-PULL MODEL, ADAPTIVE DISPLA...
 
Presentaion final
Presentaion finalPresentaion final
Presentaion final
 
Introduction to AWS Greengrass - DevDay Los Angeles 2017
Introduction to AWS Greengrass - DevDay Los Angeles 2017Introduction to AWS Greengrass - DevDay Los Angeles 2017
Introduction to AWS Greengrass - DevDay Los Angeles 2017
 
Raleigh DevDay 2017: AWS Greengrass Technical Deep Dive with Demo
Raleigh DevDay 2017: AWS Greengrass Technical Deep Dive with DemoRaleigh DevDay 2017: AWS Greengrass Technical Deep Dive with Demo
Raleigh DevDay 2017: AWS Greengrass Technical Deep Dive with Demo
 
Automate+ Final Presentation
Automate+ Final PresentationAutomate+ Final Presentation
Automate+ Final Presentation
 
A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)
A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)
A Google Cloud Solution Minus Dedicated Server - App Only (Server and Client)
 
我的GCM時代-推送訊息的實做分享
我的GCM時代-推送訊息的實做分享我的GCM時代-推送訊息的實做分享
我的GCM時代-推送訊息的實做分享
 

Más de RIA RUI Society

User experience - Why the mobile space is important
User experience - Why the mobile space is importantUser experience - Why the mobile space is important
User experience - Why the mobile space is importantRIA RUI Society
 
Entering the world of Samsung developer ecosystem
Entering the world of Samsung developer ecosystemEntering the world of Samsung developer ecosystem
Entering the world of Samsung developer ecosystemRIA RUI Society
 
App monetization - 5 secrets of success
App monetization - 5 secrets of successApp monetization - 5 secrets of success
App monetization - 5 secrets of successRIA RUI Society
 
Socialize and Gaming on the move
Socialize and Gaming on the moveSocialize and Gaming on the move
Socialize and Gaming on the moveRIA RUI Society
 
Indian design and the art of story telling
Indian design and the art of story tellingIndian design and the art of story telling
Indian design and the art of story tellingRIA RUI Society
 
Design of the indian rupee symbol
Design of the indian rupee symbolDesign of the indian rupee symbol
Design of the indian rupee symbolRIA RUI Society
 
Creating delightful experiences
Creating delightful experiencesCreating delightful experiences
Creating delightful experiencesRIA RUI Society
 
Typographic history, systems and perception
Typographic history, systems and perceptionTypographic history, systems and perception
Typographic history, systems and perceptionRIA RUI Society
 
Understanding Design and Brand Communication Workshop Content - Design Camp I...
Understanding Design and Brand Communication Workshop Content - Design Camp I...Understanding Design and Brand Communication Workshop Content - Design Camp I...
Understanding Design and Brand Communication Workshop Content - Design Camp I...RIA RUI Society
 
Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...
Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...
Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...RIA RUI Society
 
Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...
Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...
Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...RIA RUI Society
 
Bug deBug Chennai 2012 Talk - Web application usability by Parimala Hariprasad
Bug deBug Chennai 2012 Talk - Web application usability by Parimala HariprasadBug deBug Chennai 2012 Talk - Web application usability by Parimala Hariprasad
Bug deBug Chennai 2012 Talk - Web application usability by Parimala HariprasadRIA RUI Society
 
Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...
Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...
Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...RIA RUI Society
 
Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...
Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...
Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...RIA RUI Society
 
Bug deBug Chennai 2012 Talk - Effective test management with triple t tools,...
Bug deBug Chennai 2012 Talk - Effective test management with triple t  tools,...Bug deBug Chennai 2012 Talk - Effective test management with triple t  tools,...
Bug deBug Chennai 2012 Talk - Effective test management with triple t tools,...RIA RUI Society
 
Bug deBug Chennai 2012 Talk - Business value articulation in software project...
Bug deBug Chennai 2012 Talk - Business value articulation in software project...Bug deBug Chennai 2012 Talk - Business value articulation in software project...
Bug deBug Chennai 2012 Talk - Business value articulation in software project...RIA RUI Society
 
Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...
Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...
Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...RIA RUI Society
 
Usability testing for mobile apps - Touch Tour Chennai
Usability testing for mobile apps - Touch Tour ChennaiUsability testing for mobile apps - Touch Tour Chennai
Usability testing for mobile apps - Touch Tour ChennaiRIA RUI Society
 
Introduction to Android OS - Touch Tour Chennai
Introduction to Android OS - Touch Tour ChennaiIntroduction to Android OS - Touch Tour Chennai
Introduction to Android OS - Touch Tour ChennaiRIA RUI Society
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...RIA RUI Society
 

Más de RIA RUI Society (20)

User experience - Why the mobile space is important
User experience - Why the mobile space is importantUser experience - Why the mobile space is important
User experience - Why the mobile space is important
 
Entering the world of Samsung developer ecosystem
Entering the world of Samsung developer ecosystemEntering the world of Samsung developer ecosystem
Entering the world of Samsung developer ecosystem
 
App monetization - 5 secrets of success
App monetization - 5 secrets of successApp monetization - 5 secrets of success
App monetization - 5 secrets of success
 
Socialize and Gaming on the move
Socialize and Gaming on the moveSocialize and Gaming on the move
Socialize and Gaming on the move
 
Indian design and the art of story telling
Indian design and the art of story tellingIndian design and the art of story telling
Indian design and the art of story telling
 
Design of the indian rupee symbol
Design of the indian rupee symbolDesign of the indian rupee symbol
Design of the indian rupee symbol
 
Creating delightful experiences
Creating delightful experiencesCreating delightful experiences
Creating delightful experiences
 
Typographic history, systems and perception
Typographic history, systems and perceptionTypographic history, systems and perception
Typographic history, systems and perception
 
Understanding Design and Brand Communication Workshop Content - Design Camp I...
Understanding Design and Brand Communication Workshop Content - Design Camp I...Understanding Design and Brand Communication Workshop Content - Design Camp I...
Understanding Design and Brand Communication Workshop Content - Design Camp I...
 
Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...
Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...
Bug deBug Chennai 2012 Talk - Driving innovation using pattern based thinking...
 
Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...
Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...
Bug deBug Chennai 2012 Talk - Trimming those flabs designing lightweight test...
 
Bug deBug Chennai 2012 Talk - Web application usability by Parimala Hariprasad
Bug deBug Chennai 2012 Talk - Web application usability by Parimala HariprasadBug deBug Chennai 2012 Talk - Web application usability by Parimala Hariprasad
Bug deBug Chennai 2012 Talk - Web application usability by Parimala Hariprasad
 
Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...
Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...
Bug deBug Chennai 2012 Talk - V3 analysis an approach for estimating software...
 
Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...
Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...
Bug deBug Chennai 2012 Talk - Future of testing impact of mobile devices by S...
 
Bug deBug Chennai 2012 Talk - Effective test management with triple t tools,...
Bug deBug Chennai 2012 Talk - Effective test management with triple t  tools,...Bug deBug Chennai 2012 Talk - Effective test management with triple t  tools,...
Bug deBug Chennai 2012 Talk - Effective test management with triple t tools,...
 
Bug deBug Chennai 2012 Talk - Business value articulation in software project...
Bug deBug Chennai 2012 Talk - Business value articulation in software project...Bug deBug Chennai 2012 Talk - Business value articulation in software project...
Bug deBug Chennai 2012 Talk - Business value articulation in software project...
 
Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...
Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...
Bug deBug Chennai 2012 Talk - Test automation support systems layered archite...
 
Usability testing for mobile apps - Touch Tour Chennai
Usability testing for mobile apps - Touch Tour ChennaiUsability testing for mobile apps - Touch Tour Chennai
Usability testing for mobile apps - Touch Tour Chennai
 
Introduction to Android OS - Touch Tour Chennai
Introduction to Android OS - Touch Tour ChennaiIntroduction to Android OS - Touch Tour Chennai
Introduction to Android OS - Touch Tour Chennai
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...
 

Introduction to google cloud messaging in android

  • 1. Introduction to Android Google Cloud Messaging Amrit Sanjeev Organizer – Bangalore Android User Group
  • 2. About me • Android hacker. • Organizer, Bangalore Android User Group ( www.blrdroid.org ) • Research Engineer at Philips R&D
  • 3. Bangalore Android User Group ( www.BlrDroid.org) • Largest open Android developer community in the country and second largest in the world. • Over 2500 members • 19 meetups • 3 hackathons • Active participation in events like Droidcon, Global Android Developer hackathon etc
  • 4. What we will be discussing today. Why do we How it is What is implemented ? GCM? need GCM? Google Cloud Messaging
  • 5. What is GCM? Google Cloud Messaging
  • 6. GCM definition GCM stands for Google Cloud Messaging . It is a free service that allows developers to send data from third party servers to their applications running on android devices Handles queuing of messages and delivery to the target application running on the target device. Intended use is not to send huge amount of data to the client device
  • 7. Things to keep in mind Application on the android device DOES NOT need to be running to receive messages. Requires user to set up a Google account on the device. It is purely a routing component There is no guaranteed delivery of messages to the device .
  • 8. Focus of GCM GCM stats are Ease of use. No available through No quotas. sign-up forms. the Android Developer Console. Rich set of new Battery efficiency. APIs
  • 9. Difference between GCM and C2DM Simple API Key from Google APIs console page. Sender id is the project id rather than email address Supports data in JSON format and plain text
  • 10. Difference between GCM and C2DM Multicast message support Multiple senders Messages have time to live ( 0 ~ 4 weeks ) eg. Expiring invitations Payload up to 4kb
  • 11. Why do we need GCM? The why part
  • 12. The need to use GCM Client server architecture is the most common architecture . Most application do all the heavy lifting and processing at the servers and then use the processed data within the applications . Scalability & extensibility More computing power
  • 13. The need to use GCM Background process polling server for information at regular intervals is a bad design Battery performance System resource usage ( memory , CPU ) Complicated coding Application does not need to be running in the background for receiving data messages. Lower cost and better tracking than SMS.
  • 14. The need to use GCM Less coding required Not need to worry about queuing of messages Differed delivery Simpler application flow
  • 15. The need to use GCM In a nutshell it makes application design much more simple, improves battery performance and makes better use of system resources .
  • 16. How it is implemented? The internals
  • 17. Major components Your application server GCM servers Mobile device
  • 18. Typical sequence of events The application server sends a message to GCM servers. Google queues The Android and stores the application message in case processes the the device is message offline. On the device, the system When the device broadcasts the is online, Google message to the sends the specified Android. message to the This wakes the device. Android application up.
  • 19. Minimum requirements ( device side ) Android 2.2 + Android market place should be installed Emulator with Google APIs Internet connection Google account ( device version < 4.0.4 ) .
  • 20. Minimum requirements ( server side ) HTTPS application server that should be Able to communicate with your client. Able to fire off HTTP requests to the GCM server. Able to handle requests and queue data as needed. For example, it should be able to perform exponential back off. Able to store the user device registration id .
  • 21. Android application Copy the Add a Wire it up required broadcast in your libs receiver activity Make Add an changes Intent to the service manifest
  • 22. Alternate Infrastructures • Alternative to GCM is required under following conditions Limited connectivity to internet services Security requirement Guaranteed delivery SLAs on delivery No quota limits • Downsides Complicated design Battery consumption on device is higher.
  • 23. Thank you In case you have more queries please feel free to contact Amrit.sanjeev@gmail.com (+91 97407 44557 ) @amsanjeev
  • 25. Add required libs Install Google Cloud Messaging for android using SDK manager. Copy gcm.jar from YOUR_SDK_ROOT/extras/google/gcm-client/dist to libs in your project folder
  • 26. Changes to Manifest file Add <use-sdk … > Declare & use a custom permission Add additional permissions  internet  get_accounts  wake_lock
  • 27. Write Intentservice  subclass of com.google.android.gcm.GCMBaseIntentService  must contain a public constructor,  Generally named my_app_package.GCMIntentService  Override the following functions with appropriate logic  onRegistered  onUnRegistered  onMessage  onError  onRecoverableError
  • 28. Add boardcast receiver  add a broadcast receiver with the custom permissions and following actions  <action android:name="com.google.android.c2dm.intent.RECEIVE" />  <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> Should be defined in the manifest and not programmatically
  • 29. Finally the activity CheckDevice () CheckManifest() getRegistrationId() Register()

Notas del editor

  1. This presentation demonstrates the new capabilities of PowerPoint and it is best viewed in Slide Show. These slides are designed to give you great ideas for the presentations you’ll create in PowerPoint 2011!For more sample templates, click the File menu, and then click New From Template. Under Templates, click Presentations.