Home  >  Q&A  >  body text

How to connect to my http://localhost web server from Android emulator

<p>How to connect to a localhost web server at <code>http://localhost</code> or <code>http://127.0.0.1</code> in the Android emulator page? < /p> </p><p>I've tried this but the emulator still accepts my request just like a Google search for localhost, or worse it says it wasn't found when my webserver is up and running page. </p>
P粉450079266P粉450079266423 days ago521

reply all(2)I'll reply

  • P粉401901266

    P粉4019012662023-08-24 14:13:32

    Use 10.0.2.2 as the default AVD and 10.0.3.2 as .

    reply
    0
  • P粉676588738

    P粉6765887382023-08-24 12:48:33

    Localhost refers to the device the code is running on, in this case the emulator.

    If you want to reference the computer running the Android emulator, use the IP address 10.0.2.2.

    You can read more information here.

    reply
    0
  • Cancelreply