SlideShare una empresa de Scribd logo
1 de 22
Combining REST and Context for
Killer iPhone Apps

Iphone Developer Summit
22.June.2009


Jason Hayes Christensen
jasonc411.com
Intro
●   Mobile Applications Entered a New
    Frontier
●   New Platforms like the iPhone are:
    ●   ALWAYS Connected
        –   3G, WiFi, Bluetooth
    ●   ALWAYS On
        –   Very rarely do I shut my phone off
    ●   ALWAYS Around
        –   I almost always have my phone with me, can't say
            the same for my laptop.
Outline
●   Technical Convergence
    ●   REST,Cloud,3G
●   Mobile Apps Tetrahedron
    ●   With Cloud Enhancements
●   Whats in the cloud
●   Get Some “Good REST”
●   Context And the iPhone
●   An iPhone in the Cloud
●   Code Examples throughout
●   Summary
Technical Convergence
●   What happened In the last few Years
    Opened up a new software archetype.
     1. The advent of continuous connectivity
     using 3G and WiFi
     2. The advent of easily invoked and
     consumed RESTful web-services
     3. the ability to leverage off-device
     processing, storage, and security through
     cloud computing.
●   this convergent set of technologies
    becomes a novel, powerful archetype
    for mobile architectures.
Protect User-Info
                         ●   RESTful web-
                             services over SSL
                         ●   No Clear Text
                             Passwords
●   Security is the      ●   OpenID in the
    base of the              Cloud as Best
    Tetrahedron              Practice
●   Security touches     ●   Limit On-Device
    all other aspects.       User Data
●   Variable in a number of ways
    ●   Connected?
    ●   Speed?
●   Program Defensively for the
    Network(especially for REST)
    ●   Check Connectivity & Speed.
    ●   Have a Local Option.
    ●   Make sure to Balance
        –   Request Frequency/Payload
            Size.
●   Cloud Options for
                                     Processing
                                     ●   Custom(your own),
                                         i.e. intelligent mobile
                                         game engine scenario
                                         stack.
                                     ●   Amazon EC2
●   Processing is                    ●   Amazon Elastic
    Constrained                          MapReduce intensive
                                         processes.
●   Perfect for Cloud                ●   Others...
    ●   Off-host analytical or
        intensive tasks
●   Consider:Memory or Storage?
●   Memory is an on-device issue
●   Storage can be augmented
    with cloud
    ●   Database: Amazon SimpleDB,
        Google Database, Apple Mobile
        Me, …
    ●   Content: Amazon S3, Amazon
        Cloudfront, Mobile Me, …
    ●   Synchronization: Amazon SQS,
        Asynchronous Process then
        Push technologies.
Get Some “Good REST”
●   What is “Good REST”?
    ●   balance Request Frequency and Payload
●   Request Frequency
    ●   Make requests infrequently
        –   Extends battery life
        –   Minimizes network exposure
●   Payload
    ●   Large requests are hard to process
        –   Memory is only so large
        –   Processing takes time and battery
Rest Simple to Complex
●   Google Apps for the most part have
    simple REST APIs
    ●   No Authentication or Simple Authentication
    ●   Apple is providing wrappers for exposed
        services such as geocaching.
    ●   Simple REST Services are GREAT look at this
        invocation for Geocoding.
Simpler and Simpler
●   Apple has started wrapping Google APIs
    for geocoding with MKReverseGeocoder.
     - Switching to XCode...
On the Other Side we have
       Amazon Web-Services
●   Has a complex authentication scheme.
●   Request dependent
●   Involves hashing(HMAC-SHA1) and
    encoding headers, then adding
    additional headers to the request.
Creating the Authorization
               Token
 ●   Sign up for S3, you will get a public and
     private key.
 ●   Create a string from the following
     headers, then create and encode hash:
StringToSign = HTTP-VERB + "n" +

Content-MD5 + "n" +

Content-Type + "n" +

Expires + "n" +

CanonicalizedAmzHeaders +

CanonicalizedResource; // /bucket/resource
Processing the Response
●   REST is nice because each response is
    discrete(unlike streaming socket as in
    XMPP)
●   NSXMLParser is lightweight
    ●   Can initialize with the data from a request,
        or with the request directly.(note S3ListBucketsResponse
        extends NSXMLParser)
Managing State
●   didStartElement
    ●   Set fags if you want to gather data
    ●   Grab any attributes from the
        attributeDictionary
●   didEndElement
    ●   Reset fags as necessary
●   foundCharacters
    ●   Grab any enclosed text as necessary
Example from Geocoding
Context and the iPhone
●   Iphone has three sensors that can be
    used for context:
    ●   GPS/Core Location
    ●   Accelerometer
    ●   Proximity Sensor
●   A Context-Aware Application will use
    those sensors to minimize user input.
●   Additional context can be ascertained
    from your present activity.
●   Upcoming, audio and visual contexts are
    coming. Think augmented spatial reality.
The future of Contexts

●   We looked at this earlier in the simple
    example of MKReverseGeocode.
●   Location is low hanging fruit, that is
    why there is SO much focus on LBS.
    ●   LBS is a context aware application
●   Future contexts include activity
    analysis using bluetooth, camera, …
What We Looked At
●   Amazon S3 using rest based web-services
    to store fles(menus, photos.)
●   Location information from the iPhone.
●   REST for geocoded context(GPS<-
    >Street Address)
●   No expensive servers because of cloud
    computing.
●   This archetype can be solved for
    numerous apps.
Questions?
THANKS FOR ATTENDING
  Source code available at
       http://jasonc411.com

Más contenido relacionado

Similar a Combining ReST and Context for Killer iPhone Apps

NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1Ruslan Meshenberg
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2aspyker
 
What is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokWhat is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokImre Nagi
 
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned AWS Big Data Demystified #1.2 | Big Data architecture lessons learned
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned Omid Vahdaty
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | EnglishOmid Vahdaty
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native PlatformSunil Govindan
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native PlatformSunil Govindan
 
AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned Omid Vahdaty
 
Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3  Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3 Omid Vahdaty
 
Public Cloud Workshop
Public Cloud WorkshopPublic Cloud Workshop
Public Cloud WorkshopAmer Ather
 
Aws meetup 2017-02-09-role-auto-scaling
Aws meetup 2017-02-09-role-auto-scalingAws meetup 2017-02-09-role-auto-scaling
Aws meetup 2017-02-09-role-auto-scalingYeung Siu
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthNicolas Brousse
 
Building a data pipeline to ingest data into Hadoop in minutes using Streamse...
Building a data pipeline to ingest data into Hadoop in minutes using Streamse...Building a data pipeline to ingest data into Hadoop in minutes using Streamse...
Building a data pipeline to ingest data into Hadoop in minutes using Streamse...Guglielmo Iozzia
 
Summer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpointSummer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpointChristopher Dubois
 
Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...Droidcon Eastern Europe
 
Deep Learning at the Edge
Deep Learning at the EdgeDeep Learning at the Edge
Deep Learning at the EdgeJulien SIMON
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Ruslan Meshenberg
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!pflueras
 
Iot vupico-damien-contreras-2018-05-17-light-v3
Iot vupico-damien-contreras-2018-05-17-light-v3Iot vupico-damien-contreras-2018-05-17-light-v3
Iot vupico-damien-contreras-2018-05-17-light-v3Damien Contreras
 

Similar a Combining ReST and Context for Killer iPhone Apps (20)

NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
What is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 DepokWhat is Google Cloud Platform - GDG DevFest 18 Depok
What is Google Cloud Platform - GDG DevFest 18 Depok
 
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned AWS Big Data Demystified #1.2 | Big Data architecture lessons learned
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned
 
Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3  Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3
 
Public Cloud Workshop
Public Cloud WorkshopPublic Cloud Workshop
Public Cloud Workshop
 
Aws meetup 2017-02-09-role-auto-scaling
Aws meetup 2017-02-09-role-auto-scalingAws meetup 2017-02-09-role-auto-scaling
Aws meetup 2017-02-09-role-auto-scaling
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
 
GCP overview
GCP overviewGCP overview
GCP overview
 
Building a data pipeline to ingest data into Hadoop in minutes using Streamse...
Building a data pipeline to ingest data into Hadoop in minutes using Streamse...Building a data pipeline to ingest data into Hadoop in minutes using Streamse...
Building a data pipeline to ingest data into Hadoop in minutes using Streamse...
 
Summer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpointSummer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpoint
 
Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...
 
Deep Learning at the Edge
Deep Learning at the EdgeDeep Learning at the Edge
Deep Learning at the Edge
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
 
Iot vupico-damien-contreras-2018-05-17-light-v3
Iot vupico-damien-contreras-2018-05-17-light-v3Iot vupico-damien-contreras-2018-05-17-light-v3
Iot vupico-damien-contreras-2018-05-17-light-v3
 

Último

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 2024The Digital Insurer
 
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 2024Rafal Los
 
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...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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 MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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 Servicegiselly40
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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 MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 2024The Digital Insurer
 
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...Martijn de Jong
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Último (20)

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
 
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
 
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...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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 Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines 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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Combining ReST and Context for Killer iPhone Apps

  • 1. Combining REST and Context for Killer iPhone Apps Iphone Developer Summit 22.June.2009 Jason Hayes Christensen jasonc411.com
  • 2. Intro ● Mobile Applications Entered a New Frontier ● New Platforms like the iPhone are: ● ALWAYS Connected – 3G, WiFi, Bluetooth ● ALWAYS On – Very rarely do I shut my phone off ● ALWAYS Around – I almost always have my phone with me, can't say the same for my laptop.
  • 3. Outline ● Technical Convergence ● REST,Cloud,3G ● Mobile Apps Tetrahedron ● With Cloud Enhancements ● Whats in the cloud ● Get Some “Good REST” ● Context And the iPhone ● An iPhone in the Cloud ● Code Examples throughout ● Summary
  • 4. Technical Convergence ● What happened In the last few Years Opened up a new software archetype. 1. The advent of continuous connectivity using 3G and WiFi 2. The advent of easily invoked and consumed RESTful web-services 3. the ability to leverage off-device processing, storage, and security through cloud computing. ● this convergent set of technologies becomes a novel, powerful archetype for mobile architectures.
  • 5.
  • 6. Protect User-Info ● RESTful web- services over SSL ● No Clear Text Passwords ● Security is the ● OpenID in the base of the Cloud as Best Tetrahedron Practice ● Security touches ● Limit On-Device all other aspects. User Data
  • 7. Variable in a number of ways ● Connected? ● Speed? ● Program Defensively for the Network(especially for REST) ● Check Connectivity & Speed. ● Have a Local Option. ● Make sure to Balance – Request Frequency/Payload Size.
  • 8. Cloud Options for Processing ● Custom(your own), i.e. intelligent mobile game engine scenario stack. ● Amazon EC2 ● Processing is ● Amazon Elastic Constrained MapReduce intensive processes. ● Perfect for Cloud ● Others... ● Off-host analytical or intensive tasks
  • 9. Consider:Memory or Storage? ● Memory is an on-device issue ● Storage can be augmented with cloud ● Database: Amazon SimpleDB, Google Database, Apple Mobile Me, … ● Content: Amazon S3, Amazon Cloudfront, Mobile Me, … ● Synchronization: Amazon SQS, Asynchronous Process then Push technologies.
  • 10.
  • 11. Get Some “Good REST” ● What is “Good REST”? ● balance Request Frequency and Payload ● Request Frequency ● Make requests infrequently – Extends battery life – Minimizes network exposure ● Payload ● Large requests are hard to process – Memory is only so large – Processing takes time and battery
  • 12. Rest Simple to Complex ● Google Apps for the most part have simple REST APIs ● No Authentication or Simple Authentication ● Apple is providing wrappers for exposed services such as geocaching. ● Simple REST Services are GREAT look at this invocation for Geocoding.
  • 13. Simpler and Simpler ● Apple has started wrapping Google APIs for geocoding with MKReverseGeocoder. - Switching to XCode...
  • 14. On the Other Side we have Amazon Web-Services ● Has a complex authentication scheme. ● Request dependent ● Involves hashing(HMAC-SHA1) and encoding headers, then adding additional headers to the request.
  • 15. Creating the Authorization Token ● Sign up for S3, you will get a public and private key. ● Create a string from the following headers, then create and encode hash: StringToSign = HTTP-VERB + "n" + Content-MD5 + "n" + Content-Type + "n" + Expires + "n" + CanonicalizedAmzHeaders + CanonicalizedResource; // /bucket/resource
  • 16. Processing the Response ● REST is nice because each response is discrete(unlike streaming socket as in XMPP) ● NSXMLParser is lightweight ● Can initialize with the data from a request, or with the request directly.(note S3ListBucketsResponse extends NSXMLParser)
  • 17. Managing State ● didStartElement ● Set fags if you want to gather data ● Grab any attributes from the attributeDictionary ● didEndElement ● Reset fags as necessary ● foundCharacters ● Grab any enclosed text as necessary
  • 19. Context and the iPhone ● Iphone has three sensors that can be used for context: ● GPS/Core Location ● Accelerometer ● Proximity Sensor ● A Context-Aware Application will use those sensors to minimize user input. ● Additional context can be ascertained from your present activity. ● Upcoming, audio and visual contexts are coming. Think augmented spatial reality.
  • 20. The future of Contexts ● We looked at this earlier in the simple example of MKReverseGeocode. ● Location is low hanging fruit, that is why there is SO much focus on LBS. ● LBS is a context aware application ● Future contexts include activity analysis using bluetooth, camera, …
  • 21. What We Looked At ● Amazon S3 using rest based web-services to store fles(menus, photos.) ● Location information from the iPhone. ● REST for geocoded context(GPS<- >Street Address) ● No expensive servers because of cloud computing. ● This archetype can be solved for numerous apps.
  • 22. Questions? THANKS FOR ATTENDING Source code available at http://jasonc411.com