Write cross platform native apps in Ruby
-
Upload
giedrius-rimkus -
Category
Engineering
-
view
91 -
download
2
Transcript of Write cross platform native apps in Ruby
![Page 1: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/1.jpg)
Write Cross-platform Native Apps in Ruby
2017 February#vilniusrb
![Page 2: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/2.jpg)
Giedrius RimkusRuby Developer @ PlateCulture - Social dining experiences
https://plateculture.com
![Page 3: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/3.jpg)
Traditional native ways
![Page 4: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/4.jpg)
![Page 5: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/5.jpg)
Tools to make hybrid apps
![Page 6: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/6.jpg)
Other cross-platform tools to create native apps
![Page 7: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/7.jpg)
RubyMotion
![Page 8: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/8.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/9.jpg)
![Page 10: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/10.jpg)
Laurent Sansonetti
![Page 11: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/11.jpg)
![Page 12: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/12.jpg)
![Page 13: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/13.jpg)
![Page 14: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/14.jpg)
![Page 15: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/15.jpg)
![Page 16: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/16.jpg)
![Page 17: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/17.jpg)
iOS
![Page 18: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/18.jpg)
Android
![Page 19: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/19.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/20.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/21.jpg)
Requirements (Windows or Linux)
It works on Mac exclusively.
![Page 22: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/22.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/23.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/24.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/25.jpg)
![Page 26: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/26.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/27.jpg)
![Page 28: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/28.jpg)
![Page 29: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/29.jpg)
RedPotionFramework for faster iOS development in Rubymotion.
![Page 30: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/30.jpg)
BluePotionFramework for faster Android development in Rubymotion.
![Page 31: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/31.jpg)
Motion GameCross-platform game engine for RubyMotion
![Page 32: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/32.jpg)
Success stories
![Page 33: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/33.jpg)
![Page 34: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/34.jpg)
![Page 35: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/35.jpg)
![Page 36: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/36.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/37.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/38.jpg)
DEMO
![Page 39: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/39.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/40.jpg)
Questions?
![Page 41: Write cross platform native apps in Ruby](https://reader033.fdocuments.in/reader033/viewer/2022052418/58a3d99d1a28ab7f0b8b5155/html5/thumbnails/41.jpg)
Thank YouWrite Cross-platform Native Apps in Ruby
Giedrius Rimkus