loopj/android-async-http — Issue #35: Assist with marginal coverage
Author: StarTraX
Created: 2012-02-05 22:16:12+00:00
State: open

Firstly, although I have lots of years of Unix, 4GL, and recently .NET, javascript and php skills, I'm a novice java/android coder. I'm looking for some help with my android app that's running in aerobatic aircraft operating on the fringe of mobile coverage, sending packets of GPS position data to my server from where, in a separate ground-based web app I'm displaying the flight in near real-time.
I quickly found that synchronous http caused the app to hang, so was delighted to find your AsyncHttpClient which goes a long way to resolving my problems. I'm monitoring the onSuccsees response before sending the next packet, stopping the send when the un-responded queue of packets gets to an arbitrary count of three.

When the phone in the aircraft regains a signal signal after it has gone out of range for longish periods of 30 seconds to a few minutes, I find that it sometimes transmits some or all of the queued packets. Sometimes it transmits none. With different management of the queue, sending "blind" without monitoring the onSuccess, I found that occasionally the app hangs completely. I assume that's due to some overflow of backed-up requests.
I don't understand how AsyncHttpClient handles the out of range situation, and my java skills are not really up to examining the source code.
Testing is a challenge as I am not able to observe the app when it's running, it being strapped out of sight in the aircraft and me being on the ground!
Would it be possible, please, for you to provide a high level schematic of how queues of un-processed requests are handled, so I can incorporate appropriate logic in my app?