Wow, Android almost convinced me that I had a case of Dr. Jekyll and Mr. Hyde. I wrote code that retrieved a JSON feed from an internet file using URLConnection. At first, it worked fine. Then I decided to try out HTTPGet to see if there's a speed improvement. Code doesn't work. I test the code out as a ConsoleProgram in java, code works. Tinker a bit with the code; no luck. I switch back to the exact same URLConnection code I used before; code does not work.
I spent more time that I'd like to admit trying to figure out where I had made a stupid-hard-to-find-mistake in my code. And I've been able to confirm the hypothesis I came up with last night: you just need to start a new android emulator sometimes.
I wrote this post in the hopes that others will read it and try starting a new emulator earlier than I did. But I am also wondering if someone can explain why the emulator will have trouble accessing an internet file if it's left open for a long time? Also, has anyone here written code to prevent the emulator from timing out on a request? I noticed that my loops that are made to completely read a file of unknown length occasionally time out whereas my loops that read a file of known length do not.