Couldn't open socket error from URLConnection getInputStream ??

by ole! » Thu, 22 May 2008 05:20:20 GMT

Sponsored Links
 I get "Couldn't open socket" error from my Android app after it runs
for a few hours.

A thread is in a while loop doing URL.openConnection.... after many of
these (about 1000), I get the error. Has anybody encountered this and/
or have a fix for it? Any help would be appreciated.

The snippet of code in the while loop body is:
                        URL myURL = new URL(urlString);
                        URLConnection ucon = myURL.openConnection();
                        inStream = ucon.getInputStream();
                        input = new Scanner(inStream);

log file below:

D/dalvikvm( 1224): Exception Ljava/lang/RuntimeException; from not caught locally
W/dalvikvm( 1224): threadid=17: thread exiting with uncaught exception
E/AndroidRuntime( 1224): Uncaught handler: thread httpThread exiting
due to uncaught exception
E/AndroidRuntime( 1224): java.lang.RuntimeException: Couldn't open
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at<init>(
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at
E/AndroidRuntime( 1224):        at


Other Threads

1. Does StreetView work in Android?

Hi gang:

StreetView just released for Canada this week. I am interested in
using it to augment one of my apps set in downtown Montreal.

Now the mapview method called something like setStreetView(true) does
highlight the streets where streetview imagery is available, but that
seems to be all it does.

I don't believe that phones run Flash which seems to be a necessity
for using Streetview. Am I missing something? That is, is there any
way I can zoom into a Streetview image in one of my location-based
Android apps just by providing the lat/long?

If this isn't already available. I'm sure it is coming soon

2. Should I use Canvas or SurfaceView for a chess game?

SurfaceView can be either run with a Canvas front-end, or an OpenGL frontend
(which I think was your question).

For a chess game, you're most likely going to be just fine with Canvas.  You
won't really need OpenGL until you have 50-100 sprites on the screen moving
quite quickly :)

- Dan


3. Need to place Childe view starting from left side

4. Archos WVGA/720p Tablet and Google Android Apps

5. A competitor to Motorola CLIQ

6. hape android

7. How to find out how packaged the ROM?