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


当前回答

如果您在SDK管理器的工具->选项下是代理,则不要配置代理设置。 当你从命令行运行时,添加-http-proxy:

emulator.exe -avd YOUR_AVD_NAME_HERE -http-proxy PROXY:PORT

为我工作。

其他回答

您需要使用“控制面板\所有控制面板项\网络连接”与模拟器共享您的笔记本电脑Internet,并选择笔记本电脑的活动Internet源,然后右键单击然后共享选项卡。在这里勾选共享复选框,如果需要,选择模拟器网络,如果列出。

我的平台:Mac OS 10.6.4 Eclipse: 3.6

我也遇到过类似的问题,我的地图应用程序背景是灰色的(没有磁贴),浏览器无法连接到互联网。

在Eclipse中,我去运行配置->目标,并添加“-dns-server X.X.X.X”,之后一切都工作正常。(显然,X.X.X.X是我的DNS服务器的IP地址)。

确保飞行模式是关闭的。我一直试图连接互联网很长一段时间,才意识到哪里出了问题。

我在Win7 64位上遇到了类似的问题。尝试禁用我的hamachi和virtualbox适配器,但没有工作。尝试以管理员身份启动avd,但没有工作。最后,我使用这个网站上的信息禁用了teredo隧道适配器,它工作了: http://www.mydigitallife.info/2007/09/09/how-to-disable-tcpipv6-teredo-tunneling-in-vista/

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.