Android DownloadManager counterpart for uploads
Asked Answered
N

0

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!?

Nakamura answered 16/6, 2015 at 15:31 Comment(7)
Terms like "app gets killed" and "app dies" are not especially precise, and so it is unclear what specific scenarios worry you.Improvisatory
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.Indoiranian
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)Seagoing
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.Indoiranian
"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.Improvisatory
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.Seagoing
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?Indoiranian

© 2022 - 2024 — McMap. All rights reserved.