write cross platform native apps in ruby

41
Write Cross-platform Native Apps in Ruby 2017 February #vilniusrb

Upload: giedrius-rimkus

Post on 15-Feb-2017

90 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Write cross platform native apps in Ruby

Write Cross-platform Native Apps in Ruby

2017 February#vilniusrb

Page 2: Write cross platform native apps in Ruby

Giedrius RimkusRuby Developer @ PlateCulture - Social dining experiences

https://plateculture.com

Page 3: Write cross platform native apps in Ruby

Traditional native ways

Page 4: Write cross platform native apps in Ruby
Page 5: Write cross platform native apps in Ruby

Tools to make hybrid apps

Page 6: Write cross platform native apps in Ruby

Other cross-platform tools to create native apps

Page 7: Write cross platform native apps in Ruby

RubyMotion

Page 8: Write cross platform native apps in Ruby

RubyMotion is a toolchain that allows developers to write native iOS (iPhone, iPad), WatchOS (Apple Watch), OS X (laptop and desktop

computers) and Android (phones, tablets, TVs, wearable, etc) applications in the Ruby programming language.

Page 9: Write cross platform native apps in Ruby
Page 10: Write cross platform native apps in Ruby

Laurent Sansonetti

Page 11: Write cross platform native apps in Ruby
Page 12: Write cross platform native apps in Ruby
Page 13: Write cross platform native apps in Ruby
Page 14: Write cross platform native apps in Ruby
Page 15: Write cross platform native apps in Ruby
Page 16: Write cross platform native apps in Ruby
Page 17: Write cross platform native apps in Ruby

iOS

Page 18: Write cross platform native apps in Ruby

Android

Page 19: Write cross platform native apps in Ruby

Requirements (iOS)

You will need a Mac running OS X 10.9 or higher.

For iOS development, you will also need to install the iOS SDK and join the iOS developer program in order to receive an application-signing certificate. You will need an iOS device (iPhone or iPad) if you want to physically test your application.

For OS X development, you will need to join the Mac developer program if you intend to deliver apps on the Mac App Store.

Page 20: Write cross platform native apps in Ruby

Requirements (Android)

For Android development, you will need to join the Google Play program and also an Android device configured for development.

Page 21: Write cross platform native apps in Ruby

Requirements (Windows or Linux)

It works on Mac exclusively.

Page 22: Write cross platform native apps in Ruby

Memory managementRubyMotion provides automatic memory management; you do not need to reclaim unused objects.

Since memory can be limited on iOS hardware, you must take care not to create large object graphs.

Page 23: Write cross platform native apps in Ruby

ConcurrencyThe ability to run code concurrently became critical as multicore processors appeared on iOS devices. RubyMotion has been designed around this purpose.

RubyMotion has the concept of virtual machine objects, which wrap the state of a thread of execution. A piece of code is running through a virtual machine.

Virtual machines don’t have locks and there can be multiple virtual machines running at the same time, concurrently.

Page 24: Write cross platform native apps in Ruby

ComplianceRubyMotion is 100% compliant with Apple's App Store and Google Play policies. Your code is compiled ahead-of-time, never interpreted, and you access the entire set of iOS, OS X and Android public APIs.

Once compiled, a RubyMotion app looks pretty much the same as an Objective-C or Java app.

Page 25: Write cross platform native apps in Ruby
Page 26: Write cross platform native apps in Ruby

ProMotionProMotion is a RubyMotion gem that makes iOS development more like Ruby and less like Objective-C. It introduces a clean, Ruby-style syntax for building screens that is easy to learn and remember and abstracts a ton of boilerplate UIViewController, UINavigationController, and other iOS code into a simple, Ruby-like DSL.

Page 27: Write cross platform native apps in Ruby
Page 28: Write cross platform native apps in Ruby
Page 29: Write cross platform native apps in Ruby

RedPotionFramework for faster iOS development in Rubymotion.

Page 30: Write cross platform native apps in Ruby

BluePotionFramework for faster Android development in Rubymotion.

Page 31: Write cross platform native apps in Ruby

Motion GameCross-platform game engine for RubyMotion

Page 32: Write cross platform native apps in Ruby

Success stories

Page 33: Write cross platform native apps in Ruby
Page 34: Write cross platform native apps in Ruby
Page 35: Write cross platform native apps in Ruby
Page 36: Write cross platform native apps in Ruby

Pros● Use the language you already know and love - Ruby.● No need to use Xcode, pick your favorite editor and work from terminal.

● Pretty easy to get started.● Repl (read, evaluate, print, loop)● Final result - natively compiled application

Page 37: Write cross platform native apps in Ruby

Cons● Commercial product, so it costs money● Lack of tutorials, examples, documentations● Outdated gems (companies moved to alternative solutions)● Tiny community

Page 38: Write cross platform native apps in Ruby

DEMO

Page 39: Write cross platform native apps in Ruby

References● https://github.com/infinitered/redpotion● https://github.com/infinitered/bluepotion ● https://github.com/infinitered/ProMotion● https://github.com/infinitered/rmq● https://github.com/infinitered/cdq● http://www.rubymotion.com● https://motioninmotion.tv● http://motion-toolbox.com● https://github.com/torben/FlappyMotion● https://motionpdx.github.io/blog/2016/01/20/getting-started-with-redpotion/● https://www.youtube.com/watch?v=QjwugPJllEQ● http://www.rubymotion.com/developers/guides/manuals/cocoa/runtime/

Page 40: Write cross platform native apps in Ruby

Questions?

Page 41: Write cross platform native apps in Ruby

Thank YouWrite Cross-platform Native Apps in Ruby

Giedrius Rimkus