user1730789
user1730789

Reputation: 5177

Android Rest Architecture

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

Answers (3)

Pierre Criulanscy
Pierre Criulanscy

Reputation: 8686

You can use RESTDroid that implements the service pattern designed by Virgil Dobjanschi in the Google IO video

Upvotes: 0

sschrass
sschrass

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

Related Questions