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.
Here I listed some ways on how to enable emulator to access internet.
#1: Setup Google Account
Just setup your Google Account on that emulator.
By default, you should be able to toggle the Internet access to your emulator with F8 (on Windows) and Fn + F8 (on Mac OS X) – I think F8 also works for Linux, but I’m not 100% sure.
With this shortcut, you get the ACTION_BACKGROUND_DATA_SETTING_CHANGED dispatched.
#3: DNS setting
If your using Eclipse: 3.6 (Windows), Go to Window > Preference > Android > Launch
Default emulator options:
-dns-server 22.214.171.124,126.96.36.199. Or you can try your DNS.
#4: Proxy setting
- Right click on the Project in Eclipse
- Select Run As -> Run Configurations …
- Select Android Application and then select “target” tab
- Looking for “Additional Emulator Command Line Options” and put this command line to text box
-http-proxy http://< username >:< password >@< hostname >:< port >