for proxy with username and password use this format: -http-proxy http://username:password@host:port
–
almaz_from_kazanDec 1 '14 at 12:30

error emulator is not recognized as a command in my case..do i need to add anything in PATH variable??. I am using Android Studio 1.0.1 and having proxy in my office system.
–
Anil BhaskarFeb 13 at 10:58

nothin of that worked
i am using eclipse on windows 64-bit:
do the folllowing steps... it worked for me:
Window -> Preferences -> Android -> Launch -> Default Emulator Options
-http-proxy="http://10.1.8.30:8080"

Sometime even after setting all it may not work. I have tried all the methods like

Setting the proxy in Emulator APN

Setting it thru eclipse preferences --> Android --> Launch

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.

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.

On the first field(HTTP Proxy Server) set only the IP address where is your proxy (XXX.XXX.XXX.XXX)
on the second field set the port of your proxy (example: 8080)

Then, click Close on the window and start the emulator

---- Added ...
Then the alex steps works on my case:

Click on Menu
Click on Settings
Click on Wireless & Networks
Go to Mobile Networks
Go to Access Point Names
Here you will Telkila Internet (or other name), click on it.
In the Edit access point section, input the "proxy" and "port"

In case if you are under proxy environment and internet is not running in your emulator, then please don't change any setting in emulator. Go to your eclipse project, right click , click on "Run as" then click on "Run Configuration".
In pop up window choose "Target" and scroll down a little,
you will find "Additional Emulator Command Line Options"
Enter your proxy setting here in "Additional Emulator Command Line Options" as i entered