mekwa
    from the web to the iPhone




                                 @bncoelho
wtf is mekwa?
• a social network
• designed to meet new people
• flirting and dating
•   http://www.youtube.com/watch?v=5Fbiu0FUoSk




designed to meet new people
•   http://www.youtube.com/watch?v=PpLOud6OplQ




can be used for flirting and dating
how does it work?
• create a mekwa
• tell it your wishes
• you set off fulfilling other peoples wishes
• you feel good and meet new people
fulfill wishes?
• choose a desire to fulfill (ex: sushi on the
  beach)
• take a bunch of pictures and text
• create an entry
• the owner o...
why the iPhone?
• mobile was an original goal for the mekwa
  project
• it was a good tech showcase
• could play a bit further with locali...
goals on the iphone
• fulfill desires on the go
• check other mekwas around me
what we needed

• to know the current location
• to create an entry(pictures + text)
• search for new wishes
everybody is doing it
 how hard can it be?
really hard...
  at least for us...
our background
• web developers
• no mobile experience
• no objective-c or cocoa experience
• nda just had been lifted, barely no
  docum...
• application was ambitious
• maps, camera, network, website integration
• and... we had a month and a half to do it
how we did it...
mekwa api
• rails is api friendly
• used xml as a hash bag
• geokit made location aware functionality
  easy
what? no xml?
• no easy way to parse an xml document
• we’re used to see objects as bags of
  properties
libxml2 + custom wrapper
• we used libxml2 to parse xml
• built a wrapper to build diccionaries from
  api responses
uploading stuff
• really low level
• ended up building http requests by hand in
  order to add image data to the requests
  body
maps?
• there is no maps api in the sdk
• we thought about abandoning feature
open source
        to the rescue...
• we found route-me project
• support for MS VirtualEarth and
  OpenStreetMap
• caches tiles on sqlite
• supports the draw...
user interface
• table views are very versatile
• gets you up and running very quickly
• however...
...they are a pain to
      customize
•   it’s not just drag’n’drop

•   a designer can’t do it

•   you have to code it

•   we ended up pixel managing

•   to...
and was slow as a snail...
            ...but it was our fault
• cells are redrawn on demand
• images were being downloaded multiple
  times

• scrolling was not smooth
• our answer was...
pre-load cache
• before loading each view we prefetched the
  images needed.

• made loading a bit slower
• but scrolling was smooth
• at...
we had made it...
      ...barely
• at the end of our deadline we could:
 • browse and accept entries
 • search for wishes to fulfill
 • create entries
 • se...
it was an acceptable
     prototype
...but still had its share
     of problems...
• crashed on a semi-regular basis (and that’s
   being gentle...)

• it was still slow...
...next steps
      ... improving for the AppStore
• the prototype was made in a collective
  programming spree

• everything kinda worked but it was a
  glorious mess
• the iphone has no garbage collector
• memory leaks are everywhere, releases
  were missing

• iphone OS is merciless, it...
memory leaks...
• objective-c memory model is based on a
  reference counter

• alloc incs one
• release decs one
• on zero the object is ...
...as long as you know
    who owns object
     ...it was two very frustrating weeks...
app was stable enough...
           ... except when taking pictures
UIImagePickerController
             is a memory hog...
check out the memory spikes
         6mb each
• every time a picture was snapped, the
  memory usage had a 6mb spike

• adding that to the lack of releases, three
  pic...
as data grew...
   prefetching was revealing itself painfully slow...
• technical debt caught us pretty fast
• we were showing 10 entries, each could
  have 4 pictures

• wait for 40 pictures ...
... use an activity indicator
               ...to show you app is not dead
how do you show an activity
  indicator on the iphone?
            hint: it’s not an animated gif...
...background threads
          that’s how you do it...
• it had never occurred to us to use threads
  on the iphone

• sending time consuming tasks to a
  background thread keep...
... we had been stuck
       in a webapp mindset for so long...
...we didn’t realize
       the iphone was a different beast...
• we used background threads to load all
  images as they were needed

• and after some synchronization issues
  resolved
...
and it felt good...
      you can find it in the app store
...lessons learned
        ...almost all of them the hard way
• iphone apps are similar to desktop apps
• but with memory capabilities from 10 years
  ago

• design is hard, not just d...
• UIImagePickerController is a memory hog
• there was no maps api used route-me
• networking is really low level
• xml par...
•   http://www.youtube.com/watch?v=GjyKWiwTRxY
shameless plug

     ...so if you need an
          iphone app


                 don’t hesitate, contact us at www.rupeal...
interesting references
•   www.mekwa.com


•   http://code.google.com/p/route-me/


•   http://blog.airsource.co.uk/index.php/2008/11/12/memory-u...
•   http://www.youtube.com/watch?v=GjyKWiwTRxY


•   http://www.youtube.com/watch?v=5Fbiu0FUoSk


•   http://www.youtube.c...
???
Upcoming SlideShare
Loading in …5
×

Mekwa from the web to the iphone

738 views

Published on

Apresentação feita no barcamppt em Coimbra sobre as dificuldades encontradas na criação de uma aplicação para o iphone.

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

  • Be the first to like this

No Downloads
Views
Total views
738
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mekwa from the web to the iphone

  1. 1. mekwa from the web to the iPhone @bncoelho
  2. 2. wtf is mekwa?
  3. 3. • a social network • designed to meet new people • flirting and dating
  4. 4. • http://www.youtube.com/watch?v=5Fbiu0FUoSk designed to meet new people
  5. 5. • http://www.youtube.com/watch?v=PpLOud6OplQ can be used for flirting and dating
  6. 6. how does it work?
  7. 7. • create a mekwa • tell it your wishes • you set off fulfilling other peoples wishes • you feel good and meet new people
  8. 8. fulfill wishes?
  9. 9. • choose a desire to fulfill (ex: sushi on the beach) • take a bunch of pictures and text • create an entry • the owner of the mekwa decides if the wish was fulfilled
  10. 10. why the iPhone?
  11. 11. • mobile was an original goal for the mekwa project • it was a good tech showcase • could play a bit further with localization • we all had iPhones
  12. 12. goals on the iphone
  13. 13. • fulfill desires on the go • check other mekwas around me
  14. 14. what we needed • to know the current location • to create an entry(pictures + text) • search for new wishes
  15. 15. everybody is doing it how hard can it be?
  16. 16. really hard... at least for us...
  17. 17. our background
  18. 18. • web developers • no mobile experience • no objective-c or cocoa experience • nda just had been lifted, barely no documentation
  19. 19. • application was ambitious • maps, camera, network, website integration • and... we had a month and a half to do it
  20. 20. how we did it...
  21. 21. mekwa api
  22. 22. • rails is api friendly • used xml as a hash bag • geokit made location aware functionality easy
  23. 23. what? no xml?
  24. 24. • no easy way to parse an xml document • we’re used to see objects as bags of properties
  25. 25. libxml2 + custom wrapper
  26. 26. • we used libxml2 to parse xml • built a wrapper to build diccionaries from api responses
  27. 27. uploading stuff
  28. 28. • really low level • ended up building http requests by hand in order to add image data to the requests body
  29. 29. maps?
  30. 30. • there is no maps api in the sdk • we thought about abandoning feature
  31. 31. open source to the rescue...
  32. 32. • we found route-me project • support for MS VirtualEarth and OpenStreetMap • caches tiles on sqlite • supports the drawing of custom markers
  33. 33. user interface
  34. 34. • table views are very versatile • gets you up and running very quickly • however...
  35. 35. ...they are a pain to customize
  36. 36. • it’s not just drag’n’drop • a designer can’t do it • you have to code it • we ended up pixel managing • took a lot of work/time to make them look nice
  37. 37. and was slow as a snail... ...but it was our fault
  38. 38. • cells are redrawn on demand • images were being downloaded multiple times • scrolling was not smooth • our answer was...
  39. 39. pre-load cache
  40. 40. • before loading each view we prefetched the images needed. • made loading a bit slower • but scrolling was smooth • at this point we didn’t have much time • solution was a compromise
  41. 41. we had made it... ...barely
  42. 42. • at the end of our deadline we could: • browse and accept entries • search for wishes to fulfill • create entries • see other mekwas near us
  43. 43. it was an acceptable prototype
  44. 44. ...but still had its share of problems...
  45. 45. • crashed on a semi-regular basis (and that’s being gentle...) • it was still slow...
  46. 46. ...next steps ... improving for the AppStore
  47. 47. • the prototype was made in a collective programming spree • everything kinda worked but it was a glorious mess
  48. 48. • the iphone has no garbage collector • memory leaks are everywhere, releases were missing • iphone OS is merciless, it warns you the first time and then it kicks you out • crash!boom!bang!
  49. 49. memory leaks...
  50. 50. • objective-c memory model is based on a reference counter • alloc incs one • release decs one • on zero the object is deleted • it’s pretty straight forward...
  51. 51. ...as long as you know who owns object ...it was two very frustrating weeks...
  52. 52. app was stable enough... ... except when taking pictures
  53. 53. UIImagePickerController is a memory hog...
  54. 54. check out the memory spikes 6mb each
  55. 55. • every time a picture was snapped, the memory usage had a 6mb spike • adding that to the lack of releases, three pictures and the app was kicked out • so be careful how you use it • our solution involved using a singleton instance of the image picker controller
  56. 56. as data grew... prefetching was revealing itself painfully slow...
  57. 57. • technical debt caught us pretty fast • we were showing 10 entries, each could have 4 pictures • wait for 40 pictures to download • 1 minute until the app is usable • it made you think the app was dead
  58. 58. ... use an activity indicator ...to show you app is not dead
  59. 59. how do you show an activity indicator on the iphone? hint: it’s not an animated gif...
  60. 60. ...background threads that’s how you do it...
  61. 61. • it had never occurred to us to use threads on the iphone • sending time consuming tasks to a background thread keeps the UI responsive • every desktop software developer knows that...
  62. 62. ... we had been stuck in a webapp mindset for so long...
  63. 63. ...we didn’t realize the iphone was a different beast...
  64. 64. • we used background threads to load all images as they were needed • and after some synchronization issues resolved • we had just had turbocharged our app
  65. 65. and it felt good... you can find it in the app store
  66. 66. ...lessons learned ...almost all of them the hard way
  67. 67. • iphone apps are similar to desktop apps • but with memory capabilities from 10 years ago • design is hard, not just drag and drop, you have to code it • threads speed up you app
  68. 68. • UIImagePickerController is a memory hog • there was no maps api used route-me • networking is really low level • xml parsing is really low level
  69. 69. • http://www.youtube.com/watch?v=GjyKWiwTRxY
  70. 70. shameless plug ...so if you need an iphone app don’t hesitate, contact us at www.rupeal.com
  71. 71. interesting references
  72. 72. • www.mekwa.com • http://code.google.com/p/route-me/ • http://blog.airsource.co.uk/index.php/2008/11/12/memory-usage-in- uiimagepickercontroller/ • http://joehewitt.com/post/the-three20-project/ • http://stackoverflow.com/questions/441345/does-uiactivityindicator-require- manual-threading-on-iphone • http://www.hackdiary.com/2009/01/26/switching-from-scripting-languages-to- objective-c-and-iphone-useful-libraries/
  73. 73. • http://www.youtube.com/watch?v=GjyKWiwTRxY • http://www.youtube.com/watch?v=5Fbiu0FUoSk • http://www.youtube.com/watch?v=PpLOud6OplQ
  74. 74. ???

×