

Ask HN: What's the quickest way to port a Rails app to Android? - slaxman

We have a Ruby on Rails based web application. We have been getting a lot of requests for an android app from our users specifically so that they can access some data on the move even without an internet connection. What would the quickest way be?<p>PS: I am not looking to write the code from scratch. I am want to optimize the time to release the android app.
======
andrewljohnson
For fastest time to market, optimize the HTML/CSS/JavaScript to display well
in a mobile browser. Detect if they are coming from mobile (requests headers
like the user-agent tell you, or just optimize on screen size), and send down
mobile pages. Many websites are designed with this in mind from the beginning,
and services like Weebly and WPEngine will provide this in their form-built
websites.

Otherwise, if your back-end has a usable API, then something like PhoneGap
will be faster than writing a native Android/Java app.

Our marketing website takes the first approach, for our core app we write
native Java.

~~~
slaxman
Thanks! We already do serve mobile optimized content. I will checkout Phonegap
for creating the app. Would it allow me to store data locally?

~~~
andrewljohnson
Looks like it does:
[http://docs.phonegap.com/en/3.1.0/cordova_storage_storage.md...](http://docs.phonegap.com/en/3.1.0/cordova_storage_storage.md.html#Storage)

------
th0br0
Given that you're actually needing offline availability, the easiest way (as
long as you've already got a mobile-friendly design) would probably be to
deploy special wrappers for your DAOs (API classes, whatever), that perform
the necessary caching to allow for it.

PhoneGap seems only interesting if you wish to commit the cached changes (or
is offline = read-only?) upon regaining of connectivity.

------
mbesto
Is your site already mobile friendly? If so, I suspect you could do a very
quick and dirty HTML wrapper Android app that is simply a web browser.

Note - to any naysayers of this technique, getting an app out in the app store
in this case is simply another distribution technique, even if the site is
100% identical to the web version.

~~~
slaxman
I have heard that Play store rejects apps that are just a web browser. Is it
true or just a rumour?

------
zbruhnke
since its rails I would think it should be easy for you to create an API and
then use those endpoints to retrieve data from the rails app and into the
Android app.

This would mean a small amount of code on the Android side and some
augmentation to how your rails app works, but its likely that your rails
application already works alot like an API even if you didn't quite plan it
that way by the nature of how rails lays things out for you.

~~~
slaxman
OP here. yes, creating APIs is not an issue. However I have never made an
android app. I was therefore looking for a tool that will help me create one
quickly (even if it wasn't perfect) than write the android app from scratch.

------
programminggeek
Learn Java. Write the app. Submit to play store.

~~~
MrBra
Yea, and eat javabeans in the meanwhile to survive.

