I’ve the need to create a simple app that do this:
– every run try to download somewhat like 20 pdf from web (every time from the same location, because the server keep it updated every minute)
– the main activity will be only a list of pdf. One dir will be scanned for downloaded files. If there are any, then them will be listed.
The problem is I need to download ‘in background’, but not with a ‘never-ending service’.
I’m thinking to create launch a sevice when application start. The main activty scan the dir e show the pdf, while the service try to download the pdf.
If the first time not all of the pdf are yet downloaded, is not a problem.
I tried to do this, but the service ‘lock’ the app, so the app is not responding.
I was thinking that service run into a separate thread. Is is real ?
So: wha’t the best solution to have the activities running smooth, but in background ‘something’ download a lot of file ?
Android-AsyncTask or Android-IntentService is best suited for your requirements.
If you will going to use AsyncTask you can update your Activity UI periodically while downloading continues.