0

我想在 android 设备上测试我的应用程序,我有一个本地 web 服务 (ASP.net),它托管在我的本地笔记本电脑中,当我插入我的设备时,应用程序可以在其中运行,但它无法从我的本地 web 服务接收数据,如何像在模拟器中一样将数据发送到设备 PS:该应用程序在模拟器中正常工作。谢谢你

4

1 回答 1

2

The emulator uses your laptop's network interfaces, hence it can access webservice directly. Your device needs to connect to your laptop via its own connectivity options (celluar network, WiFi, possibly bluetooth).

I have a few ideas how to get there:

  • If you have got a WiFi router and both your laptop and phone connect to it - that's pretty straightforward: just expose webservice to address that can be seen within network and use it on your phone.
  • If you've got an external IP - just use that address when phone is connected to network.
  • Set up a WiFi access point on your laptop and connect your device with it

    Check these URLs how to set up a hosted network (hotspot) on Windows 7:

    Hosted network documentation in MSDN

    Hosted network tutorial

  • You might try Bluetooth and PAN.
于 2012-08-09T09:01:52.680 回答