SlideShare uma empresa Scribd logo
1 de 19
ROME 11-12 april 2014ROME 11-12 april 2014
Android & Internet of Things with Google
Cloud Messaging and AppEngine
GDG Roma L-AB
Antonino Orlando
Simone Pulcini e il GDG Roma L-AB
ROME 11-12 april 2014
Chi siamo: GDG Roma L-AB
http://goo.gl/QG40Os http://goo.gl/6QRlP9
http://goo.gl/cEF2Yn
Il nostro prossimo evento:
ROME 11-12 april 2014
• orlando.antonino@gmail.com
• http://it.linkedin.com/in/orlan
doantonino
• https://plus.google.com/+Anto
ninoOrlando
Chi siamo: Antonino Orlando
ROME 11-12 april 2014
• simone.pulcini@gmail.com
• http://www.linkedin.com/i
n/simonepulcini
• https://plus.google.com/+S
imonePulcini
Chi siamo: Simone Pulcini
ROME 11-12 april 2014
NFC
• RFID (Radio Frequency Identification)
• permette una comunicazione bidirezionale:
entro un raggio di 4 cm
• opera alla frequenza di 13,56 MHz e può
raggiungere una velocità di trasmissione
massima di 424 kbit/s.
ROME 11-12 april 2014
Google Cloud Messaging
1) Invio un messaggio a gcm
2) GCM inoltre al device
ROME 11-12 april 2014
Workflow del lab
1) Il dispositivo rileva un tag
2) il dispositivo notifica l'evento
al nostro backend
3) il backend chiede l'invio della
notifica a GCM
4) GCM inoltra la notifica
all'utente
ROME 11-12 april 2014
Stack software e sorgenti
• ADT Bundle più Plug-in Eclipse per GAE
• Google Play Services (da Android SDK Extras)
• Android Support Library (da Android SDK
Extras)
• github.com/orlando-antonino/GdGLAb_IoT-
AppEngine_TODO.git
• github.com/orlando-antonino/SendByNFC.git
• github.com/spulci/codemotion2014/tree/master/Co
demotionIOTLabBackend
ROME 11-12 april 2014
• All'interno del progetto
possiamo trovare i passi di
sviluppo usando la view
“tasks” di eclipse
• Abbiamo un tempo definito
per eseguire ogni “todo”
• siamo qui per sviluppare
insieme... fate domande
Lab How-to
ROME 11-12 april 2014
• Richiamiamo il metodo
all'interno dell'activity per
richiedere un
registrationID al server
GCM
• http://developer.android.com/
reference/com/google/androi
d/gms/gcm/GoogleCloudMess
aging.html
Step 1: registration ID
ROME 11-12 april 2014
• Inseriamo nelle S.P.:
1. property_reg_id
2. property_app_version
• recuperiamo dalle S.P. il
registrationID memorizzato
precedentemente:
1. property_reg_id
http://developer.android.com/referen
ce/android/content/SharedPreferenc
es.html
Step 2: Shared Preferences
ROME 11-12 april 2014
• inseriamo il codice necessario a
richiedere il registrationID al GCM
server
• richiamiamo il metodo all'interno
dell'activity per memorizzare
localmente il registrationID
• inviamo il registrationID al
backend AppEngine
http://developer.android.com/reference/co
m/google/android/gms/gcm/GoogleCloudM
essaging.html
Step 3: GCM
ROME 11-12 april 2014
• Entity: lightweight
persistence domain object
• Annotazioni JPA usate:
@Entity, @Id,
@GeneratedValue
• https://developers.google.com/a
ppengine/docs/java/datastore/jp
a/overview-dn2?hl=it
Step 4: creazione di un Entity Bean
ROME 11-12 april 2014
• Pattern DAO
• Diversi servizi già realizzati
• Il servizio da realizzare rende
persistente un ClientBean
• https://developers.google.co
m/appengine/docs/java/data
store/jpa/overview-dn2?hl=it
Step 5: servizio addClientBean
ROME 11-12 april 2014
• Esponiamo un servizio sul
web in modo da poterlo
chiamare da remoto (dal
client android)
• Annotazioni: @Api,
@ApiMethod (con attributi)
• https://developers.google.co
m/appengine/docs/java/endp
oints/
Step 6: creazione Cloud Endpoint
ROME 11-12 april 2014
• Radice progetto (tasto
destro): Google -> Generate
Cloud Endpoint Client
Library
• Innestiamo il codice nel
client Android sistemando i
jar generati e chiamando le
API (lo abbiamo fatto noi
per voi)
Step 7: generiamo e integriamo… (1/2)
ROME 11-12 april 2014
Step 7: generiamo e integriamo… (2/2)
• riempiamo la segnatura remota per l'operazione
addclient che prende un ClientBean popolato dal suo
registrationId e lo memorizza sul datastore
invocando il metodo remoto
• lanciamo l'operazione remota di cui abbiamo
preparato la segnatura di cui sopra: viene aperta una
connessione HTTP e viene effettuata la chiamata
ROME 11-12 april 2014
E per finire….GCM server side
• GCM può essere interrogato via HTTP o XMPP
• Lato server in HTTP abbiamo usato
l’implementazione del progetto
http://code.google.com/p/gcm/source/brows
e/#git%2Fgcm-server
• I formati della message request e altra
documentazione:
https://developer.android.com/google/gcm/ht
tp.html
ROME 11-12 april 2014
GRAZIE A TUTTI!

Mais conteúdo relacionado

Semelhante a Android & Internet of things with Google Cloud Messaging and AppEngine - Orlando and Pulcini

Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...Codemotion
 
Gae python gdg milano L03
Gae python gdg milano L03Gae python gdg milano L03
Gae python gdg milano L03Paolo Dadda
 
GAE python GDG Milano L06
GAE python GDG Milano L06GAE python GDG Milano L06
GAE python GDG Milano L06Paolo Dadda
 
GAE python GDG Milano L04
GAE python GDG Milano L04GAE python GDG Milano L04
GAE python GDG Milano L04Paolo Dadda
 
The Web as a Goldmine (for journalists)
The Web as a Goldmine (for journalists)The Web as a Goldmine (for journalists)
The Web as a Goldmine (for journalists)Guido Romeo
 
GAE python GDG Milano - L01
GAE python GDG Milano - L01GAE python GDG Milano - L01
GAE python GDG Milano - L01Paolo Dadda
 
Creare un tema Responsive per Magento con Bootstrap
Creare un tema Responsive per Magento con BootstrapCreare un tema Responsive per Magento con Bootstrap
Creare un tema Responsive per Magento con BootstrapAndrea Saccà
 
00 - VMUGIT - Lecce 2018 - Intro
00 - VMUGIT - Lecce 2018 - Intro00 - VMUGIT - Lecce 2018 - Intro
00 - VMUGIT - Lecce 2018 - IntroVMUG IT
 
Google My Business - Sui social ti trovano, su Google ti cercano.
Google My Business - Sui social ti trovano, su Google ti cercano.Google My Business - Sui social ti trovano, su Google ti cercano.
Google My Business - Sui social ti trovano, su Google ti cercano.Davide Garufi
 
Come fly with me - Minerva and Del Pino
Come fly with me - Minerva and Del PinoCome fly with me - Minerva and Del Pino
Come fly with me - Minerva and Del PinoCodemotion
 
Market e Tools: Utility per la personalizzazione di applicazioni Android
Market e Tools: Utility per la personalizzazione di applicazioni AndroidMarket e Tools: Utility per la personalizzazione di applicazioni Android
Market e Tools: Utility per la personalizzazione di applicazioni AndroidAndrea Pola
 

Semelhante a Android & Internet of things with Google Cloud Messaging and AppEngine - Orlando and Pulcini (20)

Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
 
Wp app studio_new
Wp app studio_newWp app studio_new
Wp app studio_new
 
Gae python gdg milano L03
Gae python gdg milano L03Gae python gdg milano L03
Gae python gdg milano L03
 
GAE python GDG Milano L06
GAE python GDG Milano L06GAE python GDG Milano L06
GAE python GDG Milano L06
 
GAE python GDG Milano L04
GAE python GDG Milano L04GAE python GDG Milano L04
GAE python GDG Milano L04
 
The Web as a Goldmine (for journalists)
The Web as a Goldmine (for journalists)The Web as a Goldmine (for journalists)
The Web as a Goldmine (for journalists)
 
Easymoove ITA
Easymoove ITAEasymoove ITA
Easymoove ITA
 
GAE python GDG Milano - L01
GAE python GDG Milano - L01GAE python GDG Milano - L01
GAE python GDG Milano - L01
 
Introduzione ad Android
Introduzione ad AndroidIntroduzione ad Android
Introduzione ad Android
 
Creare un tema Responsive per Magento con Bootstrap
Creare un tema Responsive per Magento con BootstrapCreare un tema Responsive per Magento con Bootstrap
Creare un tema Responsive per Magento con Bootstrap
 
12. Mobile internet
12. Mobile internet 12. Mobile internet
12. Mobile internet
 
Giacomo Barbieri - Tecnologia per lo Studio - Brescia, 19/02/2014
Giacomo Barbieri - Tecnologia per lo Studio - Brescia, 19/02/2014Giacomo Barbieri - Tecnologia per lo Studio - Brescia, 19/02/2014
Giacomo Barbieri - Tecnologia per lo Studio - Brescia, 19/02/2014
 
00 - VMUGIT - Lecce 2018 - Intro
00 - VMUGIT - Lecce 2018 - Intro00 - VMUGIT - Lecce 2018 - Intro
00 - VMUGIT - Lecce 2018 - Intro
 
Ebeacons attendence
Ebeacons attendenceEbeacons attendence
Ebeacons attendence
 
Google My Business - Sui social ti trovano, su Google ti cercano.
Google My Business - Sui social ti trovano, su Google ti cercano.Google My Business - Sui social ti trovano, su Google ti cercano.
Google My Business - Sui social ti trovano, su Google ti cercano.
 
Come fly with me - Minerva and Del Pino
Come fly with me - Minerva and Del PinoCome fly with me - Minerva and Del Pino
Come fly with me - Minerva and Del Pino
 
Web e Privacy
Web e PrivacyWeb e Privacy
Web e Privacy
 
Creare PWA con Angular
Creare PWA con AngularCreare PWA con Angular
Creare PWA con Angular
 
Market e Tools: Utility per la personalizzazione di applicazioni Android
Market e Tools: Utility per la personalizzazione di applicazioni AndroidMarket e Tools: Utility per la personalizzazione di applicazioni Android
Market e Tools: Utility per la personalizzazione di applicazioni Android
 
platforms
platformsplatforms
platforms
 

Mais de Codemotion

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Codemotion
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyCodemotion
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaCodemotion
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserCodemotion
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Codemotion
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Codemotion
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Codemotion
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 - Codemotion
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Codemotion
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Codemotion
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Codemotion
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Codemotion
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Codemotion
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Codemotion
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...Codemotion
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Codemotion
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Codemotion
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Codemotion
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Codemotion
 

Mais de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Último

Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Associazione Digital Days
 
Programma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoProgramma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoQuotidiano Piemontese
 
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Associazione Digital Days
 
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Associazione Digital Days
 
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Associazione Digital Days
 
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Associazione Digital Days
 
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Associazione Digital Days
 
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Associazione Digital Days
 
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Associazione Digital Days
 

Último (9)

Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
 
Programma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoProgramma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 Torino
 
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
 
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
 
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
 
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
 
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
 
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
 
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
 

Android & Internet of things with Google Cloud Messaging and AppEngine - Orlando and Pulcini

  • 1. ROME 11-12 april 2014ROME 11-12 april 2014 Android & Internet of Things with Google Cloud Messaging and AppEngine GDG Roma L-AB Antonino Orlando Simone Pulcini e il GDG Roma L-AB
  • 2. ROME 11-12 april 2014 Chi siamo: GDG Roma L-AB http://goo.gl/QG40Os http://goo.gl/6QRlP9 http://goo.gl/cEF2Yn Il nostro prossimo evento:
  • 3. ROME 11-12 april 2014 • orlando.antonino@gmail.com • http://it.linkedin.com/in/orlan doantonino • https://plus.google.com/+Anto ninoOrlando Chi siamo: Antonino Orlando
  • 4. ROME 11-12 april 2014 • simone.pulcini@gmail.com • http://www.linkedin.com/i n/simonepulcini • https://plus.google.com/+S imonePulcini Chi siamo: Simone Pulcini
  • 5. ROME 11-12 april 2014 NFC • RFID (Radio Frequency Identification) • permette una comunicazione bidirezionale: entro un raggio di 4 cm • opera alla frequenza di 13,56 MHz e può raggiungere una velocità di trasmissione massima di 424 kbit/s.
  • 6. ROME 11-12 april 2014 Google Cloud Messaging 1) Invio un messaggio a gcm 2) GCM inoltre al device
  • 7. ROME 11-12 april 2014 Workflow del lab 1) Il dispositivo rileva un tag 2) il dispositivo notifica l'evento al nostro backend 3) il backend chiede l'invio della notifica a GCM 4) GCM inoltra la notifica all'utente
  • 8. ROME 11-12 april 2014 Stack software e sorgenti • ADT Bundle più Plug-in Eclipse per GAE • Google Play Services (da Android SDK Extras) • Android Support Library (da Android SDK Extras) • github.com/orlando-antonino/GdGLAb_IoT- AppEngine_TODO.git • github.com/orlando-antonino/SendByNFC.git • github.com/spulci/codemotion2014/tree/master/Co demotionIOTLabBackend
  • 9. ROME 11-12 april 2014 • All'interno del progetto possiamo trovare i passi di sviluppo usando la view “tasks” di eclipse • Abbiamo un tempo definito per eseguire ogni “todo” • siamo qui per sviluppare insieme... fate domande Lab How-to
  • 10. ROME 11-12 april 2014 • Richiamiamo il metodo all'interno dell'activity per richiedere un registrationID al server GCM • http://developer.android.com/ reference/com/google/androi d/gms/gcm/GoogleCloudMess aging.html Step 1: registration ID
  • 11. ROME 11-12 april 2014 • Inseriamo nelle S.P.: 1. property_reg_id 2. property_app_version • recuperiamo dalle S.P. il registrationID memorizzato precedentemente: 1. property_reg_id http://developer.android.com/referen ce/android/content/SharedPreferenc es.html Step 2: Shared Preferences
  • 12. ROME 11-12 april 2014 • inseriamo il codice necessario a richiedere il registrationID al GCM server • richiamiamo il metodo all'interno dell'activity per memorizzare localmente il registrationID • inviamo il registrationID al backend AppEngine http://developer.android.com/reference/co m/google/android/gms/gcm/GoogleCloudM essaging.html Step 3: GCM
  • 13. ROME 11-12 april 2014 • Entity: lightweight persistence domain object • Annotazioni JPA usate: @Entity, @Id, @GeneratedValue • https://developers.google.com/a ppengine/docs/java/datastore/jp a/overview-dn2?hl=it Step 4: creazione di un Entity Bean
  • 14. ROME 11-12 april 2014 • Pattern DAO • Diversi servizi già realizzati • Il servizio da realizzare rende persistente un ClientBean • https://developers.google.co m/appengine/docs/java/data store/jpa/overview-dn2?hl=it Step 5: servizio addClientBean
  • 15. ROME 11-12 april 2014 • Esponiamo un servizio sul web in modo da poterlo chiamare da remoto (dal client android) • Annotazioni: @Api, @ApiMethod (con attributi) • https://developers.google.co m/appengine/docs/java/endp oints/ Step 6: creazione Cloud Endpoint
  • 16. ROME 11-12 april 2014 • Radice progetto (tasto destro): Google -> Generate Cloud Endpoint Client Library • Innestiamo il codice nel client Android sistemando i jar generati e chiamando le API (lo abbiamo fatto noi per voi) Step 7: generiamo e integriamo… (1/2)
  • 17. ROME 11-12 april 2014 Step 7: generiamo e integriamo… (2/2) • riempiamo la segnatura remota per l'operazione addclient che prende un ClientBean popolato dal suo registrationId e lo memorizza sul datastore invocando il metodo remoto • lanciamo l'operazione remota di cui abbiamo preparato la segnatura di cui sopra: viene aperta una connessione HTTP e viene effettuata la chiamata
  • 18. ROME 11-12 april 2014 E per finire….GCM server side • GCM può essere interrogato via HTTP o XMPP • Lato server in HTTP abbiamo usato l’implementazione del progetto http://code.google.com/p/gcm/source/brows e/#git%2Fgcm-server • I formati della message request e altra documentazione: https://developer.android.com/google/gcm/ht tp.html
  • 19. ROME 11-12 april 2014 GRAZIE A TUTTI!