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. Using internal Android string resources

I've noticed that there are *a lot* of string already translated in the 
Android platform that would save me a heck of a lot of time and effort if I 
could use them.

The problem is that they appear to be in the private core. Or at least the R 
class is not included it he public API.

Does anyone know if they are accessible in our program code?

- Brill Pappin


2. Writing Device Drivers for Andriod ..using External modules.

Hi All,

     I want to write a External module for one of the device driver.
     so that I can load and unload when ever  I want.

    Environment I am using AndriodX86.

     I have some basic questions here.. if some one can address them,
it would be of great help.

     1. Does module written in ubantux86 system works on the
andriodx86 with out any changes ?

     2. I compiled my module into object file and generated .ko file
in ubantu by using ubantu installed C compiler, does the ubantu
generated .ko file works on andriodx86.
    3. if it is not compatable then which C compiler should i use?

Thanking you,


3. garabage in minicom after booting beagleboard xm

4. help me.,.,.

5. credits management in a App

6. Android Screen in frames just as html page

7. RunTime error after changing app package name