SlideShare una empresa de Scribd logo
1 de 41
Cloud to Device Messaging(with Google App Engine) Lars Vogel Twitter: @vogella http://www.vogella.de
About me – Lars Vogel  Works as independent Eclipse and Android Consultant and Trainer Also works for SAP AG as Product Owner in a Scrum team Maintains http://www.vogella.de Java, Eclipse and Android related Tutorials with ~20 000 visitors per day
The challenge Mobile Phone Data in the Cloud
Internet creates value for your application
Getting the data Polling   Pushing
Polling is easy 1.) Ask the server if new data is available2.) If new data is available download it3.) Sleep / wait 4.) Repeat 1.)
Polling every 5 min can consume 10 % of your battery
Pushing Server informs the phone once new data is available Info triggeres a download of data
Cloud to Device Messaging Available for Android 2.2 (Beta – Invite only) Requires the Market available on the device Use existing Google connections Light-weight data will be send to the device Message is specific to your application (via permission) Use AlarmManager to keep the connection (Heartbeat)
C2DM – Building blocks Gmail User for the application registration Android Application Googles C2DM server Your Application Server
C2DM Architecture Googles C2DM Server Android App Your application server
C2DM Architecture Request registration ID Unique registration ID Googles C2DM Server Android App Server might send  new registration ID
C2DM Architecture Sends Registration ID to server Android App Server stores the registration ID
Sending messages New HTTP Post message with registration id and authentication token * 200 – ok (with id==ok) 404 – get no auth token 503 – Retry with backoff
Return 200 with error QuotaExceeded InvalidRegistration MessageTooBig MissingCollapseKey
C2DM Architecture Sends notification message to device Reads the real data from server
Building the app
Actually its relatively simple Google provides some util classes To register call:  C2DMessaging.register(context, Your.Email@gmail.com) Register the Google provided C2DM broadcast receiver in your „AndroidManifest.xml“. Google receiver will forward the information it receives to:  	context.getPackageName() + ".C2DMReceiver"
 Your C2DMReceiver Gets the registration ID and send it to your server
Permissions
Register Googles Receiver
Send registration ID to server
Further points Best effort delivery: Google will try to deliver all messages but some might get lost  Push can send 1024 characters -> not suited for big data, just notification
Server can be anything curl, php,  For testing build your server also on the phone....
Your Java application server
from Guillaume Laforge and Patrick Chanezon http://www.slideshare.net/glaforge/google-app-engine-java-groovy-baby
Writing Java Webs application is annoyingly hard...
Google App Engine GAE allows you to host webapplications on the Google infrastructure.   Scalable Infrastructure
Google App Engine No Server maintenance Super easy deployment
It automatically scales up and down Computing power over time
App Engine Architecture Load Balancer App Engine FrontEnd App Engine FrontEnd App Engine FrontEnd AppServer AppServer AppServer
GAE Key points Deployment is super simple Supports subset of JPA / JDO for persistence Scalable per definition Free to get started (significant volume)
Receiving the registration ID
Send out message
Funny: Cloud vrs. Mobile Cloud No Threads (Webworkers) No Access to file system Only Key / Value (+JPA, JDO) Time limited for requests 30  Mobile Threads Access to file system SQL Datebase Time limited for Activity 5 secs
Summary  C2DM powerful and relatively simple to use Google App Engine makes the server site easy
Picture CreditsAdd the prefix http://www.sxc.hu/photo Elephant: http://www.sxc.hu/photo/103473 Mouse http://www.sxc.hu/photo/1097314 Liquid http://www.sxc.hu/photo/1109534 Beta 853828 Despair 150108 Old Computer http://www.sxc.hu/photo/1028528 Person with remote http://www.sxc.hu/photo/485640 Victory fingers 906072 Guy with a tie 877661
Futher information C2DM Tutorial http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html Google App Engine Tutorial http://www.vogella.de/articles/GoogleAppEngineJava/article.html Chrome to Phone Example  http://code.google.com/p/chrometophone/
Thank you For further questions: Lars.Vogel@gmail.com http://www.vogella.de http://www.twitter.com/vogella
License & Acknowledgements This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License See http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US

Más contenido relacionado

La actualidad más candente

AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018
AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018 AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018
AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018
Amazon Web Services Korea
 
Migrating Internal IT Apps - Jenn Boden
 Migrating Internal IT Apps - Jenn Boden Migrating Internal IT Apps - Jenn Boden
Migrating Internal IT Apps - Jenn Boden
Amazon Web Services
 

La actualidad más candente (20)

Hashiconf AWS Lambda Breakout
Hashiconf AWS Lambda BreakoutHashiconf AWS Lambda Breakout
Hashiconf AWS Lambda Breakout
 
Cloud-powered Mobile Apps - Pop-up Loft TLV 2017
Cloud-powered Mobile Apps - Pop-up Loft TLV 2017Cloud-powered Mobile Apps - Pop-up Loft TLV 2017
Cloud-powered Mobile Apps - Pop-up Loft TLV 2017
 
20141021 AWS Cloud Taekwon - Big Data on AWS
20141021 AWS Cloud Taekwon - Big Data on AWS20141021 AWS Cloud Taekwon - Big Data on AWS
20141021 AWS Cloud Taekwon - Big Data on AWS
 
Building Better IoT Applications without Servers
Building Better IoT Applications without ServersBuilding Better IoT Applications without Servers
Building Better IoT Applications without Servers
 
AWS re:Invent 2016: Test and Debug Your Mobile Apps on Real Android and iOS D...
AWS re:Invent 2016: Test and Debug Your Mobile Apps on Real Android and iOS D...AWS re:Invent 2016: Test and Debug Your Mobile Apps on Real Android and iOS D...
AWS re:Invent 2016: Test and Debug Your Mobile Apps on Real Android and iOS D...
 
AWS November Webinar Series - Get Started with Automated Mobile Application T...
AWS November Webinar Series - Get Started with Automated Mobile Application T...AWS November Webinar Series - Get Started with Automated Mobile Application T...
AWS November Webinar Series - Get Started with Automated Mobile Application T...
 
Mobile App Testing with AWS Device Farm - AWS July 2016 Webinar Series
Mobile App Testing with AWS Device Farm - AWS July 2016 Webinar SeriesMobile App Testing with AWS Device Farm - AWS July 2016 Webinar Series
Mobile App Testing with AWS Device Farm - AWS July 2016 Webinar Series
 
Announcing Amazon AppStream 2.0 - January 2017 Online Tech Talks
Announcing Amazon AppStream 2.0 - January 2017 Online Tech TalksAnnouncing Amazon AppStream 2.0 - January 2017 Online Tech Talks
Announcing Amazon AppStream 2.0 - January 2017 Online Tech Talks
 
Introducing AWS Device Farm
Introducing AWS Device FarmIntroducing AWS Device Farm
Introducing AWS Device Farm
 
How to Connect Your Own Creations with AWS IoT - DevDay Los Angeles 2017
How to Connect Your Own Creations with AWS IoT - DevDay Los Angeles 2017How to Connect Your Own Creations with AWS IoT - DevDay Los Angeles 2017
How to Connect Your Own Creations with AWS IoT - DevDay Los Angeles 2017
 
AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018
AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018 AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018
AWS와 Alexa 음성 인식 플랫폼을 통한 비즈니스 기회::윤석찬::AWS Summit Seoul 2018
 
Migrating Internal IT Apps - Jenn Boden
 Migrating Internal IT Apps - Jenn Boden Migrating Internal IT Apps - Jenn Boden
Migrating Internal IT Apps - Jenn Boden
 
Serverless everywhere
Serverless everywhereServerless everywhere
Serverless everywhere
 
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul MaddoxAWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
 
AWS Mobile Hub Overview
AWS Mobile Hub OverviewAWS Mobile Hub Overview
AWS Mobile Hub Overview
 
AWS Mobile Hub
AWS Mobile HubAWS Mobile Hub
AWS Mobile Hub
 
Aero app updates how to v1.1510.12
Aero app updates how to v1.1510.12Aero app updates how to v1.1510.12
Aero app updates how to v1.1510.12
 
AWS Architecture - GDC 2014
AWS Architecture - GDC 2014AWS Architecture - GDC 2014
AWS Architecture - GDC 2014
 
Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...
Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...
Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...
 
Intro to AWS Developer Tools feat. AWS Codestar, and AWS SDKs & Developer Res...
Intro to AWS Developer Tools feat. AWS Codestar, and AWS SDKs & Developer Res...Intro to AWS Developer Tools feat. AWS Codestar, and AWS SDKs & Developer Res...
Intro to AWS Developer Tools feat. AWS Codestar, and AWS SDKs & Developer Res...
 

Destacado (11)

Java Support On Google App Engine
Java Support On Google App EngineJava Support On Google App Engine
Java Support On Google App Engine
 
Google App Engine Introduction
Google App Engine IntroductionGoogle App Engine Introduction
Google App Engine Introduction
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentation
 
cloude computing
cloude computingcloude computing
cloude computing
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 
Introduction to google cloud messaging in android
Introduction to google cloud messaging in androidIntroduction to google cloud messaging in android
Introduction to google cloud messaging in android
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 
FCM & GCM
FCM & GCMFCM & GCM
FCM & GCM
 
Google Cloud Messaging
Google Cloud MessagingGoogle Cloud Messaging
Google Cloud Messaging
 
Google cloud messaging
Google cloud messagingGoogle cloud messaging
Google cloud messaging
 

Similar a Android Cloud to Device Messaging with the Google App Engine

Busy Bee Application Develompent Platform
Busy Bee Application Develompent PlatformBusy Bee Application Develompent Platform
Busy Bee Application Develompent Platform
Utkarsh Shukla
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platform
rajdeep
 
Multi channel advantage
Multi channel advantageMulti channel advantage
Multi channel advantage
Dipesh Mukerji
 
Building a chat app with windows azure mobile
Building a chat app with windows azure mobileBuilding a chat app with windows azure mobile
Building a chat app with windows azure mobile
Flavius-Radu Demian
 

Similar a Android Cloud to Device Messaging with the Google App Engine (20)

Android C2DM Presentation at O'Reilly AndroidOpen Conference
Android C2DM Presentation at O'Reilly AndroidOpen ConferenceAndroid C2DM Presentation at O'Reilly AndroidOpen Conference
Android C2DM Presentation at O'Reilly AndroidOpen Conference
 
Busy Bee Application Develompent Platform
Busy Bee Application Develompent PlatformBusy Bee Application Develompent Platform
Busy Bee Application Develompent Platform
 
Building what's next with google cloud's powerful infrastructure
Building what's next with google cloud's powerful infrastructureBuilding what's next with google cloud's powerful infrastructure
Building what's next with google cloud's powerful infrastructure
 
Mobile March Windows Azure Notification Hubs
Mobile March Windows Azure Notification HubsMobile March Windows Azure Notification Hubs
Mobile March Windows Azure Notification Hubs
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platform
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
 
Multi channel advantage
Multi channel advantageMulti channel advantage
Multi channel advantage
 
Building a chat app with windows azure mobile
Building a chat app with windows azure mobileBuilding a chat app with windows azure mobile
Building a chat app with windows azure mobile
 
Building IoT Apps in the Cloud Webinar
Building IoT Apps in the Cloud WebinarBuilding IoT Apps in the Cloud Webinar
Building IoT Apps in the Cloud Webinar
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
 
Raspberry pi and Google Cloud
Raspberry pi and Google CloudRaspberry pi and Google Cloud
Raspberry pi and Google Cloud
 
GCM with Pushbots
GCM with PushbotsGCM with Pushbots
GCM with Pushbots
 
Building a chat app with windows azure mobile services
Building a chat app with windows azure mobile servicesBuilding a chat app with windows azure mobile services
Building a chat app with windows azure mobile services
 
Google Cloud Platform (GCP) At a Glance
Google Cloud Platform (GCP)  At a GlanceGoogle Cloud Platform (GCP)  At a Glance
Google Cloud Platform (GCP) At a Glance
 
Google Cloud Next '22 Recap: Serverless & Data edition
Google Cloud Next '22 Recap: Serverless & Data editionGoogle Cloud Next '22 Recap: Serverless & Data edition
Google Cloud Next '22 Recap: Serverless & Data edition
 
18 windows phone 8.1 for the enterprise developer
18   windows phone 8.1 for the enterprise developer18   windows phone 8.1 for the enterprise developer
18 windows phone 8.1 for the enterprise developer
 
GCM Technology for Android
GCM Technology for AndroidGCM Technology for Android
GCM Technology for Android
 
Sp.pptx
Sp.pptxSp.pptx
Sp.pptx
 
Windows azure overview for SharePoint Pros
Windows azure overview for SharePoint Pros Windows azure overview for SharePoint Pros
Windows azure overview for SharePoint Pros
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 

Más de Lars Vogel

Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views
Lars Vogel
 

Más de Lars Vogel (20)

Eclipse IDE and Platform news on Fosdem 2020
Eclipse IDE and Platform news on Fosdem 2020Eclipse IDE and Platform news on Fosdem 2020
Eclipse IDE and Platform news on Fosdem 2020
 
Eclipse platform news and how to contribute to the Eclipse Open Source project
Eclipse platform news and how to contribute to the Eclipse Open Source projectEclipse platform news and how to contribute to the Eclipse Open Source project
Eclipse platform news and how to contribute to the Eclipse Open Source project
 
Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views
 
How to become an Eclipse committer in 20 minutes and fork the IDE
How to become an Eclipse committer in 20 minutes and fork the IDEHow to become an Eclipse committer in 20 minutes and fork the IDE
How to become an Eclipse committer in 20 minutes and fork the IDE
 
Building beautiful User Interface in Android
Building beautiful User Interface in AndroidBuilding beautiful User Interface in Android
Building beautiful User Interface in Android
 
What is so cool about Android 4.0
What is so cool about Android 4.0What is so cool about Android 4.0
What is so cool about Android 4.0
 
What is so cool about Android 4.0?
What is so cool about Android 4.0?What is so cool about Android 4.0?
What is so cool about Android 4.0?
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Eclipse e4 - Google Eclipse Day
Eclipse e4 - Google Eclipse DayEclipse e4 - Google Eclipse Day
Eclipse e4 - Google Eclipse Day
 
Android Overview (Karlsruhe VKSI)
Android Overview (Karlsruhe VKSI)Android Overview (Karlsruhe VKSI)
Android Overview (Karlsruhe VKSI)
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 
Eclipse 2011 Hot Topics
Eclipse 2011 Hot TopicsEclipse 2011 Hot Topics
Eclipse 2011 Hot Topics
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Eclipse 4.0 - Dynamic Models
Eclipse 4.0 - Dynamic Models Eclipse 4.0 - Dynamic Models
Eclipse 4.0 - Dynamic Models
 
Eclipse 40 Labs- Eclipse Summit Europe 2010
Eclipse 40 Labs- Eclipse Summit Europe 2010Eclipse 40 Labs- Eclipse Summit Europe 2010
Eclipse 40 Labs- Eclipse Summit Europe 2010
 
Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010
 
Android Programming made easy
Android Programming made easyAndroid Programming made easy
Android Programming made easy
 
Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4 Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4
 
Eclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ RheinjugEclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ Rheinjug
 
Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Android Cloud to Device Messaging with the Google App Engine

  • 1. Cloud to Device Messaging(with Google App Engine) Lars Vogel Twitter: @vogella http://www.vogella.de
  • 2. About me – Lars Vogel Works as independent Eclipse and Android Consultant and Trainer Also works for SAP AG as Product Owner in a Scrum team Maintains http://www.vogella.de Java, Eclipse and Android related Tutorials with ~20 000 visitors per day
  • 3. The challenge Mobile Phone Data in the Cloud
  • 4. Internet creates value for your application
  • 5. Getting the data Polling Pushing
  • 6. Polling is easy 1.) Ask the server if new data is available2.) If new data is available download it3.) Sleep / wait 4.) Repeat 1.)
  • 7.
  • 8. Polling every 5 min can consume 10 % of your battery
  • 9. Pushing Server informs the phone once new data is available Info triggeres a download of data
  • 10. Cloud to Device Messaging Available for Android 2.2 (Beta – Invite only) Requires the Market available on the device Use existing Google connections Light-weight data will be send to the device Message is specific to your application (via permission) Use AlarmManager to keep the connection (Heartbeat)
  • 11. C2DM – Building blocks Gmail User for the application registration Android Application Googles C2DM server Your Application Server
  • 12. C2DM Architecture Googles C2DM Server Android App Your application server
  • 13. C2DM Architecture Request registration ID Unique registration ID Googles C2DM Server Android App Server might send new registration ID
  • 14. C2DM Architecture Sends Registration ID to server Android App Server stores the registration ID
  • 15. Sending messages New HTTP Post message with registration id and authentication token * 200 – ok (with id==ok) 404 – get no auth token 503 – Retry with backoff
  • 16. Return 200 with error QuotaExceeded InvalidRegistration MessageTooBig MissingCollapseKey
  • 17. C2DM Architecture Sends notification message to device Reads the real data from server
  • 19. Actually its relatively simple Google provides some util classes To register call: C2DMessaging.register(context, Your.Email@gmail.com) Register the Google provided C2DM broadcast receiver in your „AndroidManifest.xml“. Google receiver will forward the information it receives to: context.getPackageName() + ".C2DMReceiver"
  • 20. Your C2DMReceiver Gets the registration ID and send it to your server
  • 23. Send registration ID to server
  • 24. Further points Best effort delivery: Google will try to deliver all messages but some might get lost Push can send 1024 characters -> not suited for big data, just notification
  • 25. Server can be anything curl, php, For testing build your server also on the phone....
  • 27. from Guillaume Laforge and Patrick Chanezon http://www.slideshare.net/glaforge/google-app-engine-java-groovy-baby
  • 28. Writing Java Webs application is annoyingly hard...
  • 29. Google App Engine GAE allows you to host webapplications on the Google infrastructure. Scalable Infrastructure
  • 30. Google App Engine No Server maintenance Super easy deployment
  • 31. It automatically scales up and down Computing power over time
  • 32. App Engine Architecture Load Balancer App Engine FrontEnd App Engine FrontEnd App Engine FrontEnd AppServer AppServer AppServer
  • 33. GAE Key points Deployment is super simple Supports subset of JPA / JDO for persistence Scalable per definition Free to get started (significant volume)
  • 36. Funny: Cloud vrs. Mobile Cloud No Threads (Webworkers) No Access to file system Only Key / Value (+JPA, JDO) Time limited for requests 30 Mobile Threads Access to file system SQL Datebase Time limited for Activity 5 secs
  • 37. Summary C2DM powerful and relatively simple to use Google App Engine makes the server site easy
  • 38. Picture CreditsAdd the prefix http://www.sxc.hu/photo Elephant: http://www.sxc.hu/photo/103473 Mouse http://www.sxc.hu/photo/1097314 Liquid http://www.sxc.hu/photo/1109534 Beta 853828 Despair 150108 Old Computer http://www.sxc.hu/photo/1028528 Person with remote http://www.sxc.hu/photo/485640 Victory fingers 906072 Guy with a tie 877661
  • 39. Futher information C2DM Tutorial http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html Google App Engine Tutorial http://www.vogella.de/articles/GoogleAppEngineJava/article.html Chrome to Phone Example http://code.google.com/p/chrometophone/
  • 40. Thank you For further questions: Lars.Vogel@gmail.com http://www.vogella.de http://www.twitter.com/vogella
  • 41. License & Acknowledgements This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License See http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US