7

Is there a counterpart to androids DownloadManager? I want to start uploading files and when the app gets killed, the upload should continue. It should offer similar possibilities like setting headers, progress notification, notification hub integration, etc.

I found https://github.com/alexbbb/android-upload-service but it is using a ServiceIntent. So it will stop the work when the app gets killed. Or did I understand something wrong?

If there is no counterpart: What is the best way to write a background service that run independent from the app state? I had a look at Services, AsyncTask, ServiceIntent, but all of these will stop when the app dies!?

Sven-Michael Stübe
  • 14,560
  • 4
  • 52
  • 103
  • Terms like "app gets killed" and "app dies" are not especially precise, and so it is unclear what specific scenarios worry you. – CommonsWare Jun 16 '15 at 15:32
  • 1
    Ok app gets killed: Go to list of running apps and click on "force stop". So it should run completly independent from the app process. – Sven-Michael Stübe Jun 16 '15 at 15:35
  • 2
    That is normal procedure for a force stop of your App. It should certainly not keep operating if the OS closes it (especially at the will of the user) – Knossos Jun 16 '15 at 15:36
  • 1
    But why is there a component like DownloadManager that offers functionality for exactly this scenario? For example installing apps via Playstore is working in this way. And "force stop" is just my way of killing the app (for testing this feature). The Killers can be other tasks, the os, crashes, whatever. – Sven-Michael Stübe Jun 16 '15 at 15:41
  • "The Killers can be other tasks, the os, crashes, whatever" -- these are not related to "force stop". The behavior in Android for all of these scenarios differ. – CommonsWare Jun 16 '15 at 15:46
  • 2
    That is different, that is built in Android functionality. Those downloads can be managed and terminated by the user. To my knowledge, there doesn't exist a version for uploading. That is probably because uploads usually require authentication of some kind, and posting that kind of information into a publicly accessible database would be dangerous. My first response was aimed at your last paragraph. – Knossos Jun 16 '15 at 15:48
  • 1
    Ok. But at the end the process of the app is killed, or? Maybe forget the about "the app gets killed" and focus on my problem "upload (big) files in the background independent from the app state". Is that legit? – Sven-Michael Stübe Jun 16 '15 at 15:51

0 Answers0