8

I am using TATA PHOTON PLUS. Android Emulator browser is unable to connect to internet. The "web page not available" message is coming. Do we need to make any settings for making it to connect to internet? Please help.

2
  • This should solve: Android Emulator wifi connected with no internet. Commented Jul 11, 2019 at 4:26
  • I used the following for this medium.com/@martin.crabtree/… . There is a button in Visual Studio (if using) to easily get to the relevant command prompt (called 'Open Android Adb Command Prompt') - then I just cd down into the /emulator directory and run the commands from the article on my chosen emulator. I also terminate all old emulator sessions first of course and make sure the emulator being chosen is full patch updated in the Android Device Manager and Android SDK manager (also buttons in Visual Studio 2022) Commented Jul 12, 2023 at 9:55

5 Answers 5

26

Goto

 ...\android-sdk-windows\tools> 

and write the following and check

emulator -avd your_avd_name -dns-server 8.8.8.8 

don't forget to close your previously running AVD, before applying these steps. Hope it works for you thanks.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi , I have tried , what you suggested but this doesn't seem to work and I am not able to access the internet from the emulator.
If you need to do this from Visual Studio, perhaps for Xamarin, have a look at stackoverflow.com/questions/41877166/…
7

Under Windows you can change the network adapter indexing so the "internet" adapter is the first.

Let's say that you use the wifi adapter to connect to internet. You have to open the PowerShell (as administrator) and execute the command:

netstat -r -n 

Among the other things you'll get the list of the network adapters, ie:

Interface List 18...f0 bf 97 04 da f1 ......Realtek PCIe GBE Family Controller 30...16 27 37 af c7 99 ......Microsoft Wi-Fi Direct Virtual Adapter 4...64 27 37 af c7 99 ......Qualcomm Atheros AR9285 Wireless Network Adapter 7...64 27 37 af c7 9a ......Bluetooth Device (Personal Area Network) 1...........................Software Loopback Interface 1 10...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter 19...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter 

Running the command

Set-NetIPInterface –InterfaceIndex "4" –InterfaceMetric "1" 

you can move to the top of the list the wifi adapter and this will solve the issue.

Run again the "netstat -r -n" command to verify it.

2 Comments

Set-NetIPInterface is only available on windows 8 and above it seems.
Or disable the ones you don't want: stackoverflow.com/a/42838403/32453 (NB there may also be a gui way to re-order them stackoverflow.com/a/9878053/32453)
0

Make sure you have defined the following permission in your AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.app.myapp" > <uses-permission android:name="android.permission.INTERNET" /> ... </manifest> 

Comments

0

Sometime even after setting all it may not work. If you are using eclipse for your android projects then you can try this. this works for further emulator browser connectivity as well.

Before that I have tried all the methods like

  1. Setting the proxy in Emulator APN
  2. 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 teh 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>

Comments

-2

No additional config steps should be needed other than the fact that your system is connected to the internet. In the past when I have faced a problem similar to what you mentioned, restarting the emulator or deleting and recreating the AVD has worked for me. I am interested in experimenting with suri's answer though..

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.