Hdc09 I Phone Dev Connecting To Web

979 views

Published on

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
979
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
17
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Hdc09 I Phone Dev Connecting To Web

  1. 1. iPhone Development Connecting to the cloud
  2. 2. Ninth Division real legit growing apple platforms development company in omaha, ne www.ninthdivision.com @ninthdivision Andy Peters @andypeters
  3. 3. Midwest Mobile Developers connecting all the mobile developers in the region (Nebraska, Iowa, Kansas, Missouri) http://groups.google.com/group/midwest-mobile-developers
  4. 4. Getting started with iPhone Development
  5. 5. Getting started with iPhone Development
  6. 6. flickr: kmulcahy
  7. 7. flickr: kmulcahy
  8. 8. iPhone The Cloud
  9. 9. Why? flickr: Waldo#4
  10. 10. 30 Million iPhone’s Sold as of Sept. 2009
  11. 11. 20 Million iPod Touches Sold as of Sept. 2009
  12. 12. User experience.
  13. 13. Offline usage.
  14. 14. Unreliable Connectivity.
  15. 15. Social networks.
  16. 16. More devices...
  17. 17. More devices...
  18. 18. More devices...
  19. 19. More devices...
  20. 20. iPhone users use the hell out of social apps
  21. 21. 15,604,157 Monthly Active Users Facebook for the iPhone
  22. 22. Tweetie 2 for the iPhone
  23. 23. Be unique. flickr: Erica Marshall
  24. 24. Game’s submitting scores to community.
  25. 25. Post high score to twitter.
  26. 26. Announce new user profile on Facebook.
  27. 27. Music related app uses Last.fm for data.
  28. 28. Grab data to populate a map.
  29. 29. Some devices are tied directly to the cloud.
  30. 30. MORE and MORE!
  31. 31. Connection Methods. flickr: barjack
  32. 32. Web Services ~= The Cloud
  33. 33. XML RESTful please!
  34. 34. XML There is no SOAP Client #642 or XML-RPC Client #1,203. You parse it yourself.
  35. 35. Options for Parsing XML • libxml2 • Tree-based: easy to parse, tree in memory • Event-driven: less memory, more complex managing state • Text reader: fast, easy to write • NSXMLParser • Event-driven: simpler but less powerful than libXML • No NSXMLDocument on iPhone • expat too!!!
  36. 36. XML Code NSXMLParser *parser = [[NSXMLParser alloc]initWithData:....];
  37. 37. XML Code NSXMLParser *parser = [[NSXMLParser alloc]initWithData:....];
  38. 38. XML [delegate] Code
  39. 39. XML [delegate] Code
  40. 40. XML Docs. • “Event Driven XML Programming in Cocoa” - ADC • NSXMLParser.h / Supporting doc. • NSXMLParserDelegate.h / Supporting doc. • Sample code: XMLPerformance and SeismicXML • Google: cocoa + nsxmlparser
  41. 41. JSON JavaScript Object Notation
  42. 42. JavaScript Object Notation • More lightweight than XML • Similar to a Property List • arrays, dictionaries, strings, numbers • Open Source json-framework wrapper for Objective-C • no “official” Apple library (yet)
  43. 43. JavaScript Object Notation • If I have a choice, I prefer using JSON • Lightweight • Fast • Easy to parse and map to objects.
  44. 44. JSON Looks like { “name” : “Hearful Andrena”, “pets” : 23, “poop-scooping-service” : false, “pet-names” : [“Hanna”, “Nemo”} }
  45. 45. Parsing JSON #import <JSON/JSON.h> // Get a JSON string NSString *jsonString = ....; // Parsing will result in Foundation objects id object = [jsonString JSONValue];
  46. 46. Using JSON-framework // Create data. NSDictionary *dictionary = ...; // converts into a JSON spring. jsonString = [dictionary JSONRepresentation];
  47. 47. UIWebView
  48. 48. Best Practices
  49. 49. Asynchronous Never parse on the main thread.
  50. 50. NSOperation
  51. 51. Never assume you know the size of the server response.
  52. 52. Delegates methods
  53. 53. Show progress.
  54. 54. Debugging.
  55. 55. Caching
  56. 56. Libraries, Frameworks and Wrappers flickr: (Erik)
  57. 57. MGTwitterEngine
  58. 58. ObjectiveFlickr
  59. 59. Facebook Connect
  60. 60. iPhone on Rails
  61. 61. ASIHTTPRequest
  62. 62. Development Demos flickr: TheNixer
  63. 63. Development Demos flickr: TheNixer
  64. 64. Questions ? flickr: Jim in Times Square
  65. 65. ninth Division real legit growing apple platforms development company in omaha, ne www.ninthdivision.com @ninthdivision

×