Reputation: 509
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.
Upvotes: 8
Views: 13070
Reputation: 641
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.
Upvotes: 7
Reputation: 121
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
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>
Upvotes: 0
Reputation: 1249
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..
Upvotes: -2
Reputation: 6282
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>
Upvotes: 0
Reputation: 67286
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.
Upvotes: 26