Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Creating Augmented Reality Apps with RubyMotion

Lori M Olson
November 18, 2019

Creating Augmented Reality Apps with RubyMotion

Augmented Reality (AR) is the new cool. But did you know you could write AR apps (and games!) using Ruby(Motion, that is)? Come and escape normal boring reality with us, as we create a native AR app using RubyMotion.

Lori M Olson

November 18, 2019
Tweet

More Decks by Lori M Olson

Other Decks in Programming

Transcript

  1. View Slide

  2. Creating Augmented Reality
    Apps with RubyMotion
    Lori Olson

    WNDX School

    View Slide

  3. Why RubyMotion?

    View Slide

  4. Why RubyMotion?
    Because it’s Ruby, duh.

    View Slide

  5. But it’s mobile *native*
    development, so why not use…

    View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. Why Not…

    View Slide

  11. Why Not…
    • I’ve used it

    View Slide

  12. Why Not…
    • I’ve used it
    • Syntax is ugly and hard to read

    View Slide

  13. Why Not…
    • I’ve used it
    • Syntax is ugly and hard to read
    • It’s the old, uncool language

    View Slide

  14. Why Not…

    View Slide

  15. Why Not…
    • Language has been evolving *very* fast

    View Slide

  16. Why Not…
    • Language has been evolving *very* fast
    • Every new version (5 so far) breaks
    backward compatibility

    View Slide

  17. Why Not…
    • Language has been evolving *very* fast
    • Every new version (5 so far) breaks
    backward compatibility
    • although last release was better

    View Slide

  18. Why Not…
    • Language has been evolving *very* fast
    • Every new version (5 so far) breaks
    backward compatibility
    • although last release was better
    • 5 years they’ve managed to raise the
    language to a level of complexity that
    rivals the much older Java

    View Slide

  19. Why Not…
    • Language has been evolving *very* fast
    • Every new version (5 so far) breaks
    backward compatibility
    • although last release was better
    • 5 years they’ve managed to raise the
    language to a level of complexity that
    rivals the much older Java
    • That’s not a compliment

    View Slide

  20. Why Not…
    • Language has been evolving *very* fast
    • Every new version (5 so far) breaks
    backward compatibility
    • although last release was better
    • 5 years they’ve managed to raise the
    language to a level of complexity that
    rivals the much older Java
    • That’s not a compliment
    • I will say the syntax is nicer than ObjC

    View Slide

  21. Why Not…

    View Slide

  22. Why Not…
    • I’m sorry

    View Slide

  23. Why Not…
    • I’m sorry
    • No, I’m not that sorry

    View Slide

  24. Why Not…
    • I’m sorry
    • No, I’m not that sorry
    • I really hate Javascript

    View Slide

  25. Why Not…
    • I’m sorry
    • No, I’m not that sorry
    • I really hate Javascript
    • And it’s not really native, so there’s that

    View Slide

  26. Why Not…
    • I’m sorry
    • No, I’m not that sorry
    • I really hate Javascript
    • And it’s not really native, so there’s that
    • Besides, every mobile app you really
    hate was probably created with
    Javascript

    View Slide

  27. Quick Intro to
    RubyMotion

    View Slide

  28. Quick Intro to
    RubyMotion
    DragonRuby

    View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. Why did I chose
    RubyMotion?
    WIMBY
    Wells In My Back Yard
    wimby.ca

    View Slide

  35. Tried Objective C

    View Slide

  36. Tried Objective C
    Still disliked it

    View Slide

  37. Tried Objective C
    Still disliked it
    Context Switch was brutal

    View Slide

  38. View Slide

  39. RubyMotion

    View Slide

  40. Difficult

    View Slide

  41. Difficult
    ‣ Lack of *good*, *deep* examples

    View Slide

  42. Difficult
    ‣ Lack of *good*, *deep* examples
    ‣ Constant need to translate from
    Objective C

    View Slide

  43. Difficult
    ‣ Lack of *good*, *deep* examples
    ‣ Constant need to translate from
    Objective C
    ‣ And now from Swift examples to
    figure stuff out

    View Slide

  44. Difficult
    ‣ Lack of *good*, *deep* examples
    ‣ Constant need to translate from
    Objective C
    ‣ And now from Swift examples to
    figure stuff out

    View Slide

  45. Why not teach?

    View Slide

  46. I love teaching,
    but..

    View Slide

  47. I love teaching,
    but..
    Live teaching is exhausting

    View Slide

  48. What about online?
    And WNDX School was born

    View Slide

  49. What about online?
    And WNDX School was born

    View Slide

  50. But the AR, Lori…
    Where’s the Augmented Reality we were promised?

    View Slide

  51. New cool APIs like ARKit
    Apple WWDC

    View Slide

  52. View Slide

  53. View Slide

  54. View Slide

  55. Need to create new
    AR examples!

    View Slide

  56. Start Somewhere

    View Slide

  57. Augmented Reality
    Hello World

    View Slide

  58. LIVE CODING ALERT

    View Slide

  59. LIVE CODING ALERT

    View Slide

  60. Augmented Reality
    Hello World

    View Slide

  61. Other tutorials
    like Ray Wenderlich

    View Slide

  62. Places Of Interest

    View Slide

  63. POI Code

    View Slide

  64. Live POI AR Demo

    View Slide

  65. If you don’t find this example compelling

    View Slide

  66. If you don’t find this example compelling
    • Make it your own.

    View Slide

  67. If you don’t find this example compelling
    • Make it your own.
    • Don’t need to use Google data or
    get a Google API key

    View Slide

  68. If you don’t find this example compelling
    • Make it your own.
    • Don’t need to use Google data or
    get a Google API key

    View Slide

  69. If you don’t find this example compelling
    • Make it your own.
    • Don’t need to use Google data or
    get a Google API key
    • Check your local government (civic,
    state, or federal) Open Data.

    View Slide

  70. If you don’t find this example compelling
    • Make it your own.
    • Don’t need to use Google data or
    get a Google API key
    • Check your local government (civic,
    state, or federal) Open Data.
    • Download some data with precise
    GPS locations, and go crazy

    View Slide

  71. How about a real example?

    View Slide

  72. View Slide

  73. How about a game?

    View Slide

  74. How about a game?

    View Slide

  75. View Slide

  76. SurvivAR

    View Slide

  77. SurvivAR
    Flaming demons

    View Slide

  78. SurvivAR
    Use the shooting sight

    View Slide

  79. SurvivAR
    Mini-map to see behind

    View Slide

  80. Video Demo

    View Slide

  81. Video Demo

    View Slide

  82. SurvivAR Project / Rakefile

    View Slide

  83. But there’s a twist
    to this story

    View Slide

  84. I lied

    View Slide

  85. Not me

    View Slide

  86. Well sort of

    View Slide

  87. Well sort of
    I helped

    View Slide

  88. My Intern built these apps

    View Slide

  89. First year Comp Sci

    View Slide

  90. First year Comp Sci
    • Derek

    View Slide

  91. First year Comp Sci
    • Derek
    • Done a little web programming

    View Slide

  92. First year Comp Sci
    • Derek
    • Done a little web programming
    • Learned Java in 1st year

    View Slide

  93. How does a first year student
    do this?

    View Slide

  94. 1. Learn Ruby

    View Slide

  95. 2. Choose Your Own
    Adventure

    View Slide

  96. 2. Choose Your Own
    Adventure
    He chose ARKit

    And a game

    View Slide

  97. 3. Reviewed all the MiM
    videos

    View Slide

  98. I did help

    View Slide

  99. Amir helped, too

    View Slide

  100. So why tell you all that.

    View Slide

  101. Not enough diverse apps
    out there

    View Slide

  102. More diverse app creators needed

    View Slide

  103. More diverse app creators needed
    • To see the problems
    others don’t see

    View Slide

  104. More diverse app creators needed
    • To see the problems
    others don’t see
    • To create the apps to
    solve those problems

    View Slide

  105. WNDX School is
    here to help you
    To help you, Ruby Developers,
    get those app ideas out of your
    heads and into the App Store.

    View Slide

  106. So do me a favour, and get out
    there and build YOUR app!

    View Slide

  107. So do me a favour, and get out
    there and build YOUR app!
    Or help someone build an app to solve THEIR problem.

    View Slide

  108. Thanks for coming!
    Find your on-ramp for RubyMotion Development with FREE Getting
    Started guides here:
    https://wndx.school/p/rubyconf
    Pssst. There’s stickers. Find me for questions after this talk.

    View Slide