SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Fernando Cejas - @fernando_cejas
Fernando García - @fegabe
›  Introduction
›  What’s Push?
›  Push vs. Poll
›  Cloud to device messaging
›  Android Implementation
›  Build your app
›  ?
›  F.A.Q
›  “fastDovePush”
                         ›  Who   we are?
  App for this demo




     ›    open source
Push technology, or server push, describes a style of Internet-
based communication where the request for a given
transaction is initiated by the publisher or central server.




                             ›  Harder to implement
                             ›  Less battery consumption
                             ›  Constant connection
Push me your news!
          Any news?
             No!
          Any news?
             No!
          Any news?
             No!          New            News!
                        content!
          Any news?
          Yes! (News)




›  Transfer
           content as soon as available
›  Save device battery
›  Reduce data traffic for user
›  HaIt
      allows third-party application servers to
  send lightweight messages to their Android
  applications

›  C2DM makes no guarantees about delivery or
  the order of messages

›  An
     application on an Android device doesn’t
  need to be running to receive messages
›  It
     does not provide any built-in user interface or
   other handling for message data

›  It
     requires devices running Android 2.2 or higher
   that also have the Market application installed

›  It
     uses an existing connection for Google
   services
1.    Register device for Push   3.    Device receives message
2.    App server send message    4.    Unregister device
›  Requesting   a Registration ID

C2DMessaging.register(this, "sender@gmail.com");
›  Receiving     the Registration ID

public class C2DMReceiver extends C2DMBaseReceiver {	
        		
        	public C2DMReceiver() {	
        	        	super("sender@gmail.com"); 	
        	}	
	
        	@Override	
        	public void onRegistered(Context context, String registrationId) {   	
        	        	// TODO send registration ID to the app server	
        	}	
        	... 	
}
›  Receiving    Messages

public class C2DMReceiver extends C2DMBaseReceiver {	
        	...	
	
        	@Override	
        	protected void onMessage(Context context, Intent intent) {	
        	        		
        	        	String payload = intent.getStringExtra("payload");	
        	        	// TODO handle the message	
        	}	
}
›  Android      Manifest
<application>	
        ...	
         	                 	
        <!-- required for AC2DM -->	
        <service android:name="com.fastdove.sample.ac2dm.C2DMReceiver" />	
	
        <receiver	
             android:name="com.google.android.c2dm.C2DMBroadcastReceiver"	
             android:permission="com.google.android.c2dm.permission.SEND">	
             <intent-filter>	
                 <action android:name="com.google.android.c2dm.intent.REGISTRATION" />	
                 <category android:name="com.fastdove.sample.ac2dm" />	
             </intent-filter>	
             <intent-filter>	
                 <action android:name="com.google.android.c2dm.intent.RECEIVE" />	
                 <category android:name="com.fastdove.sample.ac2dm" />	
             </intent-filter>	
        </receiver>	
        <!-- END required for AC2DM --> 	
	
</application>
›  Request   Authorization Token
$ curl https://www.google.com/accounts/ClientLogin -d
accountType=GOOGLE -d source=Google-cURL-Example -d
service=ac2dm -d Email=sender@gmail.com -d "Passwd=***"

›  Send   Message
$ curl --header "Authorization: GoogleLogin auth=authorization_id"
"https://android.apis.google.com/c2dm/send" -d
registration_id=device_registration_id -d "data.payload=your
message" -d collapse_key=something
http://www.fastdove.com/

@fastdove
@fastdovedev

info@fastdove.com

Fernando Cejas - @fernando_cejas
Fernando García - @fegabe

Contenu connexe

En vedette

2 activity user_interface
2 activity user_interface2 activity user_interface
2 activity user_interface
Saber LAJILI
 

En vedette (13)

Andrés Leonardo Martínez - Marketing Manager LATAM - Blue Via
Andrés Leonardo Martínez - Marketing Manager LATAM - Blue ViaAndrés Leonardo Martínez - Marketing Manager LATAM - Blue Via
Andrés Leonardo Martínez - Marketing Manager LATAM - Blue Via
 
2 activity user_interface
2 activity user_interface2 activity user_interface
2 activity user_interface
 
yuilop
yuilopyuilop
yuilop
 
Social Diabetis
Social DiabetisSocial Diabetis
Social Diabetis
 
Kirubs
KirubsKirubs
Kirubs
 
TAM-TAM
TAM-TAM TAM-TAM
TAM-TAM
 
Workshop IOS
Workshop IOSWorkshop IOS
Workshop IOS
 
Licenciamento de Personagens como Estratégia de Marketing e Publicidade Infan...
Licenciamento de Personagens como Estratégia de Marketing e Publicidade Infan...Licenciamento de Personagens como Estratégia de Marketing e Publicidade Infan...
Licenciamento de Personagens como Estratégia de Marketing e Publicidade Infan...
 
Antonio Sánchez - Mobile Marketing Director - Elogia
Antonio Sánchez - Mobile Marketing Director - ElogiaAntonio Sánchez - Mobile Marketing Director - Elogia
Antonio Sánchez - Mobile Marketing Director - Elogia
 
Principais fatores que influenciam na entrega do seu e-mail marketing
Principais fatores que influenciam na entrega do seu e-mail marketing Principais fatores que influenciam na entrega do seu e-mail marketing
Principais fatores que influenciam na entrega do seu e-mail marketing
 
Planeta
PlanetaPlaneta
Planeta
 
Softonic
SoftonicSoftonic
Softonic
 
Aerografos
AerografosAerografos
Aerografos
 

Similaire à Workshop: Android

Android cloud to device messaging
Android cloud to device messagingAndroid cloud to device messaging
Android cloud to device messaging
Fe
 
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
RIA RUI Society
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
Positive Hack Days
 
Android Cloud2Device Messaging
Android Cloud2Device MessagingAndroid Cloud2Device Messaging
Android Cloud2Device Messaging
Mando Stam
 

Similaire à Workshop: Android (20)

Android cloud to device messaging
Android cloud to device messagingAndroid cloud to device messaging
Android cloud to device messaging
 
FOSS STHLM Android Cloud to Device Messaging
FOSS STHLM Android Cloud to Device MessagingFOSS STHLM Android Cloud to Device Messaging
FOSS STHLM Android Cloud to Device Messaging
 
Android Cloud to Device Messaging Framework at GTUG Stockholm
Android Cloud to Device Messaging Framework at GTUG StockholmAndroid Cloud to Device Messaging Framework at GTUG Stockholm
Android Cloud to Device Messaging Framework at GTUG Stockholm
 
GCM aperitivo Android
GCM aperitivo AndroidGCM aperitivo Android
GCM aperitivo Android
 
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
 
AC2DM For Security
AC2DM For SecurityAC2DM For Security
AC2DM For Security
 
Magda badita gcm
Magda badita  gcmMagda badita  gcm
Magda badita gcm
 
GCM with Pushbots
GCM with PushbotsGCM with Pushbots
GCM with Pushbots
 
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
 
GCM Technology for Android
GCM Technology for AndroidGCM Technology for Android
GCM Technology for Android
 
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloud
 
Android Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App EngineAndroid Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App Engine
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Push Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDKPush Notification in IBM MobileFirst Xamarin SDK
Push Notification in IBM MobileFirst Xamarin SDK
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
 
Android Cloud2Device Messaging
Android Cloud2Device MessagingAndroid Cloud2Device Messaging
Android Cloud2Device Messaging
 
Urban Airship and Android Integration for Push Notification and In-App Notifi...
Urban Airship and Android Integration for Push Notification and In-App Notifi...Urban Airship and Android Integration for Push Notification and In-App Notifi...
Urban Airship and Android Integration for Push Notification and In-App Notifi...
 

Plus de Barcelona Digital Technology Centre

Plus de Barcelona Digital Technology Centre (20)

Mobile Accessibility
Mobile AccessibilityMobile Accessibility
Mobile Accessibility
 
JoSócAqui
JoSócAquiJoSócAqui
JoSócAqui
 
Supertrupper
SupertrupperSupertrupper
Supertrupper
 
360 iPad - Acceso
360 iPad - Acceso360 iPad - Acceso
360 iPad - Acceso
 
SAURION
SAURIONSAURION
SAURION
 
Evermind
EvermindEvermind
Evermind
 
Cirkana
CirkanaCirkana
Cirkana
 
Qvemos - VerticeIN
Qvemos - VerticeINQvemos - VerticeIN
Qvemos - VerticeIN
 
Gerd Leonhard: Futurist Apps
Gerd Leonhard: Futurist AppsGerd Leonhard: Futurist Apps
Gerd Leonhard: Futurist Apps
 
David Urbano - Mobile Director - "e-laCaixa"
David Urbano - Mobile Director - "e-laCaixa"David Urbano - Mobile Director - "e-laCaixa"
David Urbano - Mobile Director - "e-laCaixa"
 
Erik Hersman - Nairobi's Innovation Hub
Erik Hersman - Nairobi's Innovation HubErik Hersman - Nairobi's Innovation Hub
Erik Hersman - Nairobi's Innovation Hub
 
Mario Yáñez - Director de solucions bancàries - Tecnocom
Mario Yáñez - Director de solucions bancàries - TecnocomMario Yáñez - Director de solucions bancàries - Tecnocom
Mario Yáñez - Director de solucions bancàries - Tecnocom
 
Carles Fradera - Director General- Barcelona Digital Centre Tecnològic
Carles Fradera - Director General- Barcelona Digital Centre TecnològicCarles Fradera - Director General- Barcelona Digital Centre Tecnològic
Carles Fradera - Director General- Barcelona Digital Centre Tecnològic
 
Andrés Leonardo - Marketing Manager LATAM - BlueVia
 Andrés Leonardo - Marketing Manager LATAM  - BlueVia Andrés Leonardo - Marketing Manager LATAM  - BlueVia
Andrés Leonardo - Marketing Manager LATAM - BlueVia
 
Eial Bluer - Soci Fundador - Sefarad Consulting
Eial Bluer - Soci Fundador - Sefarad ConsultingEial Bluer - Soci Fundador - Sefarad Consulting
Eial Bluer - Soci Fundador - Sefarad Consulting
 
Michael Kappler - Director del Departament de Consulting i Soci - IVC
Michael Kappler - Director del Departament de Consulting  i Soci - IVC  Michael Kappler - Director del Departament de Consulting  i Soci - IVC
Michael Kappler - Director del Departament de Consulting i Soci - IVC
 
Mariano Contreras - Director - Mobile Leadership
Mariano Contreras - Director - Mobile Leadership Mariano Contreras - Director - Mobile Leadership
Mariano Contreras - Director - Mobile Leadership
 
J cuesta
J cuestaJ cuesta
J cuesta
 
Haru Yamasaki - Directora de Programa - Tech BA
Haru Yamasaki - Directora de Programa - Tech BAHaru Yamasaki - Directora de Programa - Tech BA
Haru Yamasaki - Directora de Programa - Tech BA
 
Fast Dove Product
Fast Dove ProductFast Dove Product
Fast Dove Product
 

Dernier

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 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
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.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
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Workshop: Android

  • 1. Fernando Cejas - @fernando_cejas Fernando García - @fegabe
  • 2. ›  Introduction ›  What’s Push? ›  Push vs. Poll ›  Cloud to device messaging ›  Android Implementation ›  Build your app ›  ? ›  F.A.Q
  • 3. ›  “fastDovePush” ›  Who we are? App for this demo ›  open source
  • 4. Push technology, or server push, describes a style of Internet- based communication where the request for a given transaction is initiated by the publisher or central server. ›  Harder to implement ›  Less battery consumption ›  Constant connection
  • 5. Push me your news! Any news? No! Any news? No! Any news? No! New News! content! Any news? Yes! (News) ›  Transfer content as soon as available ›  Save device battery ›  Reduce data traffic for user
  • 6. ›  HaIt allows third-party application servers to send lightweight messages to their Android applications ›  C2DM makes no guarantees about delivery or the order of messages ›  An application on an Android device doesn’t need to be running to receive messages
  • 7. ›  It does not provide any built-in user interface or other handling for message data ›  It requires devices running Android 2.2 or higher that also have the Market application installed ›  It uses an existing connection for Google services
  • 8. 1.  Register device for Push 3.  Device receives message 2.  App server send message 4.  Unregister device
  • 9. ›  Requesting a Registration ID C2DMessaging.register(this, "sender@gmail.com");
  • 10. ›  Receiving the Registration ID public class C2DMReceiver extends C2DMBaseReceiver { public C2DMReceiver() { super("sender@gmail.com"); } @Override public void onRegistered(Context context, String registrationId) { // TODO send registration ID to the app server } ... }
  • 11. ›  Receiving Messages public class C2DMReceiver extends C2DMBaseReceiver { ... @Override protected void onMessage(Context context, Intent intent) { String payload = intent.getStringExtra("payload"); // TODO handle the message } }
  • 12. ›  Android Manifest <application> ... <!-- required for AC2DM --> <service android:name="com.fastdove.sample.ac2dm.C2DMReceiver" /> <receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="com.fastdove.sample.ac2dm" /> </intent-filter> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.fastdove.sample.ac2dm" /> </intent-filter> </receiver> <!-- END required for AC2DM --> </application>
  • 13. ›  Request Authorization Token $ curl https://www.google.com/accounts/ClientLogin -d accountType=GOOGLE -d source=Google-cURL-Example -d service=ac2dm -d Email=sender@gmail.com -d "Passwd=***" ›  Send Message $ curl --header "Authorization: GoogleLogin auth=authorization_id" "https://android.apis.google.com/c2dm/send" -d registration_id=device_registration_id -d "data.payload=your message" -d collapse_key=something
  • 14.
  • 15.