How do you pass multiple "hostnames" in following chunk of code where we are only passing one hostname? Is it possible?
private static void run() {
String host = "www.google.com";
try {
inetAddress = InetAddress.getAllByName(host);
String all = "";
for (int i = 0; i < inetAddress.length; i++) {
all = all + String.valueOf(i) + " : " + inetAddress[i].toString() + "\n";
Log.d("IPADDR", "IP Address : " + all);
prefs.sethostIPaddress(context, all); //Setting HostIP Address in Preference File
}
}
catch (UnknownHostException e) {
e.printStackTrace();
}
}