user2237585
user2237585

Reputation: 21

Implementing Rest Api JAVA client android eclipse

I am a newbie to Android development so apologies if i am missing something obvious here. I am using Eclipse to put together a simple Android program that will consume a couple of Rest web services. I am attempting to use the Resting API to accomplish this.

I have copied the Resting JAR file into the libs folder of my project and its in the build path however I can't reference any of the Resting classes, i attempt to include the appropriate imports but they fail to resolve.

Has anyone got a complete sample of using Resting to consume a restful web service? Should I look to use a different library perhaps? Simplicity is key for me so the lighter the library the better.

Thanks hugely for any advice you may have

Upvotes: 1

Views: 610

Answers (3)

neel
neel

Reputation: 39

Resting sample code:

List products = new RestingBuilder("http://myapis.com/productservice",Product.class) .setPort(8080) .setVerb(Verb.GET) .setTransformationType(TransformationType.JSON) .setConnectionTimeout(3000) .build();

Upvotes: 0

neel
neel

Reputation: 39

I think the resting jar file may be an archive file which in turn contains all the jar files required to use resting. You need to open the archive using a tool like winrar, extract all the jars inside, put them in the lib folder of your project and reference.

Resting seems fairly simple and lightweight. Mostly, one step.

Upvotes: 2

Abraham Guchi
Abraham Guchi

Reputation: 181

I haven't used Resting API but I have used Jersey and it is easy to use. Give it a try. As per the referencing things, things should resolve once you add the dependencies. You might need to read a bit how Eclipse handles that.

Upvotes: 0

Related Questions