Ruby on Android
In this video, Nick Howard discusses the integration of Ruby and Ruby-like tools within the Android development environment during the Rocky Mountain Ruby 2012 event.
Key Points:
Setting Up Ruby on Android:
- To start using Ruby on Android, one must first install the Android SDK, which allows for the running of an emulator and packaging apps.
- A tool named Roboto, a modified version of JRuby for Android, enables the creation of Ruby applications.
Use of Gems:
- Developers need to install a specific gem that manages the build process. This gem does not run tests but packages JRuby with the application to target specific Android versions and packages.
Android Activities:
- An Android app is composed of activities, which can be likened to web app pages, containing elements like buttons.
- A basic example involves an activity displaying “Mr. Roboto” and including a button to change text.
Introduction to Mirro:
- Mirro, another project mentioned, compiles directly to JVM bytecode, resembling Ruby but using Java’s object model.
- Mirro simplifies coding with a framework to create Android applications; developers provide type information for the compiler to better understand the code.
Example Projects:
- Nick illustrates how to create an Android game app. For example, a Sudoku game and a simple game called Guess My Number, where players guess a randomly generated number with hints provided upon their guesses.
User Interface Development:
- While the UI developed using these tools may not match RubyMotion's polish, there is a DSL available for UI building.
- He mentions an app that allows running Ruby code on Android devices, along with an IRB app for on-the-go calculations.
Conclusion:
This session highlights how Ruby can be adapted for Android development through tools like Roboto and Mirro, demonstrating that developers can utilize familiar Ruby syntax while addressing platform-specific requirements. Nick provides insights into creating functional apps and encourages experimentation with Ruby on Android tools while considering their advantages and constraints.