Magda badita gcm

459 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
459
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Magda badita gcm

  1. 1. Android, let’s chat!Google Cloud MessagingByMaria Magdalena Bădiţa
  2. 2. I’m so lonely…
  3. 3. What is GCM? Push: lightweight message toGCM (Google Cloud Messaging) is applications telling that there isa free service that helps new data to be fetched from thedevelopers send data from servers server or a message containingto their Android applications on up to 4kb of payload data (e.g:Android devices. instant messaging apps). This can eliminate continuous query to server for updates using background services
  4. 4. GCM Characteristics Allows 3rd-party GCM makes noapplication servers to send guarantees about deliverymessages to their Android or the order of messages.applications. Application on an Android device doesnt need to be running to receive messages.
  5. 5. Device registration
  6. 6. Send the notification
  7. 7. Google API Console1.Creating a Google API project2.Enabling the GCM Service http://developer.android.com/google/gcm/gs.html3.Obtaining an API Key
  8. 8. Writing the Android Client ICopy the gcm.jar file into your application classpath.
  9. 9. Writing the Android Client IIWrite the my_app_package.GCMIntentService classWrite your applications main activity
  10. 10. MigrationAndroid Cloud to DeviceMessaging (C2DM) isdeprecated. GCM replaces C2DM The focus of GCM is as follows: * Ease of use. No sign-up forms. * No quotas. * GCM and C2DM stats are available through the Developer Console. * Battery efficiency. * Rich set of new APIs.
  11. 11. Client changesServer changes Sending messages to GCM devices requires a few changes: * The request should be sent to a new endpoint: https://android.googleapis.com/gcm/send. * The Authorization header of the request should contain the API key generated during sign up. This key replaces the deprecated ClientLogin Auth token.
  12. 12. Resources• http://developer.android.com/• https://developers.google.com/events/io/
  13. 13. Thank you!!! Now I can chat with my Android friends! :)Speaker.bio.toString() http://magdabadita.wordpress.com/ Smartphone Platforms SmartphonePlatf

×