I implemented a queue service in Android that will change states based on queue events and Wi-Fi / data.
I am queuing transactions to a remote URL. If the device has a data or Wi-Fi connection, it will iterate over the queue and send the data to the URL until the queue is empty or a disconnect event occurs.
I can enter my application, turn on airplane mode, generate data, turn off airplane mode and conduct a transaction. No slowdown, even with thousands of transactions. (I tried to make it out a little)
Enter: low reception! My application slows down a lot when 3G reception is low. (Yes, the entire download comes from the ui thread.) It seems that the reason for this slowdown is that the message on the server takes a very long time, and sometimes just fails.
My question is, how can I solve this? Check the signal quality? Poll known address? How do other solutions, such as Gmail, solve this problem? This should be a common scenario!
Jonathan
source share