Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet access from android emulator slow or unstable

I have enabled permissions for internet access, there are no proxies to deal with. I find that though most of the time i can access the net from the browser in the emulator or from my application the access is very slow though I have high speed broadband connection.

My question is this - is there a setting in the emulator that is meant to simulate the speed of the internet connection and by default set to a lower value? if yes how do i change it. if not why is the connection slow in the emulator.

Another problem is that this connection breaks often and I get page not found exception from both my application and the browser in the emulator. this becomes ok once I restart he emulator.

Thanks for any help.

like image 499
scar Avatar asked Apr 27 '12 10:04

scar


People also ask

Why is Android Emulator running slow?

The Android Emulator is very slow. The main reason is because it is emulating the ARM CPU & GPU, unlike the iOS Simulator, which runs x86 code instead of the ARM code that runs on the actual hardware.

Why is internet not working on emulator?

The problem seems to be that the emulator can't find the DNS my computer is currently using, and the temporary workaround is to start the emulator from the command line and specify the DNS server. Whatever problem occurred back then must have reappeared in the latest version of Android Studio.

Does emulator slow computer?

Running multiple programs at once on your PC can cause performance issues. While running Android emulator for playing heavy games, you should always avoid using up the RAM of your computer. This will cause severe lag to your PC. You can close unwanted programs by going to "Task Manager".


2 Answers

There is a setting to delay & throttle network I/O on the emulator but it defaults to full speed.

The problem is probably somewhere else since there is AFAIK no GUI / keyboard shortcut to trigger that delay and you would need to start the emulator from command line & specify these options.

like image 170
zapl Avatar answered Oct 17 '22 23:10

zapl


I ended up trying this and seems to make a difference or maybe it is my imagination because the documentation says that the default is full speed and no latency. But this does allow one to change the speed and also various other settings without having to restart the emulator.

  1. Launch emulator and wait for it to load completely
  2. From command line telnet to the emulator at the appropriate port for the AVD ex. telnet localhost 5554
  3. This will bring you to the AVD console. here use the command network speed full.

More info - http://developer.android.com/guide/developing/devices/emulator.html

This can be done from commandline launch of emulator, but If you launch the emulator from avd manager and wish to change some settings while the emulator is running this may be useful

like image 3
scar Avatar answered Oct 17 '22 21:10

scar