How to use SOAP / REST web services on Android (service / translation / intent / etc.)

Is there a general way to use web services from Android applications (other than protocol)? I need a Service or Intent or Thread (or something else) capable of:

  • stay alive no matter what actions are open;
  • the ability to simultaneously perform multiple requests;
  • accept input values ​​and return output values ​​to the right subscriber;
  • be able to cancel the current operation (while saving all the rest), and not return the output value if it is no longer required;
  • (of course) runs asynchronously.

Is there a general way to do this? I had some problems when using the Services, primarily because I could not refuse the current operation, so the results ran into each other.

+4
source share
3 answers

mmm you need a combination of things here. First of all, you need the service level to implement it with the Linked Service (inherits). Your user interface should invoke this service using Intent . Then this layer, which will execute it on a thread other than your user interface level, must have a Client Client object to make service calls. You have a lot of approaches here, I recommend you Spring Rest as well as Restlet .

Like a pretty big discussion, everything else, please tell me.

+1
source

You must use Service for this task. This is the only component designed to handle long-term background tasks. Most likely, you need to use this service as “locally connected” to send complex requests and responses without the need for serialization and perform other tasks that are relatively difficult to implement using Intent s.

Learn more about locally connected services here: Related Services .

+2
source

This question was posted earlier on the stack. Take a look at this topic Restful API Service

You can also see the gdd graph, this is exactly what you want GDDSCHED Google Code

+1
source

All Articles