Reputation: 47
I am creating a web application that uses ruby on rails for the server side with mysql, and I want to build an api that will allow a unified interchange between both java for android and objective-C for ios. How should I get started?
Upvotes: 0
Views: 237
Reputation: 119
Looks like you have to creates a server side REST apis which will be consumed by the mobile apps built in android or iOS. APIs are always independent of client side technology that is it can respond to any client. Apis can return data in xml or json format.
Using ruby on rails it is very easy to build REST apis with very fast development. Rails provide very easy ways to return output as json or xml, means you don't need to write separate code for both.
For that in controller you need to add following line on top
respond_to :html, :json, :xml
And in method definition you can write
respond_with(users)
It will return specific format based on request url like .json or .xml in URL.
Upvotes: 1