Swifty McSwifterton
Swifty McSwifterton

Reputation: 2667

Building a web service for Android

I have worked with web services before from the client side on Android, but now I am looking to build my own web service, and I want to find the best solution for working with Android before I start hacking away. I want the output format to be JSON, as I think it will be faster and perhaps a little easier than SAX. So, in what language would it be the easiest and most direct (in everybody's opinion) to pull this off? I don't care which language it ends up being, so long as it is the fastest, easiest, and most efficient way to connect with my Android app. I could pull it off in PHP but I am not sure it that is the rout I want to take just yet. Just looking to get some opinions before I start.

Upvotes: 2

Views: 766

Answers (5)

piotrpo
piotrpo

Reputation: 12636

In my opinion, if you build complex and dedicated for android app service the most suitable language is java - this same language as your app, this same knowledge, this same tools. As far as I remember PHP was very poor language, easy to write something like "hello world" but very annoying when you want to write something more complex. On the other side you should take a look at costs of writing and deploying your service. PHP developers are far cheaper than Java EE developers, one month of Java hosting costs similar to one year PHP hosting with MySQL installed. This is really big advantage to PHP.

Upvotes: 0

Amir Raminfar
Amir Raminfar

Reputation: 34150

This question is really really broad. But I'll take a crack at it. Your options are:

  1. PHP - Really simple and light. Almost every hosting company has this option. You can use codeigniter or something similar to create json output views.
  2. Ruby/Rails - Don't know this too much.
  3. Java/J2EE - Might be your best option because you can share classes. For example if you have Person.java and use a lib to create the JSON, then you can use the same class to read a new Person. I suggest using these libraries
    • Jackson for parsing and reading JSON
    • Maven for quickly making a war file
    • Spring or some other REST api to create RESTful services.

Upvotes: 2

Jarek Potiuk
Jarek Potiuk

Reputation: 20047

If you know Java and want to use it on both sides, I'd recommend restlet libraries: http://www.restlet.org/documentation/. Restlet gives I think appropriate level of abstractions and have ready-to-use client and server bindings for the popular environments. For example it has an android client side libraries, you can run server on J2SE, J2EE or Google App Engine by default. Simple, clean and easy to use.

Upvotes: 1

Brandon Wilson
Brandon Wilson

Reputation: 4590

I am currently working with CakePHP to help build my API's and such for my web service. It is a fairly easy and fast way to bring everything together. I have a MySql DB, PHP code, and then the API to back it all up.

Upvotes: 0

citizen conn
citizen conn

Reputation: 15390

If you know PHP then just use a framework like CodeIgniter to set up elegant URIs to your endpoints. That could be an option if you are comfortable with PHP already.

Upvotes: 0

Related Questions