I have a problem that is becoming increasingly annoying, and I'm not sure what I can do about it.
I have a website and a subdomain of what my APIs hit. The phone that I use for testing (this is another person's phone) is Epic 4G on the Sprint network. It is running Android 2.2.1.
Quite often, my Android app becomes unable to hit my API through the Sprint network on this phone. Any calls to my API return an UnknownHostException. Finding any website in a browser (for example: www.google.com) is no problem. Turning on Wi-Fi and getting into the API works fine.
After a while (this morning, about 30 minutes), it will again start connecting to the Sprint network. But now it does not work over Wi-Fi! When I turn on Wi-Fi and click on the API, I get an error org.apache.http.conn.HttpHostConnectException (connection to my API is rejected). Again, every other phone on which my application runs can easily get to the API via a network or Wi-Fi.
Here's the thing: none of the other phones running under my application have this problem. In fact, my friend has Epic 4G on the Sprint network and he never had a problem. I even called him a minute ago and asked him to use my application to attack my API while this problem was going with me and he successfully hit the API. It tells me something with the phone, but I have no idea what.
I am looking for ideas as to why this is a problem. Ultimately, how can I handle this, but I'm not sure I can do anything. It seems that some kind of connection profile is happening behind the scenes, and this is obviously very wrong. Is there any way to disable it? Is there a way to get my application to clear the API URL from this supposed cache when the connection fails?
Andrew source share