{"id":2616,"date":"2014-07-07T10:28:16","date_gmt":"2014-07-07T01:28:16","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=2616"},"modified":"2014-07-07T10:28:16","modified_gmt":"2014-07-07T01:28:16","slug":"%e3%82%b9%e3%83%9e%e3%83%9b%e3%81%a8beacon%ef%bc%88ibeacon%ef%bc%89-%e3%81%9d%e3%81%ae2","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/2616","title":{"rendered":"\u30b9\u30de\u30db\u3068Beacon\uff08iBeacon\uff09 \u305d\u306e2"},"content":{"rendered":"<p><a href=\"\/appnews\/archives\/2580\">\u524d\u56de<\/a>\u306e\u3064\u3065\u304d\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fAndroid\u3067\u30d3\u30fc\u30b3\u30f3\u3092\u53d7\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4ea4\u3048\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"\/appnews\/wp-content\/uploads\/sites\/4\/2014\/07\/IMG_1108.jpg\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-2619\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2014\/07\/IMG_1108-300x225.jpg\" alt=\"IMG_1108\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2014\/07\/IMG_1108-300x225.jpg 300w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2014\/07\/IMG_1108.jpg 600w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><!--more--><\/p>\n<p>\u753b\u50cf\u306b\u5199\u3063\u3066\u3044\u308b2\u3064\uff08\u767d\u3044\u5186\u578b\u3068\u9ed2\u3044\u56db\u89d2\u578b\uff09\u304c\u30d3\u30fc\u30b3\u30f3\u6a5f\u5668\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u767d\u3044\u65b9\u306f\u3001<strong><span style=\"font-size: 150%; color: #883030;\">\u30dc\u30bf\u30f3\u96fb\u6c60\u3067\u7d041\u5e74<\/span><\/strong>\u7a3c\u52d5\u3059\u308b\u30bf\u30a4\u30d7<br \/>\u9ed2\u3044\u65b9\u306f\u3001<strong><span style=\"font-size: 150%; color: #883030;\">\u5358\u4e09\u96fb\u6c60\u3067\u7d0410\u5e74<\/span><\/strong>\u7a3c\u52d5\u3059\u308b\u30bf\u30a4\u30d7<br \/>\u203b\u7a3c\u52d5\u5e74\u6570\u306f\u30e1\u30fc\u30ab\u30fc\u767a\u8868\u306e\u30b9\u30da\u30c3\u30af\u4e0a\u306e\u6570\u5024\u3067\u3059\u3002<br \/>\u30b5\u30a4\u30ba\u6bd4\u8f03\u306e\u305f\u3081\u306b\u5358\u4e09\u96fb\u6c60\u3092\u304a\u3044\u3066\u307e\u3059\u306e\u3067\u3001\u5927\u4f53\u306e\u5927\u304d\u3055\u306f\u304a\u308f\u304b\u308a\u3044\u305f\u3060\u3051\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3067\u306f\u3001Android\u306e\u30d3\u30fc\u30b3\u30f3\u53d7\u4fe1\u306e\u65b9\u6cd5\u3067\u3059\u304c\u3001\u5358\u7d14\u306b\u53d7\u4fe1\u3059\u308b\u3060\u3051\u3067\u3042\u308c\u3070\u975e\u5e38\u306b\u7c21\u5358\u3067\u3059\u3002<br \/>\u307e\u305a\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\u3053\u306e\u6642\u6ce8\u610f\u3059\u308b\u306e\u306f\u3001\u30d3\u30fc\u30b3\u30f3\u3092\u53d7\u4fe1\u3059\u308b\u305f\u3081\u306b\u306fBLE\u304c\u5fc5\u9808\u3067\u3059\u306e\u3067<br \/><strong>API\u30ec\u30d9\u30eb\u3092OS\uff14\uff0e\uff13\u4ee5\u4e0a<\/strong>\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/><strong>\u203b\u5b9f\u6a5f\u306f\u3001OS\uff14\uff0e\uff13\u3067\u3082\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3067BLE\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3068\u30c0\u30e1\u306a\u306e\u3067\u3001\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u7aef\u672b\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/strong><\/p>\n<p>\u6b21\u306b\u3001\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306bBluetooth\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<br \/><strong>&lt;uses-permission android:name=&#8221;android.permission.BLUETOOTH&#8221;\/&gt;<\/strong><br \/><strong>&lt;uses-permission android:name=&#8221;android.permission.BLUETOOTH_ADMIN&#8221;\/&gt;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u3042\u3068\u306f\u3001BLE\u306e\u53d7\u4fe1\u3092\u884c\u3046\u3060\u3051\u3067\u3059\u3002<br \/>BluetoothAdapter \u3092pabulic\u3067\u5b9a\u7fa9\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/><strong>public BluetoothAdapter mBluetoothAdapter;<\/strong><\/p>\n<p>onCreate\u6642\u306b\u30b7\u30b9\u30c6\u30e0\u304b\u3089BluetoothManager\u3092\u53d6\u5f97\u3057\u3066\u5148\u307b\u3069\u5ba3\u8a00\u3057\u305fBluetoothAdapter\u306bgetAdapter()\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/><strong>BluetoothManager bluetoothManager = (BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);<\/strong><br \/><strong>mBluetoothAdapter = bluetoothManager.getAdapter();<\/strong><\/p>\n<p>\u6b21\u306b\u30d3\u30fc\u30b3\u30f3\uff08\u30c7\u30d0\u30a4\u30b9\uff09\u306e\u30b9\u30ad\u30e3\u30f3\u3067\u3059\u3002<br \/>\u305d\u306e\u307e\u307eCreate\u306e\u6d41\u308c\u3067\u884c\u3063\u3066\u3082\u826f\u3044\u3067\u3059\u3057\u3001\u4f55\u304b\u9069\u5f53\u306b\u30dc\u30bf\u30f3\u8a2d\u3051\u3066\u305d\u306e\u30a4\u30d9\u30f3\u30c8\u3067\u3057\u3066\u3057\u307e\u3063\u3066\u3082\u826f\u3044\u3067\u3059\u3002<br \/><strong>mBluetoothAdapter.startLeScan(mLeScanCallback);<\/strong><\/p>\n<p>\u30b9\u30ad\u30e3\u30f3\u304c\u958b\u59cb\u3055\u308c\u3066\u30d3\u30fc\u30b3\u30f3\u304c\u898b\u3064\u304b\u308b\u3068BluetoothAdapter\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u304c\u547c\u3070\u308c\u307e\u3059\u306e\u3067<br \/><strong>private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback(){<\/strong><br \/><strong>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0@Override<\/strong><br \/><strong>\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 public void onLeScan(BluetoothDevice device, int resint, byte[] scanByte) {<\/strong><br \/><strong>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/<strong>scanByte\u306e\u4e2d\u8eab\u3092\u30d1\u30fc\u30b9<\/strong><\/strong><br \/><strong>\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 }<\/strong><br \/><strong>};<\/strong><br \/><strong>scanByte<\/strong>\u306e\u4e2d\u306b\u30d3\u30fc\u30b3\u30f3\u306eUUID\u3084\u3089\u5165\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001<br \/>\u30d1\u30fc\u30b9\u3057\u3066\u4e2d\u8eab\u3092\u89e3\u6790\u3059\u308c\u3070\u30b9\u30ad\u30e3\u30f3\u3057\u305f\u7d50\u679c\u3092\u5f97\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u306e\u3067<br \/>\u30d3\u30fc\u30b3\u30f3\uff11\u304c\u30b9\u30ad\u30e3\u30f3\u3055\u308c\u305f\u5834\u5408\u30012\u304c\u30b9\u30ad\u30e3\u30f3\u3055\u308c\u305f\u5834\u5408\u7b49\u306b\u5fdc\u3058\u3066\u51e6\u7406\u3092\u632f\u308a\u5206\u3051\u308c\u3070\u8272\u3005\u51fa\u6765\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 120%; color: #aa3030;\">\u3053\u306e\u7d39\u4ecb\u3057\u305f\u65b9\u6cd5\u306f\u3001\u3042\u304f\u307e\u3067\u5358\u7d14\u306b\u30d3\u30fc\u30b3\u30f3\u3092\u53d7\u4fe1\u3059\u308b\u3060\u3051\u306e\u7269\u3067\u3001\u5b9f\u969b\u306b\u306f<\/span><\/strong><br \/><strong><span style=\"font-size: 120%; color: #aa3030;\">\u8ddd\u96e2\u3001\u8907\u6570\u56de\u691c\u51fa\u306e\u5236\u5fa1\u7b49\u3005\u3001\u30a2\u30d7\u30ea\u3068\u3057\u3066\u6210\u7acb\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u8272\u3005\u5b9f\u88c5\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/strong><\/p>\n<p>\u307e\u305f\u3001\u30d3\u30fc\u30b3\u30f3\u30e1\u30fc\u30ab\u30fc\u304b\u3089\u5c02\u7528\u306eSDK\u306a\u3093\u304b\u3082\u516c\u958b\u3055\u308c\u3066\u3044\u305f\u308a\u3059\u308b\u306e\u3067\u8cfc\u5165\u3055\u308c\u305f\u969b\u306f\u305d\u3061\u3089\u4f7f\u3063\u305f\u65b9\u304c\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6708\u66dc\u62c5\u5f53SH<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/2616\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/2616\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"\u30b9\u30de\u30db\u3068Beacon\uff08iBeacon\uff09 \u305d\u306e2\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/2616\" data-text=\"\u30b9\u30de\u30db\u3068Beacon\uff08iBeacon\uff09 \u305d\u306e2\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/2616\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/2616\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u3064\u3065\u304d\u3067\u3059\u3002 \u4eca\u56de\u306fAndroid\u3067\u30d3\u30fc\u30b3\u30f3\u3092\u53d7\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4ea4\u3048\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[67,12],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/2616"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=2616"}],"version-history":[{"count":5,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/2616\/revisions"}],"predecessor-version":[{"id":2624,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/2616\/revisions\/2624"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=2616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=2616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=2616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}