Creating iphone & android apps for existing rails app Creating iphone & android apps for existing rails app android android

Creating iphone & android apps for existing rails app


I am building a mobile application with a grails backend, must support android and iphone

I have done a few iterations so far while attempting to settle on technology, a native objective-c, native android, phoneGap and titanium appcelerator.

for authentication I use HTTPS with basic auth. I know people are concerned about basic-authentication, but it has been argued both ways see this StackOverflow Question

I have not solved the syncing problem yet, but I dont expect to implement that complex of a solution initially, will store local content (XML or JSON) and push back to server on demand. Content is stored locally in same format used when posting to server

Backend in grails, all REST API calls are logged and authenticated on each request. Will probably add additional security only allowing specific registered devices to access the API as and additional level of security


I've been building a iPhone app with a Rails back end. I've been using Objective-C because it needs the full Core Location framework which isn't available with a browser based solution. So if you want to use the full capabilities of the device, you have to use the native development environment.

I've been using Objective Resource http://iphoneonrails.com/ which is an open source framework that provides Active Resource-like extensions to Objective C NSObject classes and plays very well with my Rails App. You just have to put in render JSON or XML for your controller actions like in the example below.

 class UsersController < ApplicationController # GET /users # GET /users.xml def index   @users = User.all  respond_to do |format|  format.html # index.html.erb  format.xml  { render :xml => @users }  format.json  { render :json => @users }end

end

I don't if this answers all your questions as I don't know enough about your app but it's a good starting point.


Maybe you will find useful my example rails + ember.js App with token authentication based on ember-auth and several OAuth strategies. It is responsive and works both as a desktop and mobile App with Phonegap.

Currently in de the devel branch: https://github.com/joscas/base_app/tree/devel

Life here: https://starter-app-staging.herokuapp.com for the desktop version.

It uses the phonegap-rails gem (of which I'm also the author) to export the apps assets, fix paths etc without hassle.