No internet on Android emulator - why and how to fix?

AndroidAndroid Emulator

Android Problem Overview


I am trying to use internet with the Android emulator, but with no success. Any ideas?

Android Solutions


Solution 1 - Android

In order to use internet on emulator if you are setting behind a proxy server perform the following steps:

  1. Go to settings->Wireless & networks->mobile networks->Access Point Names.

  2. Press menu button. an option menu will appear.

  3. from the option menu select New APN.

  4. Click on Name. provide name to apn say My APN.

  5. Click on APN. Enter www.

  6. Click on Proxy. enter your proxy server IP. you can get it from internet explorers internet options menu.

  7. click on Port. enter port number in my case it was 8080. you can get it from internet explorers internet options menu.

  8. Click on User-name. provide user-name in format domain\user-name. generally it is your systems login.

  9. Click on password. provide your systems password.

  10. press menu button again. an option menu will appear.

  11. press save. try n run your browser. hope its work for you it worked for me. good luck.

Solution 2 - Android

If by "use internet", you mean you can not access the internet from an activity while testing on the emulator, make sure you have set the internet permission in your AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" /> 

If you are using the web browser, refer to Donal's post

Solution 3 - Android

If you are using eclipse try:

Window > Preferences > Android > Launch

Default emulator options: -dns-server 8.8.8.8,8.8.4.4

Solution 4 - Android

Try launching the Emulator from the command line as follows:

emulator -verbose -avd <AVD name>

This will give you detailed output and may show the error that's preventing the emulator from connecting to the Internet.

Solution 5 - Android

Check your internet settings, firewalls and such may be blocking it, I know when I was working on it in college they were blocking the port number but I've never had any trouble on my home machines

Solution 6 - Android

If you run into this problem and are working with a non-Windows/Mac OS (Ubuntu in my case), try starting the emulator by itself in Android SDK and AVD Manager then running your application.

Solution 7 - Android

The easiest way is to follow these steps:

  1. run android emulator 1.5
  2. open up the menu
  3. go to settings
  4. wireless settings(first block) and right at the bottom turn off airplane mode.

By now you would've seen on top 3g and your established connection.

Solution 8 - Android

on OSX, Little Snitch was automatically denying any connection to Eclipse (and the emulator). Allow connections in Little Snitch, you have to go into Little Snitch's rules

Solution 9 - Android

Allow the ADB to access the network by opening it on the firewall

If you are using winvista and above, go to Windows Advance Firewall under Administrative tool in Control Panel and enable it from there

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionErik SapirView Question on Stackoverflow
Solution 1 - AndroidAshwani KumarView Answer on Stackoverflow
Solution 2 - AndroidcchenesonView Answer on Stackoverflow
Solution 3 - AndroidLengomanView Answer on Stackoverflow
Solution 4 - AndroidDave WebbView Answer on Stackoverflow
Solution 5 - AndroidDonal RaffertyView Answer on Stackoverflow
Solution 6 - AndroidRyanView Answer on Stackoverflow
Solution 7 - Android123infinityView Answer on Stackoverflow
Solution 8 - AndroidCQMView Answer on Stackoverflow
Solution 9 - AndroidhzronView Answer on Stackoverflow