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
AndroidThingsとFirebaseで始めるホームセキュリティ / Android ...
Search
Katsuya Kato
February 08, 2018
Technology
5.7k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AndroidThingsとFirebaseで始めるホームセキュリティ / Android Things Home Security
Droidkaigi2018発表資料
Katsuya Kato
February 08, 2018
More Decks by Katsuya Kato
See All by Katsuya Kato
複業メンバーと共に創るカウシェ
katsuyax
0
790
WWDCでこの先生きのこるには / WWDC2017
katsuyax
0
110
watchOS3の新機能 / watchos3
katsuyax
0
110
Firebaseを使ってみた
katsuyax
0
62
iPhone(iOS)のアプリ内課金 / in app purchase
katsuyax
0
120
Other Decks in Technology
See All in Technology
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
AI活用の現在地、 ちゃんと見えてますか?/XPfest-2026
visional_engineering_and_design
0
180
AIで実装は速くなった。なのにプロダクトは速くならない。職能の壁を越えて価値のフローを設計する
nwiizo
8
7.8k
WAF 運用改善の承認サイクル/SRE_BizReach_MIXI_1
visional_engineering_and_design
2
420
20260912_スクフェス三河
kgnkhkr
0
270
なぜSRE・セキュリティは評価されないのか?守りの組織を事業成長エンジンに変えた実践
cscengineer
PRO
3
2.4k
Gitは怖い?共有ワークスペースから始めるSnowflakeチーム開発
coco_se
0
110
AI-DLCって実際どう? 〜聞きたいこと全部聞いてみる〜
news_it_enj
0
260
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
120
Redmine 7.0で私が開発した新機能の狙いと背景
vividtone
1
160
アリアドネの糸と、20年ごとの建て替え ── 長尾真『電子図書館』を、伊勢で読み直す / Rereading Makoto Nagao’s "Electronic Library" in Ise
ykiyota
0
150
GoCon2026 - Open Source, Open World
sanposhiho
3
3.1k
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
BBQ
matthewcrist
89
10k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
270
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
350
For a Future-Friendly Web
brad_frost
183
10k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
270
Code Review Best Practice
trishagee
74
20k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
690
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Curse of the Amulet
leimatthew05
2
14k
Transcript
Droidkaigi2018 Katsuya Kato
,1* ¢ %(!0Kato Katsuya ¢ Android / iOS ¢
3"$ . ¢ +& 2 # ¢ '/- ) 2
#%/' ¢ Raspberry Pi -* Android Things&, )
"$!+. ( 3
"#%' 0>< ¢ E,67 ¢ :A.3 B;*=7
¢ )1/8 D ¢ C@(HF, /29 5 ¢ C@(4?-+ ¢ IG ! $& 4
Android Things ¢ Google IoT ¢ ¢ : Raspberry Pi
3 5 // . / . /
Android Things ¢ Android,-1 ¢ #'$'( ¢
GPIO5/20 ¢ #'& Rainbow HAT1 ¢ LED4x14"%).4.3* ! &* etc ¢ GPIO1+ http://crossbridge- lab.hatenablog.com/entry/googlehome-androidthings- led
¢ ADK(Accessory Development Kit) ¢ Android
¢ https://developer.android.com/adk/index.html ¢ 2011/2012 Google I/O 7
" ¢ Android Things with Raspberry Pi ¢
Nature Remo ¢ ¢ Linking ¢ Bluetooth! ¢ Firebase ¢ Firebase Realtime Database ¢ Cloud Functions for Firebase ¢ Firebase Cloud Messaging ¢ Geofencing 8
9
35 ¢ 6'2 /9"+&). *$!,1:@ B04> 1. '2A#.
(Linking%(")= Android Things'2 7: 2. 7: Firebase Realtime Database?<8 3. <8&-Cloud Functions for Firebase "+&).*$!,1:(FCM); 10
Linking*/#%)- ¢ NTT&.E37G>?5<C 9 4 *1% Project Linking ¢ 6A
$' Linking$' D ¢ ;H!2 ¢ F:I:!2 ¢ ,"2LED etc ¢ 1,00082,5008B: ¢ Android/iOS6A +02 (2 @= 11 https://linkingiot.com/
1 12 1 2. E B Firebase Realtime Database Cloud
Functions for Firebase 3.E B. 3. (FCM)
Linking(!# )* ¢ SDK$% ¢ https://linkingiot.com/developer/api.html ¢ +
Jar,'&" 13
Linking$&!A/1 Android Things(,4K ¢ !*-3C 14 // BeaconScannerSDK?H +! val
scanner = BeaconScanner(this) val filter = IntentFilter() // >;9 698$#FGD5 // =B98$#9 670 filter.addAction(Define.filterBeaconScanResult) // '-=B9 6BroadcastReceiver70 registerReceiver(receiver, filter) // '!ID!*-)%70 !*-3C // 63N"- M:<0E@0.L2)%3IJ scanner.startScan(intArrayOf(6), 0)
Linking Android Things ¢ 15
var receiver: BeaconReceiverBase = object : BeaconReceiverBase() { internal var receivedData: BeaconData? = null override fun onReceiveScanResult(beaconData: BeaconData?) receivedData = beaconData handler.postDelayed(updateTask, 0) } //
Linking/$& Android Things! (7 ¢ +*) 16 internal var updateTask:
Runnable = Runnable { //rawData 838 06 val dataOpenCloseSensor = receivedData?.getOpenCloseSensor() if (dataOpenCloseSensor != null) { // 05 raw (12 '912"4 #- val binary = String.format("%12s", Integer.toBinaryString(dataOpenCloseSensor!!)) .replace(" ".toRegex(), "0") val binaryState = binary.substring(0, 1) // '912 val binaryCount = binary.substring(1) // '9%, // .
Linking Android Things ¢ 17 // Firebase
Realtime Database val database = FirebaseDatabase.getInstance().reference.child("state") database.child("door1_state") .setValue(Integer.parseInt(binaryState)) database.child("door1_count") .setValue(Integer.parseInt(binaryCount,2)) } }
Cloud Functions for Firebase ¢ Firebase HTTPS
¢ Realtime Database ¢ Firebase Authentication ¢ Crashlytics ¢ Cloud Storage ¢ Realtime Database 18
Realtime Database Node.js 19 const functions = require('firebase-functions');
const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); exports.push = functions.database.ref("/state/door1_state/") .onWrite(event => { const item = event.data; const payload = { data: { title: "", message: "1 " + (item.val() === 0 ? " " : " "), } }; //
4 20 // . /
¢ 21
Geofencing ¢ 5;70: ='ED& /" ?) # ¢ Google Play
Service+9: $B A5;70,6 3@ 14( ¢ Google Play Service API> &TargetSDK26.!-/ !70C ¢ *< %82 ¢ https://github.com/googlesamples/android-play-location 22
('Geofencing4. ¢ Geofencing4 Android!*+ $ 6#&:7/0- Database3/ ¢ Cloud Functions5
8, $61 " )9% 2 23
24
"( ¢ 745 !.,'$ ) ¢ Raspberry Pi2%/+1 2%/LED3*
#6-&→ )808 25
7 ¢ LinuxLIRC(Linux Infrared Remote Control) 164,- Android. '
$'(* ¢ Android Things035/ 8 +2"%#(&!)1 http://www.lirc.org/ 26
#&%)(!* Nature Remo ¢ #&%)(!* ¢ ;+ ;IRKit/KIRKit,L7 ¢ @:'
!*J)(!*60 NH?A ¢ GC 4D2I)(!*.F<O 4DM= B> ¢ -"$USBE9 ¢ API31 85 27 http://nature.global/
<: ¢ Nature Remo-6!$%( ) .* =3 84 ¢
Geofencing 502 " !#&ON0; OFF ¢ ()Geofencing 1' ¢ 07*()/ /9 ,+ 28
9? 1. '.*,$3"-/ @K6JHK6J! Firebase Database>7 2. Android ThingsFirebase
DatabaseIG: AI!<B>7 6JNature RemoAPI!L ¢ Nature RemoAPI1%0+)*2& #3( +)*;FCloud Functions!C →=8API!L 54DE 29
Nature Remo)!API" ¢ API&% https://developer.nature.global/ ¢
¢ '# $ ¢ '# $)! ¢ ¢ ()! etc 30
Nature Remo API 1. 2. API
ID 3. API 31
Nature Remo API 32 $ curl -H ‘Authorization: Bearer {TOKEN}’
-H ‘accept: application/json’ -H ‘Content-Type: application/x-www-form-urlencoded’ -X POST ‘https://api.nature.global/1/signals/{ ID}/send’ ¢ https://api.nature.global/1/signals/{ ID}/send
33
"$ ¢ Android Things (% or #!
*'&) 34
- 2 ¢ Android ThingsUSB*&Web' !# ¢ )%(" Linux
' ¢ Android Things+$, 35
2 36
.-), ¢ Android Things("* ¢ USB$ /!+%'& Web#(
37
38
"'=92. ¢ ;1 ,*6 ¢ Linking#%?7 ¢ (*A+),>#%(
*5 0<7 ¢ &!$(* ¢ ,5 1834(-/34) @: 39
10#$&+FN@ Android Things,.%(',.%( ¢ ,.%( ¢ Android5=I -"*-.!>
¢ )%&. LBUSBJ<E/D6 )%&.Q4P!:A7 ¢ ',.%( ¢ K9C-"*-.Linux38!?5 ¢ Raspberry Pi 3&LinuxHGOM2; 40
¢ <M.*790(@JVO ¢ ;DEB&L#!.*790(>4:,8:F T.+5&UC PIA ¢
Z$Q 'AndroidKR&N=W13)- &\IoT@ #S ¢ Y[Linux 169/2# ¢ G? "]H# 'Android Things&X% ¢ Linking13)- 41
42