开发者

Access .net web service in localhost from android device

开发者 https://www.devze.com 2023-03-17 02:23 出处:网络
I have problem accessing my .net web service in my laptop localhost from Android device. I can access it perfectly from Android Emulator using address 10.0.2.2:49654.

I have problem accessing my .net web service in my laptop localhost from Android device.

I can access it perfectly from Android Emulator using address 10.0.2.2:49654.

Then, I c开发者_Python百科reated Access Point using connectify from my laptop to share its local area connection and I was able to connect the Android device to the Access Point via wifi.

Then, I tried to use the same address, 10.0.2.2:49654, but failed.

I used my laptop ip address, 192.168.1.100, but still failed.

I tried other option, 192.168.1.100:49654, but again, failed.

I appreciate any help given for me, thanks all!


You just might be looking at the wrong IP. Your 'local' IP is 192.168.1.xx usually, but Connectify IP is (at least for me) 192.168.2.xx

go cmd -> ipconfig and get the other IP from there. These are mine

Wireless LAN adapter Wireless Network Connection 2:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::d15d:982b:df0e:7df5%40
   IPv4 Address. . . . . . . . . . . : 192.168.2.1 - Connectify local ip
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . : local.lan
   Link-local IPv6 Address . . . . . : fe80::4962:1644:5e18:408c%38
   IPv4 Address. . . . . . . . . . . : 192.168.1.2 - local ip -> wifi to internet
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

I hope this helps


see the android docs http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking


try to modify the hosts file in your device with Hosts Editor


1) Try to open the port from your router and use 192.168.1.100

if failed

2) Try to open the port from your router and use your public IP Address

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号