Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Google Cloud Messaging with CCS and XMPP

Google Cloud Messaging with CCS and XMPP

A talk about the new features in Google Cloud Messaging

Wolfram Rittmeyer

January 16, 2014
Tweet

More Decks by Wolfram Rittmeyer

Other Decks in Programming

Transcript

  1. Google Cloud Messaging
    Cloud Connection Server and XMPP

    View Slide

  2. Google Play Services

    This meeting is about Android 4.4

    But this talk is not :-)

    Google Play Services is all that's needed

    View Slide

  3. CCS

    Upstream messaging possible

    Permanent connection between servers
    – But Google keeps messages around a while

    XMPP instead of HTTP

    You cannot use it right away
    – You have to sign up for it

    View Slide

  4. Flow of Events

    View Slide

  5. Android Code

    View Slide

  6. Sample Message I

    View Slide

  7. Sample Message II

    View Slide

  8. Benefits

    Reuses Connection
    – Battery friendly

    More messages in a shorter timeframe

    Android Client easier to develop
    – You need not care about queuing
    – No need to check for network availability

    Notification cancellation

    View Slide

  9. Drawbacks

    XMPP is less known than HTTP

    Less information online about XMPP

    I have found only one maintained Java lib

    Less information online about CCS

    Manual ACK / NACK handling

    Proxy servers can be an issue

    No Cloud Services support (as of yet)
    – Not even Google App Engine!

    View Slide

  10. Recommendation

    It's beta, so stay calm :-)

    Ideal for sending out many messages

    To a very large user base

    And for many return messages from device

    Do not trust the emulator!

    View Slide

  11. What else

    Github links:
    https://github.com/writtmeyer/gcm_sample
    https://github.com/writtmeyer/gcm_server

    Blog post in the next days on
    grokkingandroid.com

    A big thank you to Dennis Geurts!

    View Slide

  12. https://plus.google.com/+WolframRittmeyer
    https://www.twitter.com/RittmeyerW
    http://www.grokkingandroid.com
    http://www.grokkingandroid.com/gcm_ccs

    View Slide