Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ruby and iOS: An inside look

1,664 views

Published on

Published in: Technology
  • Be the first to comment

Ruby and iOS: An inside look

  1. 1. Linkedin: October 18, 20122012 Fukuoka Ruby Night:The New World of Ruby Ruby and iOS: An Inside Look Jeanine Swatton
  2. 2. More about me… Ruby/iOS Developer, QT, C, C++ Senior Lecturer, Assistant Professor Engineering experience: Government, Surveillance and Video Conferencing Organizer, Silicon Valley Ruby on Rails Meetup Software Product Manager10/18/2012 Jeanine Swatton 2
  3. 3. Agenda for today 1. Why go mobile? 2. Benefits of Native Mobile App 3. mRuby + iOS 4. RubyMotion10/18/2012 Jeanine Swatton 3
  4. 4. Mobile Trends10/18/2012 Jeanine Swatton 4
  5. 5. Why go mobile?10/18/2012 Jeanine Swatton 5
  6. 6. Mobile Trends10/18/2012 Jeanine Swatton 6
  7. 7. Mobile Trends Multiple Platforms for Native apps • Languages - Objective C, C, C++, .NET, Java, Adobe Flash • Apple - XCode 4.2, iOS SDK 5.0 • Windows - Windows Mobile 6.5 Developer Toolkit w Mobile 6 SDK • Blackberry - Tablet/Native SDK, Runtime for Android Apps10/18/2012 Jeanine Swatton 7
  8. 8. Web app or Native app?10/18/2012 Jeanine Swatton 8
  9. 9. What about Hybrid?10/18/2012 Jeanine Swatton 9
  10. 10. Definitions • Native: • App designed to run on a device’s OS and machine firmware. (Example iPhone Apps run on iOS platform, Symbian for Nokia. • Web app: • All or some parts of software are downloaded from web. Coded in browser-rendered language – HTML, javascript10/18/2012 Jeanine Swatton 10
  11. 11. Definitions • Hybrid: Combination of offline and online functionality within native app 3 forms: 1. Requires you to be online to get data or information 2. Has native interface then pulls data via API’s into app and may sync with database. Ex. Rhapsody – Gives you offline screen you can access saved content – online – you have full access to music you can stream. 3. Uses mobile site to display info within an application shell. Done using tools such as PhoneGap. Tools provide interface using jafascript to native API’s – then allows a webview to interact with native functionality such as cameras, GPS and device info10/18/2012 Jeanine Swatton 11
  12. 12. Mobile Trends App development comparison10/18/2012 Jeanine Swatton 12
  13. 13. Mobile Trends10/18/2012 Jeanine Swatton 13
  14. 14. Mobile Trends Solution? Web Apps w/ use of core web technologies: CSS3, HTML510/18/2012 Jeanine Swatton 14
  15. 15. Mobile Trends When would you need a native app over a Mobile-Web based app?10/18/2012 Jeanine Swatton 15
  16. 16. Native Apps Native app advantages: Better control over the User Interface Platform API (application programming interface) access not available to web apps Network usage is lower for native – access network for data rather than web app completely loading at run-time Offline functionality Users more willing to download app than downloading from the internet Native app disadvantages: More maintenance with multiple platforms Have to update app then submit it10/18/2012 Jeanine Swatton 16
  17. 17. Which App? Which type of companies would be a better fit for native, Web or both?10/18/2012 Jeanine Swatton 17
  18. 18. Which App? Native approach more used by: Gaming, social networking, lifestyle & entertainment, gadgets, travel and local Web based approach: News and weather publishers. Sometimes financial services, retail and shopping due to need for user analytics10/18/2012 Jeanine Swatton 18
  19. 19. What strategy do companies also use? Tech Startups/Companies new to the mobile side (depending on funds)10/18/2012 Jeanine Swatton 19
  20. 20. Why Ruby on Mobile? • Simple transition from Web applications to mobile applications • Grow the Ruby community even more! • Support of mRuby • Think outside of the box!10/18/2012 Jeanine Swatton 20
  21. 21. Intro to iOS Development In 5 minutes10/18/2012 Jeanine Swatton 21
  22. 22. iOS Development What you need to know • Objective C – superset of C • Delegates – one object depends on another object to perform functions. • Protocols – declare methods to be implemented by any class • ARC – Automatic Reference Counting/Memory Management10/18/2012 Jeanine Swatton 22
  23. 23. iOS DevelopmentApplication/Directory Structure File types: .m – Main file (equivalent to C++ .cpp file) .h – Header file (equivalent to C++ header file) .framework .plist – property list files .xib – “Nib files”10/18/2012 Jeanine Swatton 23
  24. 24. RubyMotion10/18/2012 Jeanine Swatton 24
  25. 25. RubyMotion More info: • Toolchain • Based on Rake • Combine Objective C & Ruby • Subscription license • Memory management – Similar to ARC • Debug files available • iOS 6 compatible10/18/2012 Jeanine Swatton 25
  26. 26. RubyMotion Installation: • Purchase Commercial License • No Xcode needed • Install RubyMotion10/18/2012 Jeanine Swatton 26
  27. 27. RubyMotion Create and run: > motion create testapplication > cd testapplication > rake10/18/2012 Jeanine Swatton 27
  28. 28. RubyMotion Demo10/18/2012 Jeanine Swatton 28
  29. 29. MobiRuby10/18/2012 Jeanine Swatton 29
  30. 30. MobiRuby Developed by: Yuichiro MASUI http://mobiruby.org/ His plans: Will be adding it to Android!10/18/2012 Jeanine Swatton 30
  31. 31. MobiRuby Stack Thanks to: Yuichiro MASUI Your code mruby – muby – mobiruby - mobiruby - cfunc cocoa common ios mruby IOS10/18/2012 Jeanine Swatton 31
  32. 32. MobiRuby Thanks to: Yuichiro MASUI – feedback from the creator • mruby-cfunc – C function bridge for mruby – Based on libFFI • mruby-cocoa – Garbage collection – Cocoa bridge for mruby • mobiruby-ios – Xcode integration10/18/2012 Jeanine Swatton 32
  33. 33. MobiRuby Installation: Xcode > git clone git://github.com/mobiruby/mobiruby- ios.git > gem install nokogiri > gem install xcodeproj  sh ./setup.sh  open mobiruby-ios.xcodeproj/10/18/2012 Jeanine Swatton 33
  34. 34. iOS Development10/18/2012 Jeanine Swatton 34
  35. 35. MobiRuby Demo10/18/2012 Jeanine Swatton 35
  36. 36. Thanks to:Yukihiro Matsumoto, “Matz”www.github.com/mruby/mrubyLaurent Sansonetti, RubyMotionwww.rubymotion.comYuichiro Masui, MobiRubywww.mobiruby.comDesign/Animation by:Jana Antonova: www.antonova.me10/18/2012 Jeanine Swatton 36

×