raoul_dev
raoul_dev

Reputation: 1471

Completely self-contained Rails app for mobile, compiled as a native app

Is there any way of developing a mobile app as a self contained Rails/Ruby app?

The idea is to develop in Rails using the normal tools (browser, thin/WEBrick and command line) and then add the Rails app folder to a specially created Android/iOS app, from where it will be compiled to a native executable. This would be similar to the current PhoneGap creation process I guess. I know about RubyMotion but its iOS only, and its not completely Rails anyway.

  1. Does anything like this exist currently?
  2. What would you need to do this? Obviously you need to run a local webserver of some kind.. Do you need to run an entire stack (Apache, Ruby and Rails) inside the native app or could you take shortcuts (like JRuby for Android for example)?
  3. What is your gut feel on how this would perform?

Any thoughts welcome.

EDIT

Gems are probably going to be a BIG issue as well.

Upvotes: 3

Views: 641

Answers (2)

CommonsWare
CommonsWare

Reputation: 1007554

Does anything like this exist currently?

Rhodes is in the ballpark, but it is not Rails and (last I checked) cannot use gems. It does, however, have you build so-called hybrid apps using a Rails-ish controller pattern, with partials and all that.

Obviously you need to run a local webserver of some kind

Not necessarily, and it would be an poor idea to do so for security reasons. Hybrid apps, such as Rhodes, have a Web presentation layer (WebView) displaying the HTML content generated by the back-end, without an HTTP stack.

What is your gut feel on how this would perform?

On many devices, I suspect that your app would crash on startup for having run out of memory. On the rest, I would expect mediocre performance, simply because Rails is not particularly svelte.

Upvotes: 1

Ivan K
Ivan K

Reputation: 31

The strange thing is that you want to use web application as mobile application. Is there a reason to use Rails instead of just Ruby (then you have Ruboto on Android). My opinion that HTML5(+ local storage) is enough to serve mobile part and use API from somewhere on the web.

Upvotes: 1

Related Questions