I'm building an app that gets gps location data and sends it to a web server. When I get the location data, I want to put it into a queue and then have another process pull the location data off the queue and send it to the website. I want the gps location process to be decoupled from the http sending process for those times that the cell phone is out of coverage area.
I'm thinking of 2 different ways of doing this:
1) have a worker thread that is notifed when locations are placed in the queue and then have the worker thread try to send locations to web server. if it fails, then leave location data in queue.
2) use a timer and timertask for the http sender and have it poll the queue to see if there is location data there.
which method do you think is best? is there a third way that might be better?