SlideShare a Scribd company logo
1 of 49
Android Lessons You
Won’t Learn in School
   Michael Galpin, Bump Technologies
About Me
•   Apps

    •   Bump, eBay Mobile

•   Android in Practice

•   Social

    •   @michaelg

    •   +Michael Galpin
Agenda
•   Architecture, now and
    then

•   Security

•   Misc

    •   Logging

    •   Hybrids

    •   SDKs

    •   Testing
Architecture?
You have it
    ... even if you’ve never
         thought about it


 So maybe you should think
         about it.
The
Cloud
The
Cloud
The
         Cloud




•Transport
The
         Cloud




•Transport
•Format
HTTP

• Apache HTTP Client
 • DefaultHttpClient
 • AndroidHttpClient
• HttpURLConnection
 • java.net.URL
HTTP

• Apache HTTP Client
 • DefaultHttpClient
 • AndroidHttpClient
• HttpURLConnection
 • java.net.URL
HTTP

• Apache HTTP Client
 • DefaultHttpClient
 • AndroidHttpClient
• HttpURLConnection
 • java.net.URL
Format




XML            JSON
XML

• SAX
 • android.sax
• DOM
• XmlPullParser
JS
  O
   N
      !
Don’t forget to zip
New World Architecture
Sockets

• TCP
 • WebSockets
• UDP
No blocking allowed

• Netty, Mina (Java)
• Twisted, Diesel (Python)
• EventMachine (Ruby)
• Node.js (JavaScript)
• Nitrogen (Erlang)
Harder, Better, Faster, Stronger
Optimized Formats

• Protocol Buffers
• Thrift
• MessagePack
• Fast Infoset
• BSON
The Web Model

• Login page (HTTPS)
• HTTP Cookie
 • Expiry
Mobile Logins
Logging In

• Full Native
 • Requires “Login API”



                          User Experience
• Embedded Web Browser




                                            Security
 • “OAuth”
• External Web Browser
Tokens

• Obtained from API or OAuth flow
 • Equivalent to username + password
• Storage
• Expiry
Defending Your Servers

• Need per-user throttles
 • Can’t count on IP addresses
• Expect many legit login failures
• Anything your client can do, evil clients can
  do too
Logging
What to log

• User Actions
 • Key to A/B Testing
• Crashes & Exceptions
Logging User Actions

• Log a lot ... but don’t saturate your
  network connection
• Batch logs together
 • But don’t block UI thread
• Send when the user’s not busy
Crash Logs

• Create your own         UncaughtExceptionHandler

 •   Thread.setDefaultUncaughtExceptionHandler


 • Log crash on...
  • next app launch
  • from background Service
Even More Crash Logs


Process process =
    Runtime.getRuntime().exec(String.format("logcat -t %d", 100));
InputStream stream = process.getInputStream();




<uses-permission android:name="android.permission.READ_LOGS" />
Android Hybrids
       App



                              Web Page

                         Interface


Easy to expose “native” features to JS
Calling JS from native code, more hacky
WebView webView = (WebView) findViewById(R.id.web_view);

WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setDatabasePath("/data/data/my.package/folder");

webView.setWebChromeClient(new WebChromeClient(){

      @Override
      public boolean onConsoleMessage(ConsoleMessage msg){
          // pipe this to LogCat
      }
});

webView.addJavascriptInterface(new MyInterface(), "zorro");

webView.loadUrl("javascript:tarzan.start()");
Why hybrid
• Specialized scenarios (OAuth)
• Server driven UI
 • Testing, experimentation
• Leverage web development skills
• Cross platforms?
 • UX <===> $$$
Mobile SDK




If you build it, they will come?
Public Web Services
         (APIs)
• Derive value from 3rd party access
• Legacy services
 • Designed for servers and PCs
• Lower barrier of use
 • Enforce usage patterns / security
An SDK should...
• Provide local APIs to:
 • Handle network communication
 • Handle serialization of requests
 • Handle deserialization of responses
 • Deal with security
 • Provide useful errors
The Java™ Way
• Generate code (bindings) for requests,
  responses, error objects
• Provide runtime library for serialization/
  deserialization
• Lots of code and lots of methods!
 • Larger APKs
 • 65536 methods allowed / dex file
Testing
FAQs

• Which devices?
• How many devices?
• How do you get access to devices?
I tested the app on my phone




             ...while eating a pound of bacon.
Numbers Game




*Maybe consider: Carriers (CDMA/GSM)
How to get devices

• Buy!
 • Don’t forget international
• Device labs
• “Mechanical turk” services
Questions?

More Related Content

What's hot

Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
Akshay Mathur
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 

What's hot (19)

JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With Jest
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and me
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
 
Android testing-with-selenium-webdriver Online Training
Android testing-with-selenium-webdriver Online TrainingAndroid testing-with-selenium-webdriver Online Training
Android testing-with-selenium-webdriver Online Training
 
Drupal, Android and iPhone
Drupal, Android and iPhoneDrupal, Android and iPhone
Drupal, Android and iPhone
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapi
 
Creating RESTful API’s with Grails and Spring Security
Creating RESTful API’s with Grails and Spring SecurityCreating RESTful API’s with Grails and Spring Security
Creating RESTful API’s with Grails and Spring Security
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
 
An Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionAn Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI Composition
 
The Art of Angular in 2016 - Devoxx France 2016
The Art of Angular in 2016 - Devoxx France 2016The Art of Angular in 2016 - Devoxx France 2016
The Art of Angular in 2016 - Devoxx France 2016
 
Jumpstart: Introduction to Atlas, Highlighting Enterprise Features
Jumpstart: Introduction to Atlas, Highlighting Enterprise FeaturesJumpstart: Introduction to Atlas, Highlighting Enterprise Features
Jumpstart: Introduction to Atlas, Highlighting Enterprise Features
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
 
Build A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON API
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
Selenium bootcamp slides
Selenium bootcamp slides   Selenium bootcamp slides
Selenium bootcamp slides
 
Dzhengis 93098 ajax - security
Dzhengis 93098   ajax - securityDzhengis 93098   ajax - security
Dzhengis 93098 ajax - security
 
Web a Quebec - JS Debugging
Web a Quebec - JS DebuggingWeb a Quebec - JS Debugging
Web a Quebec - JS Debugging
 

Viewers also liked

Optical fiber communication presentation
Optical fiber communication presentationOptical fiber communication presentation
Optical fiber communication presentation
palme mawagali
 
Seminar report of optical ethernet
Seminar report of optical ethernetSeminar report of optical ethernet
Seminar report of optical ethernet
Mohammad Waziruddin
 
Gi fi seminar Report
Gi fi seminar ReportGi fi seminar Report
Gi fi seminar Report
Shivam Joshi
 
Generazione 1000 €
Generazione 1000 €Generazione 1000 €
Generazione 1000 €
Suni Martï
 
Injoos corporate presentation webinar oct 2009 ver1
Injoos corporate presentation webinar   oct 2009 ver1Injoos corporate presentation webinar   oct 2009 ver1
Injoos corporate presentation webinar oct 2009 ver1
Injoos
 
Humour Et Insolites
Humour Et InsolitesHumour Et Insolites
Humour Et Insolites
guestfa3180
 
PROJEKT KOSMOS
PROJEKT  KOSMOSPROJEKT  KOSMOS
PROJEKT KOSMOS
wega
 
Political Cartooningtoputonblog
Political CartooningtoputonblogPolitical Cartooningtoputonblog
Political Cartooningtoputonblog
ab08028
 
Communities of Learning in Organizational Training: The influence of particip...
Communities of Learning in Organizational Training: The influence of particip...Communities of Learning in Organizational Training: The influence of particip...
Communities of Learning in Organizational Training: The influence of particip...
Martin Rehm
 

Viewers also liked (20)

10 gigabit ethernet technology
10 gigabit ethernet technology10 gigabit ethernet technology
10 gigabit ethernet technology
 
Optical fiber communication presentation
Optical fiber communication presentationOptical fiber communication presentation
Optical fiber communication presentation
 
Seminar report of optical ethernet
Seminar report of optical ethernetSeminar report of optical ethernet
Seminar report of optical ethernet
 
BUMP
BUMPBUMP
BUMP
 
Ethernet technology
Ethernet technologyEthernet technology
Ethernet technology
 
Ethernet
EthernetEthernet
Ethernet
 
Gi fi seminar Report
Gi fi seminar ReportGi fi seminar Report
Gi fi seminar Report
 
3D PRINTER Seminar fair report (pdf)
3D PRINTER Seminar fair report (pdf)3D PRINTER Seminar fair report (pdf)
3D PRINTER Seminar fair report (pdf)
 
Zehirleme
ZehirlemeZehirleme
Zehirleme
 
Generazione 1000 €
Generazione 1000 €Generazione 1000 €
Generazione 1000 €
 
Injoos corporate presentation webinar oct 2009 ver1
Injoos corporate presentation webinar   oct 2009 ver1Injoos corporate presentation webinar   oct 2009 ver1
Injoos corporate presentation webinar oct 2009 ver1
 
PresentacióN
PresentacióNPresentacióN
PresentacióN
 
Humour Et Insolites
Humour Et InsolitesHumour Et Insolites
Humour Et Insolites
 
JISC Greening ICT Keynote Presentation
JISC Greening ICT Keynote PresentationJISC Greening ICT Keynote Presentation
JISC Greening ICT Keynote Presentation
 
PROJEKT KOSMOS
PROJEKT  KOSMOSPROJEKT  KOSMOS
PROJEKT KOSMOS
 
Kkka Korunma
Kkka KorunmaKkka Korunma
Kkka Korunma
 
Political Cartooningtoputonblog
Political CartooningtoputonblogPolitical Cartooningtoputonblog
Political Cartooningtoputonblog
 
The Future of Big Data in Education
The Future of Big Data in EducationThe Future of Big Data in Education
The Future of Big Data in Education
 
Sunrise Question
Sunrise QuestionSunrise Question
Sunrise Question
 
Communities of Learning in Organizational Training: The influence of particip...
Communities of Learning in Organizational Training: The influence of particip...Communities of Learning in Organizational Training: The influence of particip...
Communities of Learning in Organizational Training: The influence of particip...
 

Similar to Android lessons you won't learn in school

Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
Volkan Özçelik
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOS
Kevin Decker
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
Ganesh Kondal
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
Avi Kedar
 

Similar to Android lessons you won't learn in school (20)

20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOS
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
 
Hacking mobile apps
Hacking mobile appsHacking mobile apps
Hacking mobile apps
 
Do you lose sleep at night?
Do you lose sleep at night?Do you lose sleep at night?
Do you lose sleep at night?
 
Rhodes
RhodesRhodes
Rhodes
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Tech IT Easy x DevTalk : "Secure Your Coding with OWASP"
Tech IT Easy x DevTalk : "Secure Your Coding with OWASP"Tech IT Easy x DevTalk : "Secure Your Coding with OWASP"
Tech IT Easy x DevTalk : "Secure Your Coding with OWASP"
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料
 
Design for scale
Design for scaleDesign for scale
Design for scale
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5Mobile Web Development with HTML5
Mobile Web Development with HTML5
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
APIs, now and in the future
APIs, now and in the futureAPIs, now and in the future
APIs, now and in the future
 

More from Michael Galpin

More from Michael Galpin (12)

Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Scala on Android: Experiences at Bump Technologies
Scala on Android: Experiences at Bump TechnologiesScala on Android: Experiences at Bump Technologies
Scala on Android: Experiences at Bump Technologies
 
That’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your BatteryThat’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your Battery
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
 
Persistent Data Structures And Managed References
Persistent Data Structures And Managed ReferencesPersistent Data Structures And Managed References
Persistent Data Structures And Managed References
 
Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
 
Mobile Development 101
Mobile Development 101Mobile Development 101
Mobile Development 101
 
RIAs Done Right: Grails, Flex, and EXT GWT
RIAs Done Right: Grails, Flex, and EXT GWTRIAs Done Right: Grails, Flex, and EXT GWT
RIAs Done Right: Grails, Flex, and EXT GWT
 
Eclipse @eBay 2009
Eclipse @eBay 2009Eclipse @eBay 2009
Eclipse @eBay 2009
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java Developers
 
Eclipse@eBay
Eclipse@eBayEclipse@eBay
Eclipse@eBay
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Android lessons you won't learn in school

  • 1. Android Lessons You Won’t Learn in School Michael Galpin, Bump Technologies
  • 2. About Me • Apps • Bump, eBay Mobile • Android in Practice • Social • @michaelg • +Michael Galpin
  • 3. Agenda • Architecture, now and then • Security • Misc • Logging • Hybrids • SDKs • Testing
  • 4. Architecture? You have it ... even if you’ve never thought about it So maybe you should think about it.
  • 5.
  • 8. The Cloud •Transport
  • 9. The Cloud •Transport •Format
  • 10. HTTP • Apache HTTP Client • DefaultHttpClient • AndroidHttpClient • HttpURLConnection • java.net.URL
  • 11. HTTP • Apache HTTP Client • DefaultHttpClient • AndroidHttpClient • HttpURLConnection • java.net.URL
  • 12. HTTP • Apache HTTP Client • DefaultHttpClient • AndroidHttpClient • HttpURLConnection • java.net.URL
  • 13. Format XML JSON
  • 14. XML • SAX • android.sax • DOM • XmlPullParser
  • 15. JS O N !
  • 18.
  • 19. Sockets • TCP • WebSockets • UDP
  • 20. No blocking allowed • Netty, Mina (Java) • Twisted, Diesel (Python) • EventMachine (Ruby) • Node.js (JavaScript) • Nitrogen (Erlang)
  • 22. Optimized Formats • Protocol Buffers • Thrift • MessagePack • Fast Infoset • BSON
  • 23.
  • 24. The Web Model • Login page (HTTPS) • HTTP Cookie • Expiry
  • 26. Logging In • Full Native • Requires “Login API” User Experience • Embedded Web Browser Security • “OAuth” • External Web Browser
  • 27. Tokens • Obtained from API or OAuth flow • Equivalent to username + password • Storage • Expiry
  • 28. Defending Your Servers • Need per-user throttles • Can’t count on IP addresses • Expect many legit login failures • Anything your client can do, evil clients can do too
  • 30. What to log • User Actions • Key to A/B Testing • Crashes & Exceptions
  • 31. Logging User Actions • Log a lot ... but don’t saturate your network connection • Batch logs together • But don’t block UI thread • Send when the user’s not busy
  • 32. Crash Logs • Create your own UncaughtExceptionHandler • Thread.setDefaultUncaughtExceptionHandler • Log crash on... • next app launch • from background Service
  • 33. Even More Crash Logs Process process = Runtime.getRuntime().exec(String.format("logcat -t %d", 100)); InputStream stream = process.getInputStream(); <uses-permission android:name="android.permission.READ_LOGS" />
  • 34.
  • 35.
  • 36. Android Hybrids App Web Page Interface Easy to expose “native” features to JS Calling JS from native code, more hacky
  • 37. WebView webView = (WebView) findViewById(R.id.web_view); WebSettings settings = webView.getSettings(); settings.setJavaScriptEnabled(true); settings.setDomStorageEnabled(true); settings.setDatabasePath("/data/data/my.package/folder"); webView.setWebChromeClient(new WebChromeClient(){ @Override public boolean onConsoleMessage(ConsoleMessage msg){ // pipe this to LogCat } }); webView.addJavascriptInterface(new MyInterface(), "zorro"); webView.loadUrl("javascript:tarzan.start()");
  • 38.
  • 39. Why hybrid • Specialized scenarios (OAuth) • Server driven UI • Testing, experimentation • Leverage web development skills • Cross platforms? • UX <===> $$$
  • 40. Mobile SDK If you build it, they will come?
  • 41. Public Web Services (APIs) • Derive value from 3rd party access • Legacy services • Designed for servers and PCs • Lower barrier of use • Enforce usage patterns / security
  • 42. An SDK should... • Provide local APIs to: • Handle network communication • Handle serialization of requests • Handle deserialization of responses • Deal with security • Provide useful errors
  • 43. The Java™ Way • Generate code (bindings) for requests, responses, error objects • Provide runtime library for serialization/ deserialization • Lots of code and lots of methods! • Larger APKs • 65536 methods allowed / dex file
  • 45. FAQs • Which devices? • How many devices? • How do you get access to devices?
  • 46. I tested the app on my phone ...while eating a pound of bacon.
  • 47. Numbers Game *Maybe consider: Carriers (CDMA/GSM)
  • 48. How to get devices • Buy! • Don’t forget international • Device labs • “Mechanical turk” services

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. MG\n
  45. \n
  46. \n
  47. \n