Android 2.1 Emulator Without Internet Connection

2019-09-05 06:58发布

I have no Internet access in my Android Emulator.

The app I am developing needs Internet connection, but the Android Emulator have no internet connection. I also tried to use the native browser of the emulator, but it also does not work. When I export my app to a real android, it works just fine.

I already tried to press F8 to turn on and off the "3G connection" in the emulator.

I already turned off the Windows Firewall, but it didn't work.

Data: Windows 7 x64 Eclipse Plugin for Android Android version 2.1

3条回答
叼着烟拽天下
2楼-- · 2019-09-05 07:21

I had to set manually the DNS Server of my emulator.

To do that:

Within Eclipse I went to Run Configurations -> Target and added "-dns-server X.X.X.X" and everything worked fine afterwards. (obviously X.X.X.X was the IP address for my DNS server).

so i put this line: -debug-slirp -dns-server 192.168.178.1

查看更多
▲ chillily
3楼-- · 2019-09-05 07:34

Try recreating the emulator instance. Sometimes the instances get corrupted and you get weird behavior like the one described by you above. The internet connection should work without any interaction in a fresh emulator instance.

If you are behind a firewall or you are using a proxy then things can get a bit more complicated but there are workarounds for those situations also.

查看更多
萌系小妹纸
4楼-- · 2019-09-05 07:37

Don't keep re-creating new instances of the same emulator. I had this problem before and created a brand new emulator (same settings as the other one), and it worked fine for some reason.

查看更多
登录 后发表回答