Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Internet options for Android emulator?

I've been using this method to gain access to internet from my Android emulator emulator -http-proxy <<proxy-name>> -avd <<avd_name>>

It works but is that the best way to do it? It just doesn't feel right that I need to open the emulator from command line and can't just do it from Eclipse or something.

Can't seem to find an internet option on the "AVD Manager" either.

like image 812
teepusink Avatar asked Mar 13 '10 05:03

teepusink


People also ask

How do I enable Internet on Android Emulator?

Go to your Android\Sdk\emulator folder and open command prompt. Type emulator -list-avds to see available emulator names. Type emulator -avd name-of-your-device -netdelay none -netspeed full -dns-server 8.8. 8.8 command and press enter.

How do I change DNS on Android Emulator?

Then run one of the available emulators with the command, “emulator -avd DEVICE_NAME”, followed by the argument “-dns-server 8.8. 8.8”. This will launch the emulator and overwrite the default DNS server address, replacing it with the address of the primary DNS server for Google DNS.

Can you use WiFi on an emulator?

The Android UI is pretty simple, if your connected to Wifi it shows in the notification bar, it can also show your cellular connectivity at the same time depending on what has happened. All you have shown is that you can use the emulator on a wifi connected host machine, which is not what this question was asking.


2 Answers

You could also try explicitly specifying DNS server settings, this worked for me.

In Eclipse:

Window>Preferences>Android>Launch

Default emulator options: -dns-server 8.8.8.8,8.8.4.4

like image 80
Mark McLaren Avatar answered Sep 25 '22 17:09

Mark McLaren


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.

Hope that helps.

like image 44
Dimitar Dimitrov Avatar answered Sep 25 '22 17:09

Dimitar Dimitrov