24

Magda badita gcm

Embed Size (px)

Citation preview

Page 1: Magda badita  gcm
Page 2: Magda badita  gcm

Android, let’s chat!Google Cloud Messaging

By

Maria Magdalena Bădiţa

Page 3: Magda badita  gcm
Page 4: Magda badita  gcm
Page 5: Magda badita  gcm
Page 6: Magda badita  gcm
Page 7: Magda badita  gcm
Page 8: Magda badita  gcm

I’m so lonely…

Page 9: Magda badita  gcm
Page 10: Magda badita  gcm
Page 11: Magda badita  gcm
Page 12: Magda badita  gcm
Page 13: Magda badita  gcm

What is GCM?

GCM (Google Cloud Messaging) is a free service that helps developers send data from servers to their Android applications on Android devices.

Push: lightweight message to applications telling that there is new data to be fetched from the server or a message containing up to 4kb of payload data (e.g: instant messaging apps).

This can eliminate continuous query to server for updates using background services

Page 14: Magda badita  gcm

GCM Characteristics

Allows 3rd-party application servers to send messages to their Android applications.

GCM makes no guarantees about delivery or the order of messages.

Application on an Android device doesn't need to be running to receive messages.

Page 15: Magda badita  gcm

Device registration

Page 16: Magda badita  gcm

Send the notification

Page 17: Magda badita  gcm

Google API Console

http://developer.android.com/google/gcm/gs.html

1.Creating a Google API project

2.Enabling the GCM Service

3.Obtaining an API Key

Page 18: Magda badita  gcm

Writing the Android Client I

Copy the gcm.jar file into your application classpath.

Page 19: Magda badita  gcm

Writing the Android Client II

Write the my_app_package.GCMIntentService class

Write your application's main activity

Page 20: Magda badita  gcm

Migration

Android Cloud to Device Messaging (C2DM) is deprecated. 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.

Page 21: Magda badita  gcm

Client changes

Server changesSending 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.

Page 22: Magda badita  gcm

Resources

• http://developer.android.com/

• https://developers.google.com/events/io/

Page 23: Magda badita  gcm
Page 24: Magda badita  gcm

Thank you!!! Now I can chat with my Android friends! :)

Smartphone Platforms

SmartphonePlatf

http://magdabadita.wordpress.com/

Speaker.bio.toString()