When implementing calls to a webservice I have worked with the following schema: implement a class that extends AsynkTask
and within method doInBackground()
I make the call to my service. One particularity here is that instead of using the HttpUrlConnection
class I have used a Spring framework , Spring for Android , which provides a number of features, including code cohesion.
Although it works perfectly, this scheme is somewhat unproductive and even tiresome. For each request I need to implement a new AsyncTask
.
Is there any good practice, even if unofficial, or some approach that the community has adopted in order to facilitate the development of calls to a webservice and decrease the amount of code implemented for this purpose?