We've written an app for Android (and iOS), and it allows users to upload photos to our REST server. The issue we're hitting is that sometimes the users are in places with terrible cell signal and no WIFI. So, I was wondering if there was either a prebuilt solution, or a recommended path to take to defer these uploads until later if there are only lackluster network options available.
Right now on Android I'm using an AsyncTask to upload a stream representation of a captured image. The image's maximum dimension is cropped to 1280, and the other is aspect scaled, so the images aren't massive.
The user may have no signal for up to 2 hours I imagine, so it'd not need to attempt to upload every minute. Additionally, there may be multiple uploads, so some kind of queue is needed, I think.
I'm not positive what the iOS app is leveraging, but I can find out if it helps.
In iOS I used ASIHTTPRequest, but at the moment you can find other solutions (MKNetworkKit). I did an application exactly like what you are doing so what I did was:
Let's imagine the user putted 20 photos on the queue, and start the process, at the end of the day he could check again what succeed and what didn't. Of course he could re-send what failed in the first place.
The best option would be to save the photo to the SD card and put the path to it in a database. The database here acts like a queue. So whenever the user has access to internet, the app can check whether there are any entries in the database and start uploading. Once you upload the photo, you delete that record from the database.
Now, as far as the upload is concerned, I recommend doing it in a Service as opposed to an AsyncTask. This way you can use an AlarmManager to call the service at periodic intervals and check whether there is anything to upload.
I used this method in one of my applications but for documents. It works like a charm. Hope that helped.