Developer Desk Developer Desk - 4 months ago 31
Android Question

Not able to activate internet on android emulator...?

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?

Answer

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.