This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to call RESTful web service from android?  RSS feed

 
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have created a rest web service,
I want to call this with an android client.
Should you please give me an example or some useful link to follow it,
Thank you in advance
 
Rancher
Posts: 42975
76
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way to call a REST API is not substantially different in Android than it is from any other Java client. You can use the built-in Apache Commons HttpClient, or -preferred for Android API versions 9 or newer- java.net.HttpURLConnection: http://android-developers.blogspot.de/2011/09/androids-http-clients.html
 
Sarra Sakka
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i call my web service step by step with an android client ?
 
Ulf Dittmer
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Searching for "android call rest api" finds several promising starting points.
 
author and jackaroo
Marshal Commander
Posts: 12201
270
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An alternative is to use Retrofit to define how you call an endpoint using annotations. If you use something like Jersey to define your endpoint, your annotations are going to look very similar in both the client and the server.
 
Sarra Sakka
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't find a solution
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!