2

I have created a Rest Web service using Jersey in a Java EE app. And I was able to create the client in a java app as well. I worked fine.

I'm now trying to consume my Web Service, but this time using Android.

I understood that Jersey libraries are not android oriented (Is that even true ? Please confirm this information ) and I read that Restlet is an alternative to build the Android Client.

How is that possible ? do you have any tutorials or documentation I can read for this purpose ?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
ashabasa
  • 311
  • 2
  • 9
  • 20

2 Answers2

0

"I understood that Jersey libraries are not android oriented (Is that even true ? Please confirm this information )"

This is pretty obvious. If you do the search on the jersey site, nothing shows up.

Also, it's pretty hard to find tutorial about Restlet on Android. I think you have to adapt from Java version. Personally, I use a plain http client to do REST stuff. (I think many people also do that.)

Regarding Restlet, you might find these useful:

http://weblogs.asp.net/uruit/archive/2011/09/13/accessing-odata-from-android-using-restlet.aspx

http://restlet.org/learn/guide/2.1/editions/android/

http://blog.restlet.com/2009/05/06/restlet-available-on-android-phones/

These questions are very helpful if you change your mind and want to do it without a framework.

Restful API service

Need sample Android REST Client project which implements Virgil Dobjanschi REST implementation pattern

Community
  • 1
  • 1
pt2121
  • 11,720
  • 8
  • 52
  • 69
0

I've seen people having trouble with using Jersey on Android before. You have to battle through a lot of exceptions to get it to work. There is a library on github that attempts to provide android support for jersey but I've not used it myself.

Restlet is available on android phones and you will have an easier time integrating it and getting it to work. However, I've personally found that using the HTTP client library on Android coupled with an external library to perform serialization / deserialization ( like gson ) is the easiest route to writing a REST client.

Deepak Bala
  • 11,095
  • 2
  • 38
  • 49