best method for background uploader in Android
Posted
by
Dr.Dredel
on Stack Overflow
See other posts from Stack Overflow
or by Dr.Dredel
Published on 2011-01-14T19:37:55Z
Indexed on
2011/01/15
13:53 UTC
Read the original article
Hit count: 197
android
Problem:
I want to write a process that will allow a user to take photos with the device and for those photos to then be uploaded to some listener in the cloud. The user should not have to do anything to initiate the upload, a background listener would just watch the folder and as long as it finds files in it it would upload them and delete them.
Two problems: 1) how to keep the program running in the background even after the user is no longer taking pictures (and if they reboot the device for it to wake up and finish the uploads, if any remain)
2) assuming the connection is spotty (as it always is) how to verify that a given image has completed its upload, and if not, to resubmit it.
I don't need any code examples, I just would like opinions on the best strategy to get this implemented.
I was going to use Apache commons and just do an upload to a PHP, but am not sure what sort of error checking exists to take into account a connection drop mid file.
TIA.
© Stack Overflow or respective owner