Android – How to access the localhost via android mobile device

androidasp.netlocalhost

I have a asp.net development server(localhost). I want to access the localhost through my android mobile phone(Sony Ericsson XPERIA). Because I have some web service methods that I want to access. I have done it using the emulator(by giving 10.0.2.2:portNo). But I don't know how to access the localhost via the mobile device.

Your help is much appreciated.

Thank You

Update: – 14-09-2012

Guyz I really need your help on this issue…..please help me.. I have a wireless router and my laptop is connected to that, and also my laptop has a static ip given to it.
I have an android phone and it also connected to the wireless router perfectly. And my web site is hosted in IIS7 and it is assigned with a port.
What I need is to access the web services resides in the web site through my android device(using the application).
I have attempted many times giving laptop IP(static IP) and 10.0.2.2 IP also. But none works. And I am really confused now.
If you know any complete tutorials or if you did this before please post it. Your help on this is really appreciated guyz. (please ignore my English if its wrong) Thank you.

Best Answer

  • You have to change the path that you have given while accessing your Web Service.
  • Replace localhost by your own ip address.
  • You can fetch your ip address through cmd.
  • goto cmd and type ipconfig.