Reputation: 5177
My android application needs to communicate with a couple of Rest Services. Now i am decided to avoid using AsyncTasks for this. My architecture will be based on one Service and a couple of Intent Services. Each of my activity will send an intent containing parameters to a single service. Based on these parameters, the Service will invoke various IntentServices. The intent service will then perform the network operations and broadcast the result back into the calling activity. Is this approach correct ? Might be an idea for the Activity to directly invoke the IntentService ? What are the cons of this approach ?
Kind Regards
Upvotes: 2
Views: 558
Reputation: 8686
You can use RESTDroid that implements the service pattern designed by Virgil Dobjanschi in the Google IO video
Upvotes: 0
Reputation: 7156
the WebApp
i.e. the REST service should answer with a response
very quickly (so the client app doesn't lock). If your request takes some time to process, the response
should be 202
. So you may have to look up that resource again, and that is indeed a nice job for AsyncTasks
.
Upvotes: 0
Reputation: 3686
Use robospice :)
Motivation : http://thumbnails.visually.netdna-cdn.com/RoboSpice_508a372b320e5.png
Upvotes: 1