Sometime even after setting all it may not work. I have tried all the methods like
Nothing worked. Then I did the following which worked instantly.
Goto eclipse Run --> run configurations. Under Android Applications you can see you application. Now, on the right hand side click on the Target tab. Under the 'Additional Emulator Command line options' add the following.
-dns-server <DNS servers from your local machine upto three> -http-proxy http://<your proxy>:<your proxy port>
The catch here is that the DNS Server setting should be from your local system. Goto cmd prompt and run ipconfig to check your DNS servers. Same with the proxy server and port. Whatever works for your browser should be put in here.