what is the best way to call the webservice of long run in android. Calling via Service or Calling via AsyncTask or is there any other suggested best way?
Thanks in advance
what is the best way to call the webservice of long run in android. Calling via Service or Calling via AsyncTask or is there any other suggested best way?
Thanks in advance
It depends on for what the web service is called, i.e, if the response being delayed doesn't affect the running of application, it is always good to add it in AsnycTask.
If you're seeking understanding, try it both ways. When experimenting with your own AsyncTasks, try confining them to a method that take a callback interface and see how much cleaner it makes the rest of your code.
If you're seeking a practical solution, I highly recommend using a library like android-async-http that handles everything for you.