Runtime Architecture

Rhodes development files are compiled into a native executable that is installed on the device or run in a desktop simulator using command line tools or the web interface on

Since Rhodes apps are native binary applications, they can be submitted and distributed through the Apple iTunes App Store, BlackBerry World, Android Marketplace, and other distribution channels. To build for a device, you typically need to sign up for those developer programs and acquire cryptographic keys required to sign applications, even though you will not be writing in the platforms native SDKs. You also need to observe each platform's user interface guidelines so that your applications can be approved. (See Part 1 of the book on submitting apps for your target platform(s).)

On platforms where the primary development language is Java, such as BlackBerry, Rhodes applications are cross-compiled into Java bytecode that are then executed natively. On iPhone, Android, Windows Mobile and Symbian platforms, Rhodes applications are compiled into Ruby 1.9 bytecode. On these platforms, Rhodes includes a Ruby executor that runs the bytecode on the device. The Rhodes Ruby implementation is a subset of Ruby 1.9. It does not include all of the libraries that you would find on a desktop implementation of Ruby, although it is possible to extend it and add additional libraries into your application. (See index.php/Rhodes#Adding_Libraries_to_Your_Rhodes_Application.)

To connect your Rhodes application with web services, you can use RhoSync or connect directly. You can connect directly via JavaScript, use the Ruby net/http library, or the optimized Rho:AsyncHttp. However, with remote data, you almost always want to cache it locally for offline use and using a RhoSync server is ideal for that use case. As detailed in chapter 7, you would write a source adapter that runs in the server environment where you have access to the full Ruby language and complete libraries.

Although Ruby is an interpreted language, using Rhodes, you cannot run arbitrary Ruby code at runtime by using, for example, string eval. That capability was intentionally removed in Rhodes Ruby interpreter to comply with iPhone App Store's Rule 3.3.2 that states:

An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple's Published APIs and built-in interpreter(s).


Rhodes is a fully native application and embeds the device's built-in browser. This has implications for the markup, CSS, and JavaScript that can be supported on each platform. Some devices, such as the iPhone and Android, have full-featured browsers while others like the BlackBerry do not. This means that you cannot write HTML and CSS that take advantage of advanced or platform-specific browser features on one device and expect it to work on another device with a less capable web browser. While Rhodes apps are developed much like web apps, they run locally as native apps and not remotely like web apps. All processing and database access is local.

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide

Post a comment