I currently have a program where a user fills information out and sends it to a server. It then downloads a one to two MB file to device. I have it setup so the phone does not sleep when it is downloading the file, but it is interrupted when the user manually presses the sleep button or a text comes in to the phone. What would be the best solution to this? Should I create a service or is there someway to tell the activity to keep downloading in the onPause method?
Asked
Active
Viewed 175 times
3
-
Try looking at `IntentService` http://developer.android.com/reference/android/app/IntentService.html – Squonk Jun 28 '12 at 17:53
-
Have you tried wake_lock? http://stackoverflow.com/a/5345385/1426565 – Cruceo Jun 28 '12 at 17:57
1 Answers
1
won't it be better to download in the background using an android service and posting an android notification when it will be done?

Aqif Hamid
- 3,511
- 4
- 25
- 38