The emulator is a separate machine and thinks that 127.0.0.1 refers to itself, not the machine the emulator is hosted on.
On Tue, Sep 15, 2009 at 1:38 PM, WoodManEXP <[email protected]> wrote: > > HttpHostConnectException: Connection to http://127.0.0.1 refused > > 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 to http://127.0.0.1 refused” > > > Entering the same URL, to http://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? > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

