如何将我的Android模拟器连接到互联网,例如使用浏览器?我已经找到了很多关于如何通过代理连接的建议,但这里不是这样,我的机器(Windows 7)是直接连接到路由器的。


当前回答

我在Web浏览器中没有网络连接,安装Android SDK (Replicant开源版本)后使用WLAN,与禁用LAN卡或DNS服务器不使用DHCP无关。我的问题是:设置->无线和网络->移动网络->“数据启用”没有被选中。这是所有。

其他回答

在eclipse中转到DDMS

在DDMS下选择模拟器控制,其中包含电话状态 在电话状态包含数据——>选择Home,这将启用您的互联网连接,如果您想禁用模拟器的互联网连接,那么——>选择None

(注意:只有当运行eclipse的PC/笔记本电脑有活跃的internet连接时,才会启用internet连接。)

我有这个问题,由于网络变化后,我打开模拟器。如果您在启动模拟器后更改了WiFi,则只需重新启动模拟器即可获得互联网访问

在Android模拟器中,打开飞机模式,然后再关闭,对我来说很管用。

在尝试了以上所有的解决方案后,我发现在mac os x上:

您必须在系统首选项>> network >> gear图标中检查网络设备的顺序 您必须在/etc/resolv.conf中检查DNS服务器的顺序

然后重新启动你的android模拟器,它应该工作。

I have Mac OS X 10.7.2, Eclipse Helios Service Release 2. I also work via Proxy and my IP settings are via DHCP. I solved this issue firstly using this article http://www.gitshah.com/2011/02/android-fixing-no-internet-connection.html, then I removed Emulator settings and just go to Run->Run Configurations->Target->Additional Emulator Command Line Options and type there -http-proxy xxx.xx.111.1:3128 . Also I would like to say that when I typed also a DNS like this: -dns-server xxx.xx.111.1 -http-proxy xxx.xx.111.1:3128 it did not work, but when I removed DNS it worked. Also I would like to note, that Additional Emulator Command Line Options are not visible without scrolling to the bottom of that window. I also want to note, that when you change emulator options, all apps will work. But If you write Additional Emulator Command Line Options, you need to write them every time for every app target in Run Configurations.