Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AndroidでBluetoothビーコンを使おう
Search
でんのこ
July 13, 2024
Programming
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AndroidでBluetoothビーコンを使おう
2024-7-13に開催されたDroidKaigi.collect { #10@Nagoya }のLT資料です。DroidKaigi.collect { #10@Nagoya }
でんのこ
July 13, 2024
Other Decks in Programming
See All in Programming
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
ActionController meets Protocol Buffers
sorah
0
520
残高管理から台帳サービスへの進化
artoy
1
200
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Workers Cache を知る
syumai
0
360
Railsバージョンを4倍にした話
optim
0
350
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
920
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
APNsからLive Activityを開始する話
yumnumm
0
170
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
Featured
See All Featured
Marketing to machines
jonoalderson
1
5.9k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
A Modern Web Designer's Workflow
chriscoyier
699
190k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Become a Pro
speakerdeck
PRO
31
6.3k
Transcript
AndroidでBluetooth ビーコンを使おう でんのこ
自己紹介 プログラミング歴 大学入学後プログラミングを始める 1. 1年夏にAndroidアプリ開発を始める 2. 今年度はiOSアプリ開発の勉強もしている 3. でんのこ 名古屋工業大学
情報工学科 3年 C0de副部長 Twitter(x): @sd_dennoko 趣味 PCいじり スプラトゥーン オーディオ etc...
ピロリン開発バイト 名工大で使用されている打刻アプリ 学内に設置された多数のビーコンを用いて、 スマホから講義の出席記録を行うことが可能 開発・保守は学生がアルバイトの形で行っている ピロリンとは
AltBeacon ライブラリ
Bluetoothビーコンの概要 iBeacon Appleが開発 BLEを使用 AltBeacon Radius Networksが開発 BLEを使用 オープンソース ビーコンとは
特定の範囲内で無線信号を発信する小型のデバイス 位置情報を使用するサービスで使用されることが多い Eddystone Googleが開発 BLEを使用 Bluetoothビーコンの規格
AltBeaconライブラリの概要 ビーコンの検出 検出時に様々な値を取得可能 UUID Major Minor AltBeaconライブラリとは Androidでビーコンの検出ができるオープンソースのライブラリ 距離推定 信号強度を元にしてビーコ
ンとの距離を推定する 主な機能 サポート v2.19.5〜 Android 12,13 v2.20〜 Android 14
使い方
Android 14 ACCESS_FINE_LOCATION Android 12 or SDK 31+ BLUETOOTH_SCAN BLUETOOTH_CONNECT
※ デバイス名を読み込むか、接続を確立する場合 BLUETOOTH_ADVERTISE ※ 現在のデバイスを検索できるようにする場合 バックグラウンドでビーコンを検知したい場合 ACCESS_BACKGROUND_LOCATION
実装の流れ BeaconManagerの初期化 1. 対象とするビーコンの設定 2. モニタリング処理の定義 3. モニタリングの開始 4.
BeaconManagerの初期化と 対象とするビーコンの設定 Activity の onCreate 内で BeaconManager を初期化する BeaconManager が
AltBeacon ライブラリのAPIのエントリー ポイントとなる Region(対象のビーコン, UUID, Major, Minor) で条件指定
モニタリングの処理の定義 ビーコンの内外の状態によって処理を分岐させる例 state が MonitorNorifier.INSIDE かどうかを判定している
モニタリングの開始 regionState はビーコンに対する内外の状態を表す regionState.observe(this, monitoringObserver) で変化の監視を設定 startMonitoring(region) でモニタリングを開始
距離判定を行う場合の例 検出したビーコン数と、それぞれのビーコンとの距離を ログに出力する例 regionState のかわりに rangedBeacons で監視を設定
おわり
Permission 設定 AltBeacon の GitHub リポジトリ 公式の Sample Code Resource
Page