• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to call RESTful web service from android?

 
Sarra Sakka
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
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • 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: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Searching for "android call rest api" finds several promising starting points.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12058
232
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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!