1. Are you ready for the Galaxy S20? Here is everything we know so far!

Router needed for Emulator?

Discussion in 'Android Apps & Games' started by GraemeLeech, Feb 22, 2011.

  1. GraemeLeech

    GraemeLeech Lurker
    Thread Starter

    I am having trouble running my Emulator on the development machine. I am using a laptop with a USB Modem. The Emulator can access the internet, but cannot connect to my Apache server on the laptop. In resaearching the problem, I read the router could be the problem, do I need a router before this works, do I have one already? This is my first app and Im not sure where to go from here, below is the code I am using to connect to the Apache server from the App:

    HttpClient httpclient = new DefaultHttpClient();
    HttpPost httpPost = new HttpPost("http://10.0.2.2:3128/YES_BUTTON.php");
    httpclient.execute(httpPost);


    Apache is listening on Prot 3128.

    I do not have a proxy setup or a frewall on the laptop.


    Any ideas?


    Much Appreciated,
    Graeme.
     

    Advertisement

  2. jae_63

    jae_63 Android Enthusiast

    Can you access this link from the Browser within the emulator?

    In principle you shouldn't need a router.

    I assume that you've already tried using 127.0.0.1 instead?
     
  3. GraemeLeech

    GraemeLeech Lurker
    Thread Starter

    Yeah, i tried using 127.0.0.1, but I read that that just refers to the localhost on the emulator,and Android uses 10.0.2.2 to refer to the localhost on the computer, I'll try connecting using the browser on the emulator, see if that works!
     
Loading...
Similar Threads - Router needed Emulator
  1. olbriar
    Replies:
    30
    Views:
    540
  2. Nonny Mouse
    Replies:
    8
    Views:
    415
  3. IzzyTizzy
    Replies:
    7
    Views:
    164
  4. DonB
    Replies:
    8
    Views:
    1,636
  5. catchingup
    Replies:
    0
    Views:
    160
  6. Cinque8
    Replies:
    2
    Views:
    258
  7. Storylife
    Replies:
    4
    Views:
    448
  8. Jia33
    Replies:
    0
    Views:
    2,733
  9. Rafael Solano
    Replies:
    0
    Views:
    304
  10. pwbiggs
    Replies:
    2
    Views:
    6,227

Share This Page

Loading...