0

I am currently writing and Android app, and I need to do some stuff with a server. Actually I just don't know where to begin, since I don't know very much about server side.

My Android app will send Java objects and images to my server, so what do I need to write or use on my server ? Is it possible to write Java code instead of PHP on the server side ?

Could you please give me the steps to prepare my server ?

Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
cleroo
  • 1,145
  • 2
  • 11
  • 17

2 Answers2

3

Is it possible to write Java code instead of PHP on the server side ?

You can use any programming language you like for server side programming. This question provides some useful information on various Java based approaches using the HTTP protocol.

will send Java objects

You will need to serialise them to a data format. JSON and XML are popular for transmitting structured data across HTTP.

and images to my server

HTTP allows the transmission of files and Java can construct the request.

Community
  • 1
  • 1
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thanks, I will try with what you gave me :) I've already wrote in the past a server that displays a webapp with JSP and Servlets. What is the difference between this and writing a program on a server for an Android app ? – cleroo Jul 20 '12 at 09:21
  • Ok ! So I just need to write some servlets that use Gson for example to format a JSON file ? – cleroo Jul 20 '12 at 09:37
  • What kind of project do I create in Eclipse ? A "Dynamic Web Project" like I did for my webapp ? – cleroo Jul 20 '12 at 10:21
1

I see that you just want to communicate between the server and client(Android). I would recommend considering REST style web service for your server, where you can use either JSON (recommended) or XML format.

How to implement REST in a web application?

Community
  • 1
  • 1
18bytes
  • 5,951
  • 7
  • 42
  • 69