Android java.net.UnknownHostException: Host is unresolved

前端 未结 17 1063
被撕碎了的回忆
被撕碎了的回忆 2020-12-01 08:43

This code doesn\'t work:

URL         url   = new URL( xmlPath );
InputSource input = new InputSource( url.openStream() );

all the time, res

17条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 09:34

    issue resolved

    run cd C:\Program Files\Android\android-sdk\tools

    run android list avd in cmd returns list of ur availabe avd.... in my case its Myabc_avd

    run emulator @Myabc_avd -dns-server 8.8.8.8 in cmd ...avd will show avd go to avd's browser and type www.google.com will show google page. u can now access browser using hostname like myfrstapp.com

    if all go well then u can run ur project using eclipse but make sure it is running in avd which is running from cmd.

提交回复
热议问题