Pop myself in the head! Thank you Terry and Jason.. Of course 127.0.0.
is the Android. I keep forgetting simple stuff like that.

And I now also see it staring me in the face in the docs under
"Emulator Networking."

Hopefully I can return the favour.

On Sep 15, 4:51 pm, Jason Proctor <[email protected]>
wrote:
> if the apache server is running on the computer that's running the
> emulator, then you need to use the 10.0.2.2 address rather than
> localhost/127.0.0.1. the latter refers to the emulator itself in this
> case. of course, if you really are running a server on the emulator,
> then you have a different problem!
>
> hth
>
>
>
>
>
> >HttpHostConnectException: Connection tohttp://127.0.0.1refused
>
> >This Android app is using (trying to use) the http libraries to post
> >and retrieve from a web server. Running the app on the emulator
> >connecting to the Apache server on the same box (localhost) it gives
> >the Connection refused message:
>
> >"HttpHostConnectException: Connection tohttp://127.0.0.1refused";
>
> >Entering the same URL, tohttp://127.0.0.1, into the browser
> >retrieves the info from the local server no problem. So the web server
> >is running and the ports are open and stuff like that.
>
> >Maybe there is a setting on Andriod needed to allow the connection? It
> >is somewhere in socket-land this is happening because the web server
> >never sees the Post (web logs show no activity related to this).
>
> >The manifest file has the INTERNET permissions in it
>
> ><uses-permission android:name="android.permission.INTERNET"></uses-
> >permission>
>
> >Does anyone know why the connection to localhost (127.0.0.1) would be
> >refused from within the Android application?
>
> --
> jason.vp.engineering.particle- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to