If you intend to host your web services from an Android device. This is an unusual case, but in the restlet structure there is a server component that runs on android. Checkout http://restlet.org/learn/guide/2.2/editions/android/ .
It does not require a separate web server and is rather meager. I have not tried it as an android server personally, so I can not vouch for how well it works there, but I used it autonomously and on appengine.
You need to get away with something like code wrapping in an Android service
Component serverComponent = new Component(); serverComponent.getServers().add(Protocol.HTTP, 8080); final Router router = new Router(serverComponent.getContext().createChildContext()); router.attach("/myrestendpoint", MyServerResource.class); serverComponent.getDefaultHost().attach(router); serverComponent.start();
source share