When getting internet data restart emulator periodically

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

When getting internet data restart emulator periodically

Postby brendan » Thu Dec 30, 2010 9:31 pm

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.
My Personal Website -> http://www.brendan-weinstein.com
The Mecca of Laughs -> http://www.stanfordflipside.com
brendan
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Dec 16, 2010 11:17 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 10 guests