A port of an iOS game with web views wasn’t working fully on Android devices. I spent a full day debugging this, looking at everything from cross-client / domain issues, bad caching, to other client-related code differences – it’a all webkit right, it shouldn’t be too hard? Something one quickly learns is that web development in Android is 10x harder / slower than iOS since it takes more effort to close apps outright and, most importantly, there isn’t a direct way to set a web proxy (so no HTTP debugging outside of the 1992-era approach of tailing logs on your server.)

Google is aware of this lack of proxy issue as apparent by the bug logged back in 2008 with a few hundred angry comments (and more being added each week). In the meantime Android is quickly becoming the new IE for me.

Anyways, the problem ended up being resolved by commenting out these two lower level ajax settings. iOS works without them, too.

/* self.xhr.setRequestHeader("Content-length", params.length); */
 /* self.xhr.setRequestHeader("Connection", "close"); */