1

I am using Emulator to test app.

Problem is Internet on emulator wont work if laptop is connected to LAN. But it works if I connected with Wifi.

I have gone through many answer of similar kind,

I tried this and this but no luck

2
  • You can look at nonanswered questions as a source of info for thinking, but not as examples to put into your code. Commented Jan 21, 2012 at 14:13
  • @Marvin i did that, @ Gangnus, i tried many things,, still same problem, even once my internet stopped working on system too ..:P... Commented Jan 21, 2012 at 14:20

2 Answers 2

0

You need android.permission.INTERNET, as it was mentioned. You need also:

ACCESS_NETWORK_STATE - to check if you can use Internet and why not

Maybe CHANGE_NETWORK_STATE

also look here

also You can start your AVD in CMD prompt like this

C:\program files\android\android-sdk-windows\tools\emulator -avd -dns-server 8.8.8.8 

This is google public DNS. The problem seems to be that the emulator can't find the DNS your computer is currently using. (cite from here)

vnshetty managed with: I edited avd with value "GPS support= yes" and restarted the emulator. now working....

more cite: You don't need to set any setting to access internet on emulator unless you are behind a proxy, in case you are behind a proxy start your emulator from command prompt with following command: C:/emulator -avd avdname -http-proxy http://your.proxy.ip:8080 - it seeems to me even more useful .

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

1 Comment

I have read about -http-proxy in other posts as well but I don't have one i.e. one with ip and port but I do have a .pac file , how can I use it instead of an ip and port.
0

Solution is to turn off wifi if using LAN and vice versa. It works, at least for me.

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.