Android Emulator Cannot Resolve Internet Address

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

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

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.