简体   繁体   English

无法在Android模拟器上激活互联网......?

[英]Not able to activate internet on android emulator…?

I am trying to activate internet on android emulator. 我想在Android模拟器上激活互联网。 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 尝试: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) 尝试:2(在我的电脑下配置DNS以下)

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 尝试: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 http://www.gitshah.com/2011/02/android-fixing-no-internet-connection.html

No internet on Android emulator - why and how to fix? Android模拟器上没有互联网 - 为什么以及如何修复?

How to connect android emulator to the internet 如何将android模拟器连接到互联网

How to setup Android emulator proxy settings? 如何设置Android模拟器代理设置?

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 : 1)运行:

If you are starting android emulator from command line then try below command : 如果您从命令行启动android模拟器,请尝试以下命令:

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 : 如果你从eclipse启动android模拟器,那么请确保你已添加以下设置:

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 : 2)在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. 3)如果静止互联网未激活,则尝试打开/关闭移动互联网2至3次。

4) If still Internet is not active then try to turn on / off Airplane Mode 2 / 3 times keeping mobile internet on. 4)如果仍然没有上网,那么尝试打开/关闭飞行模式2/3次,保持移动互联网开启。

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: 转到 - > 移动网络设置 - >接入点名称此处您将找到默认的T-mobile US(APN)或添加任何新的,现在只需单击并添加以下字段:

Username: android
password: android
APN Protocol: ipv4

username and password can be anything I guess but I set it to android for simplicity. 用户名和密码可以是我猜的任何东西,但我将其设置为android以简化。

this setup worked for me. 这个设置对我有用。

thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM