android:我的应用程序无法在Emulator上访问互联网



我开发了android应用程序,它在真实设备上运行良好,可以访问互联网,但当我在模拟器上运行时,它不工作(无法访问互联网)。

我可以在模拟器上访问互联网,我用互联网浏览器检查了一下(可以从模拟器的浏览器打开几个网页),但我的应用程序无法使用它。

有人能帮我为什么会出现这个问题吗?

谢谢。

嗨,即使我也面临着类似的问题。。我尝试了以下方法,效果很好

  1)close your emulator
  2)Kill the adb process
  3)start the adb
  4) restart your eclispse than run it again..

我希望它能起作用。。。。对我来说,它奏效了。。。。

做两件事:

     - Recheck your manifest file that it has internet permission or not 

    - Do this on your eclipse Run->Run config->select your app then go to Target->put -dns-server 8.8.8.8 in Additional commandline option for your emulator and run;

希望这有帮助:)欢呼:)

尝试从命令行运行它。emulator -avd Machine2.3 -no-boot-anim -dns-server 8.8.8.8

最新更新