This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Android and the fly likes creating  REST webservices in java and consume them in android Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "creating  REST webservices in java and consume them in android" Watch "creating  REST webservices in java and consume them in android" New topic
Author

creating REST webservices in java and consume them in android

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
hi,
i want to get started with creating Rest webservices in java and consume those services in android.....
any help to get started would be great help for me..
iam a newbie for webservices any beginners guide of the same???

thankyou
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Check out the Jersey library. Its web site has a bunch of documentation. On the Android side you can use the built-in HttpClient library to consume those services. I'm sure if you search for "android httpclient jax-rs example/tutorial" or some such phrase you'll find multiple introductory articles as well.
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
thankyou Tim...
that was really helpfull
i m following this link
http://www.ibm.com/developerworks/library/x-android-jax-rs/

iam finding difficulty in finding these jars
jersey-bundle-1.4.jar
C:\Jersey\jersey-archive-1.4\lib\asm-3.1.jar
C:\Jersey\jersey-archive-1.4\lib\jsr311-api-1.1.1.jar

where i can i get them???
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

That is exactly what Google and Maven repositories can do for you.
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
i found them..
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You shouldn't use Jersey 1.4, but the latest version - 1.12 at the moment, I believe.
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
yup thank you;
i have used jersey 1.12.

now i have successfully tried an example to connect android with rest webservices....
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
how could i pass data from android to remote database through webservices using JAX-RS...
FOUND no good example so far
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The JAX-RS class would access the DB like any other Java class would; what, excatly, are you looking for in the example? Or, to put it another way: what are struggling with? Are you familiar with JDBC?
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
yes iam comfortable with jdbc...
can i connect it lyk i do with my nbormal java class???
arent the syntaxes different???
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Why would the syntax be different?
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Suzzane Pinto wrote:yes iam comfortable with jdbc...
can i connect it lyk i do with my nbormal java class???
arent the syntaxes different???

Suzzane kindly use real words.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating REST webservices in java and consume them in android
 
Similar Threads
Where to begin?
Web Services
Help with REST web service
New to WS, Jax-Ws vs Axis and how to get started in eclipse
Rest Services