Android emulator cannot resolve internet address

When I run this code from Java project it works fine.

InetAddress ia=null; try { ia = InetAddress.getByName(""); } catch (UnknownHostException e) { e.printStackTrace(); } System.out.println(ia.getHostAddress());

When i try the same code from emulator (already tried few versions) I'm getting UnknownHostException. Internet works fine on emulator and I'm able to connect to IP address like "93.86.230.251" but never to hostname "something.org".

Please help

1 Answer

load a web page in the browser of your emulator if you can't load any page probably you´ll need a proxy configuration

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like