{"id":556,"date":"2017-06-04T15:41:21","date_gmt":"2017-06-04T06:41:21","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=556"},"modified":"2017-06-04T15:41:21","modified_gmt":"2017-06-04T06:41:21","slug":"android%e3%83%96%e3%83%ad%e3%83%bc%e3%83%89%e3%82%ad%e3%83%a3%e3%82%b9%e3%83%88%e3%82%a2%e3%83%89%e3%83%ac%e3%82%b9%e5%8f%96%e5%be%97","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/556","title":{"rendered":"Android\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u30a2\u30c9\u30ec\u30b9\u53d6\u5f97"},"content":{"rendered":"\n<pre class=\"lang:java decode:true \" >InetAddress getBroadcastAddress() throws IOException {\r\n    WifiManager wifi = (WifiManager)this.context.getSystemService(Context.WIFI_SERVICE);\r\n    DhcpInfo dhcp = wifi.getDhcpInfo();\r\n\r\n    \/\/ handle null somehow\r\n\r\n    int broadcast = (dhcp.ipAddress &amp; dhcp.netmask) | ~dhcp.netmask;\r\n    byte[] quads = new byte[4];\r\n    for (int k = 0; k &lt; 4; k++)\r\n        quads[k] = (byte) ((broadcast &gt;&gt; k * 8) &amp; 0xFF);\r\n    return InetAddress.getByAddress(quads);\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>InetAddress getBroadcastAddress() throws IOException { WifiManager wifi = (WifiManager)this.context.getSystemS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-memo","tag-android"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":1,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/556\/revisions\/557"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}