Topic
4 replies Latest Post - ‏2011-11-03T17:03:17Z by rhralston
rhralston
rhralston
3 Posts
ACCEPTED ANSWER

Pinned topic If you are running the server locally and using the android emulator

‏2011-10-27T18:42:47Z |
I am running the server locally on my machine and running the mysurance application in the android emulator. My server is using port 9080 and I can connect using http://localhost:9080/mysurance in firefox.

In the emulator, localhost does not work, but if I use the special address 10.0.2.2 for the host part I can connect from the web browser in the Android emulator. URL http://10.0.2.2:9080/mysurance

However if I use that same URL in the mysurance app for the server address I get a message saying "host not reachable".
Updated on 2011-11-03T17:03:17Z at 2011-11-03T17:03:17Z by rhralston
  • bcurtis
    bcurtis
    1 Post
    ACCEPTED ANSWER

    Re: If you are running the server locally and using the android emulator

    ‏2011-10-31T20:36:38Z  in response to rhralston
    When running the Android emulator, localhost refers to the emulator, not the machine the emulator is running on. To connect to a server running on your machine, you need to use the IP address for your machine. The emulator is also hardcoded to reference the host machine via 10.0.2.2.
  • rhralston
    rhralston
    3 Posts
    ACCEPTED ANSWER

    Re: If you are running the server locally and using the android emulator

    ‏2011-11-02T13:57:32Z  in response to rhralston
    > {quote:title=rhralston wrote:}{quote}

    > However if I use that same URL in the mysurance app for the server address I get a message saying "host not reachable".

    Yep, got it working from a web browser on my local machine. I just cannot ge the mysurance app to connect from with the Android emulator using the 10.0.2.2 address
    • SystemAdmin
      SystemAdmin
      59 Posts
      ACCEPTED ANSWER

      Re: If you are running the server locally and using the android emulator

      ‏2011-11-03T04:13:12Z  in response to rhralston
      Not much to add. I am not including "http://" on the front of the url inside the Mysurance app. Something about that "Server:" prompt made me stop reading instructions and stop typing at the end of the IP address so I got host not reachable errors until I added \mysurance to the end of the URL.

      It also works for me with the real IP address of the wireless adapter in my laptop (192.168.2.5:9080/mysurance on the home network).

      Attaching a pic, in hopes that it will trigger something...
      • rhralston
        rhralston
        3 Posts
        ACCEPTED ANSWER

        Re: If you are running the server locally and using the android emulator

        ‏2011-11-03T17:03:17Z  in response to SystemAdmin
        That was it. I took out the leading "http://" and it works. Thanks!