简体   繁体   English

无法在Android模拟器中访问Internet

[英]Cannot Access Internet in Android Emulator

this is my first time facing this kind of problem. 这是我第一次面对这种问题。

I connected to internet via LAN Cable. 我通过局域网电缆连接到互联网。 Usually, my emulator could access internet without problem, but this time. 通常,我的模拟器可以正常访问Internet,但这一次。 I can't. 我不能 I wonder what's wrong with my emulator ? 我想知道模拟器出了什么问题?

Thank you. 谢谢。

I once had my emulator loose internet connectivity (accessing the host with 10.0.2.2 was working fine). 我曾经使模拟器失去了Internet连接(使用10.2.0.2访问主机工作正常)。 The 3G Icon did not appear. 3G图标未出现。

I don't know what the problem was, but turning on and off airplane mode did the trick. 我不知道问题出在哪里,但是打开和关闭飞行模式可以解决问题。 (Press and hold the power button, and select Airplane Mode. Repeat.) (按住电源按钮,然后选择飞行模式。重复。)

As already suggested - if it is one application (your own) not having internet access please check the manifest. 正如已经建议的那样-如果它是一个(自己的)应用程序无法访问互联网,请检查清单。

If it is all applications check the device instance setup or the emulator setup (Eclipse has views for this) - maybe you have disabled internet/network/cell previously for testing purpose? 如果是所有应用程序,请检查设备实例设置或仿真器设置(Eclipse有此视图)-也许您之前出于测试目的已禁用Internet /网络/ cell?

Have you checked your AndroidManifest.xml? 您是否检查过AndroidManifest.xml?

You have to add (or check if you already have) this: 您必须添加(或检查是否已经拥有):

<uses-permission
    android:name="android.permission.INTERNET" />

This user permission allow the application to gain internet access, otherwise you wont access to internet :) 此用户权限允许应用程序访问Internet,否则您将无法访问Internet :)

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

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