SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
Effective Android Messaging
Juan Gomez
Agenda
• Intro
• HTTP
• WebSockets
• SMS (Text Messages)
• Network Service Discovery
• Review
• Q&A
!2
Eventbrite by the Numbers

Over 2 million events


140 million tickets sold 

$2 billion in gross ticket sales

Events in 179 countries
Intro
Who am I?
• Mobile Engineer at Eventbrite
• Android Developer
• Python enthusiast

!4
Intro
Slides:
• http://lanyrd.com/profile/juandg/
• http://www.andevcon.com/slides

!5
Intro
What do you mean by messaging?
• Communications between devices
• Peer-to-Peer
• Servers are “devices”, and peers too ;)

!6
Intro
Where do I need messaging:
• IM apps
• Multiplayer games
• Enterprise apps
• Many more…

!7
HTTP
HTTP
• Effective Android HTTP by Jesse Wilson
• Presented at AnDevCon Boston
• http://bit.ly/1auYlY2

!9
HTTP (Native)
HttpURLConnection vs Apache HTTP client
• Apache HTTP client works better on Eclair (2.1)
and Froyo (2.2)
• HttpURLConnection is the best choice for
Gingerbread (2.3) and above

!10
HTTP (3rd-party)
Volley:
• Great performance and memory mgmt
• Poor documentation and support
OkHttp
• Improved fork of HttpURLConnection (as of 4.0)
• Great documentation and support

!11
HTTP
• It’s not full duplex
• It’s not meant for device peer-to-peer
communication
• Not ideal for low connectivity scenarios (concerts,
arenas, etc.)

!12
GOOGLE CLOUD MESSAGING

!13
Google Cloud Messaging

!14
Google Cloud Messaging
• Full duplex
• Fire & Forget
• Not always reliable
• No guarantee on time of delivery
• Relatively easy to implement

!15
Google Cloud Messaging
Two implementations:
• GCM HTTP
• Based on HTTP Post requests
• Uses JSON messages
• GCM CCS
• Based on the XMPP chat protocol
• Uses XML messages
!16
Google Cloud Messaging
Android Studio can implement a simple GCM backend for you, using Google AppEngine
• Follow instructions on:
• http://googlecloudplatform.blogspot.com/
2013/06/tutorial-adding-cloud-backend-to-yourapplication-with-android-studio_26.html

!17
WEB SOCKETS
WebSockets
• Full-duplex communication using Port 80
• Web Server <—> Client
• Not just for Web Browsers
• Near Real-Time

!19
WebSockets on Android
• No native Android implementation

!20
Web Sockets (3rd Party)
AutobahnAndroid
• Fully open source
• github.com/tavendo/AutobahnAndroid
• Commercially supported also
Socket.IO client for Android
• Fully open source
• github.com/koush/android-websockets
• Not very well supported
!21
SMS (TEXT MESSAGING)
SMS (Text Messaging)
Pros:
• Asynchronous
• Ideal for low data connectivity
• Only option when there’s no data connectivity
• Mostly free (in the U.S. and Europe)
• Supported by “dumb” phones

!23
SMS (Text Messaging)
Cons:
• Asynchronous
• No guarantee of delivery (including order)
• Limited to 160 characters per message
• Android API’s are “mostly” undocumented
• Except for the new KitKat API
!
!24
SMS (Text Messaging)
When to use them:
• IM apps (duh!)
• Device activation
• Phone number verification
• As a fallback method for other protocol
• As a coordination mechanism

!25
SMS (Text Messaging)
SmsManager
• Sending is really easy
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(“555-123-456“, null, "hello", null, null);

!
!

!26
SMS (Text Messaging)
Receiving SMS
• It’s an undocumented API
• Implement a BroadCast receiver listening for:
• android.provider.Telephony.SMS_RECEIVED
• Bundle contains an array of SmsMessage
• Checkout the new KitKat API:
• youtu.be/mdq0R2WQssQ
!27
NETWORK SERVICE DISCOVERY
Network Service Discovery
• Discover services available on the local network
• Based on Apple’s Bonjour
• Multiplatform support
• Android, iOS, OS X, Linux, Windows, Printers, etc.
• Only available on API Level 16 and above

!29
Network Service Discovery
Alternatives if you’re not on API Level 16 yet:
• Use JmDNS ( jmdns.sourceforge.net)
• Centralized “check-in” Server on fixed IP
• DON’T Try to do multicast/broadcast yourself
• Not very efficient (really slooow!)
• Battery Drain
!
!
!30
Network Service Discovery
Eventbrite engineering blog:
• engineering.eventbrite.com
• Android NDS Post: http://bit.ly/1aYc6RN

!31
HOW WE USE IT AT EVENTBRITE?

!32
How we use this at Eventbrite?
Entry Manager
• Paired with a home grown solution called
“Gatekeeper”

!33
How we use this at Eventbrite?
Eventbrite App
• Social Notifications
Push notification when two of your friends are
attending the same event .
!

!34
We’re hiring!

If you’re interested, let’s talk after the session

eventbrite.com/jobs
Questions?

Download our apps:

eventbrite.com/eventbriteapp
Thank You!
@_juandg
jgomez@eventbrite.com

Mais conteúdo relacionado

Semelhante a Effective Android Messaging

Beating Android Fragmentation
Beating Android FragmentationBeating Android Fragmentation
Beating Android FragmentationJuan Gomez
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Todaydavyjones
 
Automating SDK generation - London Mobile Forum 2.0
Automating SDK generation - London Mobile Forum 2.0Automating SDK generation - London Mobile Forum 2.0
Automating SDK generation - London Mobile Forum 2.0Thong Nguyen
 
Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachITCamp
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp
 
The future of_conver_ai[6933]
The future of_conver_ai[6933]The future of_conver_ai[6933]
The future of_conver_ai[6933]LianaYe2
 
Windows 8 Hot or Not
Windows 8 Hot or NotWindows 8 Hot or Not
Windows 8 Hot or Notpwlodek
 
Real-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloudReal-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloudRadu Vunvulea
 
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails BackendBuilding iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails BackendAndrew Chalkley
 
3 different flavours of building chatbots with Microsoft
3 different flavours of building chatbots with Microsoft3 different flavours of building chatbots with Microsoft
3 different flavours of building chatbots with MicrosoftSammy Deprez
 
Etxt app framework
Etxt app frameworkEtxt app framework
Etxt app frameworkFMNA
 
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...David Geurts
 
Automation Attacks At Scale
Automation Attacks At ScaleAutomation Attacks At Scale
Automation Attacks At ScaleMayank Dhiman
 
Building real time applications with Symfony2
Building real time applications with Symfony2Building real time applications with Symfony2
Building real time applications with Symfony2Antonio Peric-Mazar
 
Basic Multiplayer Online Game with Node.js & dgt-net
Basic Multiplayer Online Game with Node.js & dgt-netBasic Multiplayer Online Game with Node.js & dgt-net
Basic Multiplayer Online Game with Node.js & dgt-netPisit Tangkoblarp
 
Titanium appcelerator kickstart
Titanium appcelerator kickstartTitanium appcelerator kickstart
Titanium appcelerator kickstartAlessio Ricco
 
Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.Priyanka Aash
 
Web to App:作業系統革命 Firefox OS
Web to App:作業系統革命  Firefox OSWeb to App:作業系統革命  Firefox OS
Web to App:作業系統革命 Firefox OSVeck Hsiao
 

Semelhante a Effective Android Messaging (20)

Beating Android Fragmentation
Beating Android FragmentationBeating Android Fragmentation
Beating Android Fragmentation
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
Automating SDK generation - London Mobile Forum 2.0
Automating SDK generation - London Mobile Forum 2.0Automating SDK generation - London Mobile Forum 2.0
Automating SDK generation - London Mobile Forum 2.0
 
Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent Ellerbach
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
 
The future of_conver_ai[6933]
The future of_conver_ai[6933]The future of_conver_ai[6933]
The future of_conver_ai[6933]
 
Windows 8 Hot or Not
Windows 8 Hot or NotWindows 8 Hot or Not
Windows 8 Hot or Not
 
Real-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloudReal-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloud
 
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails BackendBuilding iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
 
3 different flavours of building chatbots with Microsoft
3 different flavours of building chatbots with Microsoft3 different flavours of building chatbots with Microsoft
3 different flavours of building chatbots with Microsoft
 
Etxt app framework
Etxt app frameworkEtxt app framework
Etxt app framework
 
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
 
Automation Attacks At Scale
Automation Attacks At ScaleAutomation Attacks At Scale
Automation Attacks At Scale
 
Building real time applications with Symfony2
Building real time applications with Symfony2Building real time applications with Symfony2
Building real time applications with Symfony2
 
BlueHat v17 || Disrupting the Mirai Botnet
BlueHat v17 || Disrupting the Mirai Botnet BlueHat v17 || Disrupting the Mirai Botnet
BlueHat v17 || Disrupting the Mirai Botnet
 
Basic Multiplayer Online Game with Node.js & dgt-net
Basic Multiplayer Online Game with Node.js & dgt-netBasic Multiplayer Online Game with Node.js & dgt-net
Basic Multiplayer Online Game with Node.js & dgt-net
 
Titanium appcelerator kickstart
Titanium appcelerator kickstartTitanium appcelerator kickstart
Titanium appcelerator kickstart
 
Touch the web
Touch the webTouch the web
Touch the web
 
Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.
 
Web to App:作業系統革命 Firefox OS
Web to App:作業系統革命  Firefox OSWeb to App:作業系統革命  Firefox OS
Web to App:作業系統革命 Firefox OS
 

Último

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiRaviKumarDaparthi
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 

Último (20)

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi Daparthi
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 

Effective Android Messaging