1

I have a local server running with wamp. I would like to open a web browser in the Android emulator to access a local website. I tried localhost, 127.0.0.1 (they yield "not found") and my ip address (yields: "you don't have permission").

How can I do that?

Thank you

Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
Flavian Hautbois
  • 2,940
  • 6
  • 28
  • 45
  • Try these similar sounding threads: http://stackoverflow.com/questions/4905315/error-connection-refused/4905367#4905367 http://stackoverflow.com/questions/4721281/im-unable-to-call-a-servlet-from-my-android-application/4721383#4721383 http://stackoverflow.com/questions/8844576/connect-to-my-wamp-server-with-the-android-emulator-with-local-web-address – Soham Mar 08 '12 at 18:26

3 Answers3

1

You should use 10.0.2.2 instead of 127.0.0.1 . 127.0.0.1 is the localhost address of Android os . When you establish a web server in your android emulator you should use 127.0.0.1 , but when you want to access to localhost in your computer you should use 10.0.2.2 .

ofskyMohsen
  • 1,121
  • 1
  • 12
  • 26
1

Using your ip address is correct. If it gives you "you don't have permission" then you should configure WAMP to accept remote connections (i.e. connections other than localhost)

YuviDroid
  • 1,546
  • 11
  • 12
  • Could you be more specific on where I can change this permission? – Flavian Hautbois Mar 08 '12 at 18:25
  • 2
    If I'm not mistaken, when you right click the wamp icon you have an option called "Put it online". (I don't have access to wamp on this pc so I'm not sure if it's there or in some hidden menu). – YuviDroid Mar 08 '12 at 18:32
  • Maybe here you can find some more info: http://stackoverflow.com/questions/4003644/how-can-i-put-my-wamp-online-for-someone-to-access – YuviDroid Mar 08 '12 at 18:34
  • Ok the "Put it online" button is right at the bottom when you left-click the wamp icon, that's why I didn't see it. – Flavian Hautbois Mar 08 '12 at 18:43
0

You could use a service like http://localhost.run/ or https://ngrok.com/ to temporarily put localhost on the internet and access the site from the android emulator.

tommyvn
  • 713
  • 5
  • 12