bsh for android : Inet 地址 Test

beanshell : InetAddressTest.bsh

source("/sdcard/com.googlecode.bshforandroid/extras/bsh/android.bsh");
a = Android();

urlName = a.call("dialogGetInput","Inet Address Test","Input URL:").get("result");
print(urlName);
try {
   if (urlName != null){  
      String host = urlName;
      InetAddress[] addresses = InetAddress.getAllByName(host);
      for (InetAddress a : addresses)
         print(a);
   }
   else {  
      InetAddress localHostAddress = InetAddress.getLocalHost();
      print(localHostAddress);
   }
} catch (Exception e){  
   print(e);
}

参考: Core Java 2 Volume II ( 7th Edition)  v2ch3

bsh for android : Inet 地址 Test,布布扣,bubuko.com

bsh for android : Inet 地址 Test

上一篇:我看小程序系列文章:1 不一样的角度 解读微信小程序


下一篇:android查询已安装运用所需要的权限