views:

11403

answers:

17

hi folks,

basic question but i haven't been able to figure it out:

how to I connect my android emulator to the internet, e.g. to use the browser? I've found lots of advice on what do to when your connected through a proxy, but that's not the case here, my machine (win7) is directly connected to the router...

thanks for your help,

martin

+6  A: 

It just support visit Internet same as your machine, so, just open the browser in your emulator, and visit any web site you like.

Cytown
I agree. If your computer is connected to the internet, you don't have to do anything special to connect your emulator to the network. To paraphrase, you will have to adjust the settings only if you are sitting behind a proxy(or if working with earlier versions of emulator, in case of DNS problems). Just type a URL into the browser and it should work.
Samuh
Try restarting the emulator?
James
A: 

Actually, I have similar issues. I installed SDK(1.5/1.6/2.1) on two machines. I found the internet connections is far beyond our direct sense. It should be working without any configuration in direct connect mode (like router). However, my installation result is listed as following:

ATOM / Windows XP AVD 1.5: works AVD 1.6: not available, console reports "NO DNS found" AVD 2.1: not available, console reports "NO DNS found"

DELL D520 / Windows XP AVD 1.5: works AVD 1.6: used to work, failed without any prompt, however the 3G icon in status bar shows forbidden now. AVD 2.1: works.

I checked DNS setup by "ipconfig /all", but emulator ignores my DNS setup as "unknown". The command I typed is: emulator -avd and16_map_sd -dns-server 192.168.1.1 (this address is my router's DNS address).

I have recreate all the AVDs, it doesn't help.

Any suggestions?

allankliu
A: 

I had similar problem. I have installed an application that required INTERNET permission (and used it), and all of sudden, worked.

Guys, check also whether if you are not connected through a VPN somewhere, because it also can disturb the Internet connection.

blacharnia

blacharnia
A: 

Hi,

I'm not sure if this is your issue, but here's how I fixed mine.

I always had this "No DNS servers found" error when starting the emulator and did a lot of research on google to no avail. Anyway, I found a post somewhere (can't find it anymore) that was saying that the number of NICs, number of DNS entries could affect the emulator. Also, knowing that the emulator uses a Windows API function (GetNetworkParams()) to resolve DNS entries, I couldn't rely on the %WINDOWS%\System32\Hosts file.

However, I did went in the NICs properties (on Windows 7) to find that I was specifying a static IP, but no DNS entries. So, I got the DNS entries from my router and plugged them in the NICs property. I restarted the emulator and it is now using the correct DNS entries!

I can use my internet connection with the emulator now, and it works wonders!

Hope it helps!

Fred
+1  A: 

After reading this I decided to look at my "NICs". I put this in quotes because like many I am running virtual nics for devices like Hamachi and Virtual Box. After I disabled Hamachi I am able to use the internet. My guess is that the emulator picks the first available nic regardless of whether it is virtual. Now to find out if I can rearrange my nic order without tearing my box down.

Windows 7 32bit

Wayne Wenthin
+5  A: 

I think some of the answers may have addressed this, however obliquely, but here's what worked for me. Assuming your problem is occurring when you're on a wireless network and you have a LAN card installed, the issue is that the emulator tries to obtain its DNS settings from that LAN card. Not a problem when you're connected via that LAN, but utterly useless if you're on a wireless connection. I noticed this when I was on my laptop. So, how to fix? Simple: Disable your LAN card. Really. Just go to your Network connections, find your LAN card, right click it and choose disable. Now try your emulator. If you're like me, it suddenly ... works! So, Google, if you're listening, can you please at least check to see what connection I'm actually using, if at all possible? Thanks!

Vaughn
thanks very much
emirc
A: 

i want to connect my application to internet in ANDROID VIRTUAL DEVICE.So any procedure is there to connect android application to internet in background.For example,istant messaging.How to connect application to gtalk server?

vivek satasia
+3  A: 

Have you tried starting the emulator with administrative privileges? It worked for me, I'm running Windows 7 64bit)

Andreas H.R. Nilsson
A: 

that worked vaughn thanks a lot

+2  A: 

If you're on MacOS with 2.2 and you keep seeing an error about data connectivity, try the above, it works.

  • I removed all the network interfaces via Sys Prefs except LAN
  • Even thought my DNS is provided by DHCP, I retyped DNS with just one server
  • I used -http-proxy on the command line to specify one

It starts working at the office. Phew.

Song
+1  A: 

yes--in win 7 start the emulator with administrator privs and all will be well--or at least you'll get the wireless going in android.

mike kaufmann
A: 

I had a similar problem on Win7 64 bit. Tried disabling my hamachi and virtualbox adapters and didn't work. Tried starting avd as admin and didn't work. In the end I disabled the teredo tunneling adapter using the info on this site and it worked: http://www.mydigitallife.info/2007/09/09/how-to-disable-tcpipv6-teredo-tunneling-in-vista/

Martin Bayly
After it started working it stopped again. ipconfig showed a new microsoft adapter had showed up called isatap. So I went into Device Manager > Network Adapters > Show Hidden devices, and disabled the 3 isatap adapters and then it started working again.
Martin Bayly
A: 

Just let your emulator load fully. Have patience and don't press those keys inside emulator. Also wipe user data if needed.

Hitesh Agarwal
A: 
  1. righ click on the Project in Eclipse
  2. select Run As -> Run Configurations ...
  3. select Android Application and then select "target" tab
  4. Looking for "Additional Emulator Command Line Options" and put this command line to text box

    -http-proxy http://&lt; username >:< password >@< hostname >:< port >

Fuangwith S.
A: 

I found that starting the emulator with 'wipe user data' checked cleared this problem up for me after I rebuilt my dev machine from Vista x64 to Win7 x64.

A: 

My platform: Mac OS 10.6.4 Eclipse: 3.6

I had a similar problem where my map app background was grey (no tiles) and the browser was unable to connect to the internet.

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).

Jeremy Kie
I added "-dns-server X.X.X.X" to the 'Additional Emulator Command Line Options" field.
Jeremy Kie