SlideShare a Scribd company logo
1 of 18
Download to read offline
Android
Cloud2Device
Messaging
Communicate with your
app!


Mando Stamelaki
M-STAT – Mobile Application Developer

     |       |         |




2012 Copyright M-STAT SA
Android Cloud to Device Messaging Framework
                                                                                                                      (AC2DM)


                                                   What is Android C2DM Framework?



Introduction to AC2DM                              Android Cloud to Device Messaging (C2DM) is
                                                        – a service that helps developers send data from servers to
                                                             their applications on Android devices.


Google Service for                                 The service provides a:
pushing messages to                                      – simple,
Android devices.                                         – lightweight
                                                   mechanism that servers can use to:
                                                         – tell mobile applications to contact the server directly,
                                                         – fetch updated application or user data.

 Push Notifications for                            The C2DM service handles
 Android Phones,                                         – all aspects of queuing of messages and
 Tablets and other                                       – delivery to the target application running on the target
 devices.                                                  device.




Mando Stamelaki | Android Cloud2Device Messaging
AC2DM
                                                           Android Cloud to device Messaging, provided free by Google Servers




 Advantages                                         Disadvantages


• 3rd party application servers send lightweight   • C2DM makes no guarantees about delivery
  messages to their Android applications.            or the order of messages.

• An application on an Android device doesn’t      • Does not provide built-in user interface or
  need to be running to receive messages.            other handling for message data.

• Uses an existing connection for Google           • Requires devices running Android 2.2 or
  services, with the set up Google account on        higher that also have the Market application
  mobile device.                                     installed.




Mando Stamelaki | Android Cloud2Device Messaging
coming                     M-STAT Service
                                                                                                          In the role of 3rd party server
                                                                                 soon




 Server-side                                        Mobile Application               Encountering C2DM disadvantages


• No need to setup a server in                     • Easy integration in your       • Application ability to inform
  order to send notification                         Application                      M-STAT server when a push
  messages.                                                                           message is received
                                                   • Full documentation for
• User friendly environment.                         developers                     • Library provides a built-in
                                                                                      handler for messages
• Cross-platform push                              • Documented code examples
  notifications
   (iOS supported, Windows Phone on
   the way!)                                       • Easy customizable to your
                                                     app needs.


Mando Stamelaki | Android Cloud2Device Messaging
C2DM communication
                                                                            Communication flow between M-STAT (3rd party server) and Google



                                                       request register
                        Android                               registration id
                        Application                                                  Servers
                        (Device)                                                     (C2DM | Client Login)
                                                              Push message
                                  registration id                                      send id | error
                                           [tags]

                                                                 registration id
                                                                       message
                                                    key id        authorization




                                                     Notification                        requests
                                                     Server                              authorization

                                                                                                            authorization
Mando Stamelaki | Android Cloud2Device Messaging
M-STAT Server
                                                     HTTP Communication protocol




             REGISTER

             • A device for push notifications
             • Update an existing device

             CURRENT STATUS

             • Registration status and tags if any

             UNREGISTER

             • Remove a device from the list
Mando Stamelaki | Android Cloud2Device Messaging
Preferences

                                                   Preferences


                                                     • Enable / Disable C2DM service
                                                            •    Register/Unregister from Google
                                                            •    Register/Unregister from M-STAT

                                                     • Register to specific notification tags
                                                            •    An app can let users receive notifications for specific
                                                                 things (up to each developer) and not everything

                                                     • Retrieve registration status




Mando Stamelaki | Android Cloud2Device Messaging
Software Development Kit for M-STAT Notification Service




                                                   The SDK contains:



                                                   • Library
                                                   • Mobile App
                                                   • Examples



Mando Stamelaki | Android Cloud2Device Messaging
SDK

                                                   Library



                                                   • Implementing the process to register and
                                                     unregister from Google servers.

                                                   • Connect to M-STAT’s servers and pass the
                                                     registration id, and other preferences.




Mando Stamelaki | Android Cloud2Device Messaging
SDK

                                                   Mobile Helping App


                                                   • Representing the usage of library

                                                   • Helping developers to test the service
                                                     without having to implement their own
                                                     application.




Mando Stamelaki | Android Cloud2Device Messaging
Let’s CODE!!!
Start with . . .
                                                   adding the Library to your project




Mando Stamelaki | Android Cloud2Device Messaging
Integrate M-STAT’s library
                                                                          AndroidManifest.xml (1 of 2)




                  <xml version="1.0" encoding="utf-8"?>
                  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                      package="gr.mstat.example"
                      android:versionCode="1" android:versionName="1.0" >
                  <!-- Android 2.2 -->
                  <uses-sdk android:minSdkVersion="8" />
                  <!-- Permissions -->
                  <permission android:name="gr.mstat.example.permission.C2D_MESSAGE“
                                   android:protectionLevel="signature" />
                  <uses-permission
                          android:name="gr.mstat.example.permission.C2D_MESSAGE" />
                  <uses-permission
                          android:name="com.google.android.c2dm.permission.RECEIVE" />
                  <uses-permission android:name="android.permission.INTERNET" />
                  <uses-permission android:name="android.permission.WAKE_LOCK" />

                  <!-- ... other permissions here ... -->
Mando Stamelaki | Android Cloud2Device Messaging
Integrate M-STAT’s library
                                                                 AndroidManifest.xml (2 of 2)




<application><!-- ... any activities | services | receivers here ... -->
  <service android:name="gr.mstat.c2dm.C2DMReceiver" />
  <receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
          <intent-filter> <!-- Receive the actual message -->
              <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
              <category android:name="gr.mstat.example" />
          </intent-filter>
          <intent-filter> <!-- Receive the registration id -->
              <action
android:name="com.google.android.c2dm.intent.REGISTRATION" />
              <category android:name="gr.mstat.example" />
          </intent-filter>
  </receiver>
</application>
<!-- ... other code here ... -->
</manifest>
Mando Stamelaki | Android Cloud2Device Messaging
Calling the library
                                                                                 Startup class or any class where you want the notification service being initialized


                                                   Still under “deep thought” but will look to something like…


Single line initialization                         // this refers to a Context object
                                                   // OPTION 1:
Different ways of                                  // Starts up the service according to a preference
initialization                                     from application preferences
                                                   PushNotification.registerAuto(this);
Customized preferences                             // OPTION 2:
                                                   // Manual register or unregister to the service
                                                   PushNotification.register(this, true);
BUT ALL WITH:
                                                   PushNotification.register(this, false);
As less coding as
                                                   // OPTION 3:
possible!!!
                                                   // Registration to specific tag notifications
                                                   ArrayList<String> tags = new ArrayList<String>();
Library does the dirty                             tags.add("tag_name_1");
job!                                                        // ... any other tags developer wants
                                                   tags.add("tag_name_v");
                                                   PushNotification.register(this, tags);
                                                   // choose according to your needs!



Mando Stamelaki | Android Cloud2Device Messaging
Any Questions?
Resources

                                                   Resources

                                                   1. Google Projects for Android: C2DM
                                                         http://code.google.com/android/c2dm/

                                                   2. Android Cloud To Device Messaging
                                                         http://android-developers.blogspot.com/2010/05/android-cloud-to-device-
                                                         messaging.html

                                                   3. Android C2DM Push Notification
                                                         http://stackoverflow.com/questions/6276342/android-c2dm-push-notification

                                                   4. Android C2DM server and client implementation working
                                                         http://markmelive.com/2011/04/android-c2dm-server-and-client-
                                                         implementation-working/

                                                   5. C2DM Tutorial Send push notifications to your applications with Android C2DM |
                                                      Cloud To Device Messaging Tutorial
                                                         http://www.hightechno.info/2011/08/c2dm-tutorial-send-push-notifications.html

                                                   6. Android Cloud to Device Messaging (C2DM) - Tutorial
                                                         http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html

                                                   7. Cloud to device messaging
                                                         http://www.androidkit.com/cloud-to-device-messaging




Mando Stamelaki | Android Cloud2Device Messaging
Mando Stamelaki 
        THANK YOU
Mobile Application Developer
m.stamelaki@m-stat.gr




          M-STAT | Android Clould2Device Messaging

More Related Content

What's hot

Device+Cloud: come sviluppare App moderne ed interconnesse
Device+Cloud: come sviluppare App moderne ed interconnesseDevice+Cloud: come sviluppare App moderne ed interconnesse
Device+Cloud: come sviluppare App moderne ed interconnesseNinja Marketing
 
Konferans Server
Konferans ServerKonferans Server
Konferans Serverguestae06a5
 
Microsoft Word - Widearea Systems Capabilities 2010
Microsoft Word - Widearea Systems Capabilities 2010Microsoft Word - Widearea Systems Capabilities 2010
Microsoft Word - Widearea Systems Capabilities 2010Videoguy
 
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
 
NexGen Software Inc
NexGen Software IncNexGen Software Inc
NexGen Software Incpervinder
 
Cisco UCM Mobility Services
Cisco UCM Mobility ServicesCisco UCM Mobility Services
Cisco UCM Mobility ServicesCisco Russia
 
VMware world news
VMware world newsVMware world news
VMware world newsASBIS SK
 
PresenceTech & Bank Atlantic Case Study
PresenceTech & Bank Atlantic Case StudyPresenceTech & Bank Atlantic Case Study
PresenceTech & Bank Atlantic Case StudyPresence Technology
 
Azotel Aikom 8giugno2012 Bologna
Azotel Aikom 8giugno2012 BolognaAzotel Aikom 8giugno2012 Bologna
Azotel Aikom 8giugno2012 BolognaAikom Technology
 
Notifysync datasheet voor office365
Notifysync datasheet voor  office365Notifysync datasheet voor  office365
Notifysync datasheet voor office365tmi3
 
Centros de contacto: las demandas y requerimientos del mercado
Centros de contacto: las demandas y requerimientos del mercadoCentros de contacto: las demandas y requerimientos del mercado
Centros de contacto: las demandas y requerimientos del mercadoMundo Contact
 
Exchange + WIndows Mobile Datasheet
Exchange + WIndows Mobile DatasheetExchange + WIndows Mobile Datasheet
Exchange + WIndows Mobile DatasheetHiram Verma
 

What's hot (16)

Device+Cloud: come sviluppare App moderne ed interconnesse
Device+Cloud: come sviluppare App moderne ed interconnesseDevice+Cloud: come sviluppare App moderne ed interconnesse
Device+Cloud: come sviluppare App moderne ed interconnesse
 
Konferans Server
Konferans ServerKonferans Server
Konferans Server
 
Microsoft Word - Widearea Systems Capabilities 2010
Microsoft Word - Widearea Systems Capabilities 2010Microsoft Word - Widearea Systems Capabilities 2010
Microsoft Word - Widearea Systems Capabilities 2010
 
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...
 
NexGen Software Inc
NexGen Software IncNexGen Software Inc
NexGen Software Inc
 
Cisco UCM Mobility Services
Cisco UCM Mobility ServicesCisco UCM Mobility Services
Cisco UCM Mobility Services
 
VMware world news
VMware world newsVMware world news
VMware world news
 
PresenceTech & Bank Atlantic Case Study
PresenceTech & Bank Atlantic Case StudyPresenceTech & Bank Atlantic Case Study
PresenceTech & Bank Atlantic Case Study
 
Eska mmc
Eska mmcEska mmc
Eska mmc
 
Uc(
Uc(Uc(
Uc(
 
Azotel Aikom 8giugno2012 Bologna
Azotel Aikom 8giugno2012 BolognaAzotel Aikom 8giugno2012 Bologna
Azotel Aikom 8giugno2012 Bologna
 
Notifysync datasheet voor office365
Notifysync datasheet voor  office365Notifysync datasheet voor  office365
Notifysync datasheet voor office365
 
IMfirst
IMfirstIMfirst
IMfirst
 
Centros de contacto: las demandas y requerimientos del mercado
Centros de contacto: las demandas y requerimientos del mercadoCentros de contacto: las demandas y requerimientos del mercado
Centros de contacto: las demandas y requerimientos del mercado
 
Mxm 4 7 Ds
Mxm 4 7 DsMxm 4 7 Ds
Mxm 4 7 Ds
 
Exchange + WIndows Mobile Datasheet
Exchange + WIndows Mobile DatasheetExchange + WIndows Mobile Datasheet
Exchange + WIndows Mobile Datasheet
 

Similar to Android Cloud to Device Messaging Framework

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 androidRIA RUI Society
 
Peuker, Neu: Enterprise Android for the Win
Peuker, Neu: Enterprise Android for the WinPeuker, Neu: Enterprise Android for the Win
Peuker, Neu: Enterprise Android for the WinDroidcon Berlin
 
Jan Peuker, Raoul Neu: Enterprise Android for the Win
Jan Peuker, Raoul Neu: Enterprise Android for the WinJan Peuker, Raoul Neu: Enterprise Android for the Win
Jan Peuker, Raoul Neu: Enterprise Android for the WinDroidcon Berlin
 
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
 
Inventit service sync internet-of-things m2m application enablement platform
Inventit service sync internet-of-things m2m application enablement platformInventit service sync internet-of-things m2m application enablement platform
Inventit service sync internet-of-things m2m application enablement platformtaknishida
 
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.MEBecome a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.MEPlasma Computing Group
 
Indicus Profile 2013
Indicus Profile 2013Indicus Profile 2013
Indicus Profile 2013samjoshi
 
ServiceSync Overview at CloudExpo
ServiceSync Overview at CloudExpoServiceSync Overview at CloudExpo
ServiceSync Overview at CloudExpoInventit Inc.
 
Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...
Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...
Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...Capgemini
 
Mindtree's expertise in machine to machine (M2M).
Mindtree's expertise in machine to machine (M2M).Mindtree's expertise in machine to machine (M2M).
Mindtree's expertise in machine to machine (M2M).Mindtree Ltd.
 
Ctek Cellular Automation & Control Catalag 2014
Ctek Cellular Automation & Control Catalag 2014Ctek Cellular Automation & Control Catalag 2014
Ctek Cellular Automation & Control Catalag 2014Lynn Woodruff
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app developmentMuthu Kumar
 
EclipseCon Europe 2011 m2m workshop
EclipseCon Europe 2011 m2m workshopEclipseCon Europe 2011 m2m workshop
EclipseCon Europe 2011 m2m workshopThibault Cantegrel
 
Citrix Receiver: the road ahead
Citrix Receiver: the road aheadCitrix Receiver: the road ahead
Citrix Receiver: the road aheadCitrix
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging Lavakush Verma
 

Similar to Android Cloud to Device Messaging Framework (20)

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
 
Workshop: Android
Workshop: AndroidWorkshop: Android
Workshop: Android
 
Peuker, Neu: Enterprise Android for the Win
Peuker, Neu: Enterprise Android for the WinPeuker, Neu: Enterprise Android for the Win
Peuker, Neu: Enterprise Android for the Win
 
Jan Peuker, Raoul Neu: Enterprise Android for the Win
Jan Peuker, Raoul Neu: Enterprise Android for the WinJan Peuker, Raoul Neu: Enterprise Android for the Win
Jan Peuker, Raoul Neu: Enterprise Android for the Win
 
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
 
Inventit service sync internet-of-things m2m application enablement platform
Inventit service sync internet-of-things m2m application enablement platformInventit service sync internet-of-things m2m application enablement platform
Inventit service sync internet-of-things m2m application enablement platform
 
Magda badita gcm
Magda badita  gcmMagda badita  gcm
Magda badita gcm
 
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.MEBecome a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
Become a Part of Internet of Things (IoT) Revolution with CONNECT2.ME
 
Indicus Profile 2013
Indicus Profile 2013Indicus Profile 2013
Indicus Profile 2013
 
ServiceSync Overview at CloudExpo
ServiceSync Overview at CloudExpoServiceSync Overview at CloudExpo
ServiceSync Overview at CloudExpo
 
DirectAccess
DirectAccessDirectAccess
DirectAccess
 
Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...
Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...
Alstom Grid And Capgemini Form Global Alliance For Smart Grid: About the Firs...
 
AutoMate+
AutoMate+AutoMate+
AutoMate+
 
Mindtree's expertise in machine to machine (M2M).
Mindtree's expertise in machine to machine (M2M).Mindtree's expertise in machine to machine (M2M).
Mindtree's expertise in machine to machine (M2M).
 
Ctek Cellular Automation & Control Catalag 2014
Ctek Cellular Automation & Control Catalag 2014Ctek Cellular Automation & Control Catalag 2014
Ctek Cellular Automation & Control Catalag 2014
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app development
 
EclipseCon Europe 2011 m2m workshop
EclipseCon Europe 2011 m2m workshopEclipseCon Europe 2011 m2m workshop
EclipseCon Europe 2011 m2m workshop
 
Citrix Receiver: the road ahead
Citrix Receiver: the road aheadCitrix Receiver: the road ahead
Citrix Receiver: the road ahead
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 

Android Cloud to Device Messaging Framework

  • 1. Android Cloud2Device Messaging Communicate with your app! Mando Stamelaki M-STAT – Mobile Application Developer | | | 2012 Copyright M-STAT SA
  • 2. Android Cloud to Device Messaging Framework (AC2DM) What is Android C2DM Framework? Introduction to AC2DM Android Cloud to Device Messaging (C2DM) is – a service that helps developers send data from servers to their applications on Android devices. Google Service for The service provides a: pushing messages to – simple, Android devices. – lightweight mechanism that servers can use to: – tell mobile applications to contact the server directly, – fetch updated application or user data. Push Notifications for The C2DM service handles Android Phones, – all aspects of queuing of messages and Tablets and other – delivery to the target application running on the target devices. device. Mando Stamelaki | Android Cloud2Device Messaging
  • 3. AC2DM Android Cloud to device Messaging, provided free by Google Servers Advantages Disadvantages • 3rd party application servers send lightweight • C2DM makes no guarantees about delivery messages to their Android applications. or the order of messages. • An application on an Android device doesn’t • Does not provide built-in user interface or need to be running to receive messages. other handling for message data. • Uses an existing connection for Google • Requires devices running Android 2.2 or services, with the set up Google account on higher that also have the Market application mobile device. installed. Mando Stamelaki | Android Cloud2Device Messaging
  • 4. coming M-STAT Service In the role of 3rd party server soon Server-side Mobile Application Encountering C2DM disadvantages • No need to setup a server in • Easy integration in your • Application ability to inform order to send notification Application M-STAT server when a push messages. message is received • Full documentation for • User friendly environment. developers • Library provides a built-in handler for messages • Cross-platform push • Documented code examples notifications (iOS supported, Windows Phone on the way!) • Easy customizable to your app needs. Mando Stamelaki | Android Cloud2Device Messaging
  • 5. C2DM communication Communication flow between M-STAT (3rd party server) and Google request register Android registration id Application Servers (Device) (C2DM | Client Login) Push message registration id send id | error [tags] registration id message key id authorization Notification requests Server authorization authorization Mando Stamelaki | Android Cloud2Device Messaging
  • 6. M-STAT Server HTTP Communication protocol REGISTER • A device for push notifications • Update an existing device CURRENT STATUS • Registration status and tags if any UNREGISTER • Remove a device from the list Mando Stamelaki | Android Cloud2Device Messaging
  • 7. Preferences Preferences • Enable / Disable C2DM service • Register/Unregister from Google • Register/Unregister from M-STAT • Register to specific notification tags • An app can let users receive notifications for specific things (up to each developer) and not everything • Retrieve registration status Mando Stamelaki | Android Cloud2Device Messaging
  • 8. Software Development Kit for M-STAT Notification Service The SDK contains: • Library • Mobile App • Examples Mando Stamelaki | Android Cloud2Device Messaging
  • 9. SDK Library • Implementing the process to register and unregister from Google servers. • Connect to M-STAT’s servers and pass the registration id, and other preferences. Mando Stamelaki | Android Cloud2Device Messaging
  • 10. SDK Mobile Helping App • Representing the usage of library • Helping developers to test the service without having to implement their own application. Mando Stamelaki | Android Cloud2Device Messaging
  • 12. Start with . . . adding the Library to your project Mando Stamelaki | Android Cloud2Device Messaging
  • 13. Integrate M-STAT’s library AndroidManifest.xml (1 of 2) <xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="gr.mstat.example" android:versionCode="1" android:versionName="1.0" > <!-- Android 2.2 --> <uses-sdk android:minSdkVersion="8" /> <!-- Permissions --> <permission android:name="gr.mstat.example.permission.C2D_MESSAGE“ android:protectionLevel="signature" /> <uses-permission android:name="gr.mstat.example.permission.C2D_MESSAGE" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- ... other permissions here ... --> Mando Stamelaki | Android Cloud2Device Messaging
  • 14. Integrate M-STAT’s library AndroidManifest.xml (2 of 2) <application><!-- ... any activities | services | receivers here ... --> <service android:name="gr.mstat.c2dm.C2DMReceiver" /> <receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <!-- Receive the actual message --> <action android:name="com.google.android.c2dm.intent.RECEIVE"/> <category android:name="gr.mstat.example" /> </intent-filter> <intent-filter> <!-- Receive the registration id --> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="gr.mstat.example" /> </intent-filter> </receiver> </application> <!-- ... other code here ... --> </manifest> Mando Stamelaki | Android Cloud2Device Messaging
  • 15. Calling the library Startup class or any class where you want the notification service being initialized Still under “deep thought” but will look to something like… Single line initialization // this refers to a Context object // OPTION 1: Different ways of // Starts up the service according to a preference initialization from application preferences PushNotification.registerAuto(this); Customized preferences // OPTION 2: // Manual register or unregister to the service PushNotification.register(this, true); BUT ALL WITH: PushNotification.register(this, false); As less coding as // OPTION 3: possible!!! // Registration to specific tag notifications ArrayList<String> tags = new ArrayList<String>(); Library does the dirty tags.add("tag_name_1"); job! // ... any other tags developer wants tags.add("tag_name_v"); PushNotification.register(this, tags); // choose according to your needs! Mando Stamelaki | Android Cloud2Device Messaging
  • 17. Resources Resources 1. Google Projects for Android: C2DM http://code.google.com/android/c2dm/ 2. Android Cloud To Device Messaging http://android-developers.blogspot.com/2010/05/android-cloud-to-device- messaging.html 3. Android C2DM Push Notification http://stackoverflow.com/questions/6276342/android-c2dm-push-notification 4. Android C2DM server and client implementation working http://markmelive.com/2011/04/android-c2dm-server-and-client- implementation-working/ 5. C2DM Tutorial Send push notifications to your applications with Android C2DM | Cloud To Device Messaging Tutorial http://www.hightechno.info/2011/08/c2dm-tutorial-send-push-notifications.html 6. Android Cloud to Device Messaging (C2DM) - Tutorial http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html 7. Cloud to device messaging http://www.androidkit.com/cloud-to-device-messaging Mando Stamelaki | Android Cloud2Device Messaging
  • 18. Mando Stamelaki  THANK YOU Mobile Application Developer m.stamelaki@m-stat.gr M-STAT | Android Clould2Device Messaging