My server application exposes a RESTful web service using JAX-RS (Jersey Implementation). What is the best way to invoke this service (other than using Apache HttpClient)? I was wondering whether the REST Client APIs from Jersey, Restlet, RESTeasy and other frameworks work on Android.
Thanks, Theo
Here is a good example which contains source codes of everything including EJBs, RestEasy and Android:
http://code.google.com/p/android-jbridge/
If you want a little bit more comfort than having to deal with URLConnection, check out Resty for Java. Simple, light-weight, but still pretty new.
http://beders.github.com/Resty
Ran into this one the other day, haven't tried it yet thought, but seems to work on android: http://crest.codegist.org
Resteasy-mobile is a perfect solution.
It's basically full blown resteasy (which has client framework) but uses Apache HTTP Client rather than HttpURLConnection (which doesn't exist on android)
Here is more information about usage (http://docs.jboss.org/resteasy/docs/2.3.1.GA//userguide/html_single/index.html#RESTEasy_Client_Framework)
Here is for the maven
A little sample code on android side
JAX-RS service definition (PushSVC.java) on both android and server side
Model MessageVO definition
This is method invocation on android
This is pretty simple and all written codes are reusable, boilerplate code is near to non-existence
Hope this help everybody.
For simplest cases you can just use java.net.URL and its openConnection() method to make a request. And then data binding libraries (JAXB for XML, Jackson for JSON) to handle response (and possibly request if you POST xml or json).