Search code examples
androidasp.netweb-servicesksoap2

call periodically a .net webservice from android


I have an android app that calls a simple .asmx web service hosted in an asp.net application to get data and display it. I'm using ksoap2, and it's working perfectly, in the main activity I'm calling the webService. but my problem is that I want to call that .asmx web service every 30 minutes and get the data to display. I've searched and found the timertask class but I'm not sure if it will fit with what I want to do. any suggestions? Many thanks


Solution

  • You should have a Service to do this for you, Create a service and in that service you can schedule a thread to call your webservice every 30 minute even if your application isn't running. Here is the good tutorial on how to use service to let you get started. And this is a useful link about How and When to use Service. Please consider accepting the answer by clicking on left green Tick icon.