SlideShare a Scribd company logo
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

More Related Content

Similar to 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 1
Ruslan 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 2
aspyker
 
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
Imre 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 | English
Omid Vahdaty
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
Sunil Govindan
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
Sunil 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 Workshop
Amer 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-scaling
Yeung 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 Month
Nicolas Brousse
 
GCP overview
GCP overviewGCP overview
GCP overview
Chandan Kumar Rana
 
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 powerpoint
Christopher 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 Edge
Julien 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-v3
Damien Contreras
 

Similar to 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
 

Recently uploaded

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

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