zhuoyanli/TouchDB-Android — pull request #1 by cesine (2013-07-29 19:17:46+00:00)
Title:  For TS-12 and LT-970 and maybe LT-985 i added exponential backoff to th...

...e change tracker so that if it doesnt have connection to the remote backup database, it polls smarter and no longer makes the app unresponsive (particularly felt on the nexus 10, but possibly also felt on the samsung note)

How it works:
* the replicator is turned on,
* if the replicator works, the currentbackoff is reset to the default
* if the replication doesnt work (get an IO exception when reading the HTTP response) then the runner waits twice as long before trying to contact the server again (until 5 minutes, at which time it turns it self off).
* if the user gets connection back with in 5 minutes, the backoff is reset to 0 and the change tracker continues as usual
* if the user doesnt get connection back in 5 minutes, but then creates or saves a new document, touchdb turns back on the replicator so it will try to contact the server again until it reaches the 5min max.

* this seems like an effective solution to the problem, touchdb is still not using wifi connetivity to turn it self on, its doing something else, but at least this seems to make it do less background network requests when the user is offline

let me know what you think...