write cross platform native apps in ruby
TRANSCRIPT
Write Cross-platform Native Apps in Ruby
2017 February#vilniusrb
Giedrius RimkusRuby Developer @ PlateCulture - Social dining experiences
https://plateculture.com
Traditional native ways
Tools to make hybrid apps
Other cross-platform tools to create native apps
RubyMotion
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.
Laurent Sansonetti
iOS
Android
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.
Requirements (Android)
For Android development, you will need to join the Google Play program and also an Android device configured for development.
Requirements (Windows or Linux)
It works on Mac exclusively.
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.
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.
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.
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.
RedPotionFramework for faster iOS development in Rubymotion.
BluePotionFramework for faster Android development in Rubymotion.
Motion GameCross-platform game engine for RubyMotion
Success stories
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
Cons● Commercial product, so it costs money● Lack of tutorials, examples, documentations● Outdated gems (companies moved to alternative solutions)● Tiny community
DEMO
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/
Questions?
Thank YouWrite Cross-platform Native Apps in Ruby
Giedrius Rimkus