Using Phonegap as a Native Container for a Rails 3 App

Using Phonegap as a native container for a Rails 3 App

I do not believe such a container exists to run on the client side but it is possible to dynamically serve a PhoneGap app (i.e. the app acts as a web browser with native functionality available via javascript commands).

Here is code which demonstrate exactly what you are describing.

Here is a screen cast I did associated with demo.

NOTE: The demo is using an out 3.2.1, and is broken as of the latest version Xcode and/or PhoneGap but it is possible, and apps of this nature are valid in the the various app stores, (Linkedin alongwith many others are already doing it.) The logic is there I just haven't had the time to fix the bug with the new version of Xcode, or update the PhoneGap code (doing the update may actually fix the bug in one quick work session).

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

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.

What is PhoneGap used for, exactly?

You are spot on.
Phone gap is for bridging the gap between HW and your web app.

If you are not using any of the HW items listed, then there is no need for you to use PhoneGap.

Jquery Mobile would be a good choice.

On a side note - Soon, PhoneGap nay not be needed either! With HTML5, you should be able to directly access most of this HW. However, still browsers have limited to no support for this. (Chrome works, and the latest FF nightly builds, Opera Developer builds can access Camera/microphone)



Related Topics



Leave a reply



Submit