问题
I try to implement a restful client on android via Jersey library. It works pretty well in a Java project. But when I do it in a android project, always come up an exception: could not find class "com.sun.jersey.api.client.config...." It seems that the library cannot be found even I have added it in the build path.
回答1:
I believe Jersey currently is not ported to Android. But for example Restlet does explicitly support Android and also implements the same API (JAX-RS).
回答2:
The jar file needs to physically be located in the directory /libs in your project to be included into the distributed apk and linked to the app at runtime.
来源:https://stackoverflow.com/questions/6127997/use-jersey-library-in-a-android-project