Reputation: 1548
I have a rails application currently running ,I want to make a mobile application for it ,I don't want to learn objective-c or java ,I read many articles about phonegap and how I can use it to make a cross platform web apps
Phonegap compile css/htm/js
Rails application has its ruby code and also html.erb and js.erb extensions
So how can I make a mobile application ,mainly for android for ex as a back-end of my rails excising server
I will use jquery mobile as a UI for the application
Do I need to make an api and use emberjs or angularjs or backbone to contact with the server ?
Tutorials in using rails as a back-end for a mobile application are so rare
Upvotes: 3
Views: 2269
Reputation: 136
You don't need to create a API. I had a similar situation, and used just Rails, Cordova/PhoneGap, Bootstrap, and a few Cordova plugins.
I ran into 2 main gothchas: how to get the correct assets loaded into the app's page, and how to tell an app access from a "browser" access on the same device.
My app required that I have a slightly different set of plugins for iOS and Android. So I needed a way to bundle up just the right set for each. I used multiple manifest files in the app/assets/javascripts directory to handle that.
I also modified the user-agent strings coming from my Cordova apps. By default, you can't really tell a "browser" GET from a Cordova app GET.
Upvotes: 0
Reputation: 4596
Obviously, there is no a single way to do this. So, I'll tell you the tools I use when have to build a mobile client working with API server app.
Backend:
Frontend:
With Ember you can use ember_phonegap_starter. This is a starter kit to get you up and running with Ember inside a mobile application. This can be dumped inside a PhoneGap wrapper to create an App wrapper for your Ember application. (check out the screencast)
You can use bootstrap-for-ember (examples) to add Twitter Bootstrap 3 to your Ember app.
Upvotes: 2
Reputation: 832
This may not be the solution but an attempt on how I would do it if I were to use these technologies. The way I can see you pull this off is to use RubyonRails as Backend Sever that fetches REST API. Look here and there to see how it can be achieved. So in essence RuybOnRails server will perform fetching REST API services.
Then, in PhoneGap you could use Backbone.js, Look here for more info, to perform your GET/POST/CRUD requests. Hope this helps.
Upvotes: 1