I have the android app, and i have a server side.
I want to perform the following background job:
Contact the server every 60 seconds, “ask” him if some condition is met, and when the condition met, i want to show an alert dialog to the user, with OK and Close buttons. if the user clicks OK, an Activity should be brought to front.
i read about asynkTask and Service, but could not decide which one to use
should i use this task in asynkTask or Service?
Thanks!
Using an AsyncTask is probably easier, as a) the query to the server in doInBackground will not block the UI and b) onPostExecute executes in the UI thread/context which makes it easy to report OK or Close.