3

I am trying to activate internet on android emulator. I have tried all different methods but still not find way..... My office PC which I use has proxy setting which are as follow :

 IP : 10.1.2.23
 Password : admin123

I tried running my emulator using command line option as follow :

Attempt : 1

emulator.exe -avd MyAVD -no-audio -http-proxy http://puser1:admin123@10.1.2.23:8080

Attempt : 2 (Below DNS are configured in my PC)

emulator.exe -avd MyAVD -no-audio -http-proxy http://puser1:admin123@10.1.2.23:8080 -dns-server 10.1.14.25,10.1.14.26

Attempt : 3

I tried to resolved by follwing reference but not able to solve it.

http://www.gitshah.com/2011/02/android-fixing-no-internet-connection.html

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

How to connect android emulator to the internet

How to setup Android emulator proxy settings?

Community
  • 1
  • 1
Developer Desk
  • 2,294
  • 8
  • 36
  • 77

2 Answers2

4

I solved this issue myself. Posting what I have tried so that it helps others

I have proxy setting as below :

IP : 10.1.2.23
Password : admin123

1) Run :

If you are starting android emulator from command line then try below command :

emulator.exe -avd MyAVD -no-audio -http-proxy http://puser1:admin123@10.1.2.23:8080 -dns-server 8.8.8.8,8.8.4.4

If you are starting android emulator from eclipse then make sure you have added below setting :

Window --> Preferences --> Android --> Launch --> Default Emumator Options : -dns-server 8.8.8.8,8.8.4.4

Run --> Run Configurations --> Android Application Name --> Under Target Tab Select Emumator --> Additional Emumator Command Line Options : -no-audio -http-proxy http://puser1:admin123@10.1.2.23:8080

2) Add Proxy Setting in android Emumator :

Setting --> Wireless networks --> Celluler Network / Mobile Network --> Access Points Names --> Edit Default One (In my case --> T-Mobile US,epc.tmobile.com) and add proxy setting with username and password. 

Don't forget to save setting.

Do not change or enter any others settings.

3) If Still Internet is not active then try to turn on / off mobile internet 2 to 3 times.

4) If still Internet is not active then try to turn on / off Airplane Mode 2 / 3 times keeping mobile internet on.

Developer Desk
  • 2,294
  • 8
  • 36
  • 77
  • I had '@' in my password so it is make mistake when I use emulator.exe -avd MyAVD -no-audio -http-proxy http://puser1:admin@123@10.1.2.23:8080 like this so How can I over come it? – Renjith Krishnan Mar 09 '17 at 04:06
0

Go to -> mobile network settings -> Access Point Names here you will find T-mobile US (APN) by default or add any new one, for now just click and add following fields:

Username: android
password: android
APN Protocol: ipv4

username and password can be anything I guess but I set it to android for simplicity.

this setup worked for me.

thanks

vikas kumar
  • 10,447
  • 2
  • 46
  • 52