I need to program a small server to handle requests from an Android application. (The user sends a number to the server, the server does some math on the numbers received from each user - the average, let's say - and returns it).
I've just read this simple introduction from Oracle (http://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html).
It explains how to leave a server listening on a specific door. Normal java, no special application needed (such as Tomcat).
I know people generally use 'servlets' (with Tomcat) to accomplish this kind of thing. Why is that? What are the advantages? Can't i just program a sample server like the one described in that simple tutorial, and leave it always running on a computer?