I’m developing a app that requires sync with the server app every 5 minutes… Which is the best way to accomplish that? I’m using a ThreadPoolExecutor (java way…) but I’m not very happy with that… and I want to know what other solutions can you provide me….
Thanks!
Either you can use Thread, AsyncTask with time interval of 5 minutes, or just use a background service which execute web-service at every 5 minutes continuously.
Also Use
AlarmManagerto set up your schedule and anIntentServiceto do the actual work. TheIntentServiceautomatically gives you your background thread for your network I/O, and it automatically shuts down the service when the work is complete.