Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AwarenessAPI
Search
funnelbit
July 27, 2016
Technology
0
130
AwarenessAPI
funnelbit
July 27, 2016
Tweet
Share
More Decks by funnelbit
See All by funnelbit
Hatena Engineer Seminar #9
funnelbit
5
7.2k
droidkaigi-2017-renovation
funnelbit
10
10k
Dart
funnelbit
0
250
BottomBarAndSnackBar
funnelbit
0
460
Dagger2 Optional bindings
funnelbit
0
530
WearableRecyclerView
funnelbit
1
770
QucikSettingsTileAPI
funnelbit
0
340
Mobile Vision
funnelbit
0
430
Asynchronous Injection
funnelbit
1
230
Other Decks in Technology
See All in Technology
セキュリティ運用って包括的にできていますか?SaaSを使って次のステップへ / Comprehensive Cyber Security Operations for Cloud Services Using SaaS
sakaitakeshi
0
260
静的解析で実現した効率的なi18n対応の仕組みづくり
minako__ph
2
2.3k
Nutanixにいらっしゃいませ。Moveと仮想マシン移行のポイント紹介
shadowhat
0
120
ARRが3年で10倍になったプロダクト開発とAI活用の軌跡
akiroom
0
170
asumikamというカンファレンスオーガナイザの凄さを語る / The Brilliance of Asumikam
tomzoh
1
150
MTDDC Meetup TOKYO 2024 運用フェーズに突入したウェブサイト。年々コスト増えていませんか?
kurashige
1
130
ONNX推論クレートの比較と実装奮闘記
emergent
0
210
もう一度、 事業を支えるシステムに。
leveragestech
5
2.9k
歴史あるRuby on Railsでデッドコードを見つけ、 消す方法@yabaibuki.dev #3
ayumu838
0
1.5k
Amazon Forecast亡き今、我々がマネージドサービスに頼らず時系列予測を実行する方法
sadynitro
0
210
JAWS UG 青森(弘前)クラウド・AWS入門
hiragahh
0
170
Hyperledger Fabric(再)入門
gakumura
3
6.7k
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Why Our Code Smells
bkeepers
PRO
334
57k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
27
2.1k
Fireside Chat
paigeccino
34
3k
We Have a Design System, Now What?
morganepeng
50
7.2k
Site-Speed That Sticks
csswizardry
0
78
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Transcript
"XBSFOFTT"1* "OESPJE
ࣗݾհ ଜྋ גࣜձࣾͯͳ )BUFOBGVOOFMCJU 5XJUUFS!FYQFSPQFSP
Ϣʔβͷ ͓͔Ε͍ͯΔ ঢ়گΛΔ
ెา͔ɺࣗసं͔
ెา͔ɺࣗసं͔า͍͍ͯ Δͷ͔ɺ͍ͬͯΔͷ͔ɺࢭ ·͍ͬͯΔͷ͔
ెา͔ɺࣗసं͔า͍͍ͯΔͷ͔ɺͬ ͍ͯΔͷ͔ɺࢭ·͍ͬͯΔͷ͔ͱ͋Δൣ ғʹೖ͔ͬͨɺͱ͋Δൣғʹ/ඵډଓ ͚͍ͯΔ͔ɺͱ͋Δൣғ͔Β͔ͨ͠
ెา͔ɺࣗసं͔ɺΓ͔า͍͍ͯΔͷ͔ɺͬ ͍ͯΔͷ͔ɺࢭ·͍ͬͯΔͷ͔ͱ͋Δൣғʹೖͬ ͔ͨɺͱ͋Δൣғʹ/ඵډଓ͚͍ͯΔ͔ɺͱ͋Δ ൣғ͔Β͔ͨ͋͠Δॴ͔Β/ϝʔτϧҠ ಈͨ͠ͱ͋ΔϏʔίϯ͕ݟ͔ͭͬͨɺͱ͋ΔϏʔ ίϯ͕ݟ͔ͭΒͳ͘ͳͬͨͱ͋Δ͔࣌ؒΒҰఆ࣌ ؒܦաͨ͠ϔουϗϯΛ͍ͯ͞͠Δɺͦ͏Ͱͳ͍ ΕͰ͋ΔɻઇͰ͋ΔɻӍͰ͋Δͱಉ࣌ʹɺڧ෩ Ͱ͋ΔɻԹͱ࣪ɻFUDʜ
"XBSFOFTT"1* w Ϣʔβͷঢ়گΛಡΈऔΔ"1* w ָ࣮͕ w ʮਖ਼͍͠ʯσʔλ͕ಘΒΕΔͱ͍ͯ͠Δ w ϝϞϦɺόοςϦʔͷঢ়گΛݟͯಈ͘
"XBSFOFTT"1* w 6TF(PPHMF1MBZ4FSWJDFTWd w &OBCMF"XBSFOFTT"1* w "EEJUJPOBM"1* &OBCMF1MBDFT"1*GPS "OESPJE w
"EEJUJPOBM"1* &OBCMF/FBSCZ.FTTBHFT "1*
"XBSFOFTT"1* mGoogleApiClient = new GoogleApiClient.Builder(this) .addApi(Awareness.API) .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {
@Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { Log.e("onConnectionFailed", "failed"); } }) .build();
4OBQTIPU"1* 'FODF"1*
4OBQTIPU"1*
4OBQTIPU"1* w ۙͷঢ়گΛऔಘ͢Δ w ݱࡏϢʔβϔουϗϯΛ͍ͬͯΔ w ݱࡏϢʔβ͕͍Δॴ w ݱࡏϢʔβ͕͍Δॴͷఱؾ w
FUDʜ
)FBEQIPOF Awareness.SnapshotApi .getHeadphoneState(mGoogleApiClient) .setResultCallback(new ResultCallback<HeadphoneStateResult>() { @Override public void onResult(@NonNull
HeadphoneStateResult headphoneStateResult) { switch (headphoneStateResult.getHeadphoneState().getState()) { case HeadphoneState.PLUGGED_IN : Log.e("ϔουϗϯ", "ૠ͍ͯ͠Δ"); break; case HeadphoneState.UNPLUGGED: Log.e("ϔουϗϯ", "ૠ͍ͯ͠ͳ͍"); break; } } });
8FBUIFS Awareness.SnapshotApi .getWeather(mGoogleApiClient) .setResultCallback(new ResultCallback<WeatherResult>() { @Override public void onResult(@NonNull
WeatherResult weatherResult) { if (weatherResult.getWeather() == null) return; weatherResult.getWeather() .getConditions() } });
8FBUIFSHFU$POEJUJPOT ɾJOU<>ͰఱؾΛฦ͢ $0/%*5*0/@6/,/08/ $0/%*5*0/@$-&"3 $0/%*5*0/@$-06%: $0/%*5*0/@'0((: $0/%*5*0/@)";: $0/%*5*0/@*$:
$0/%*5*0/@3"*/: $0/%*5*0/@4/08: $0/%*5*0/@4503.: PS$0/%*5*0/@8*/%:
'FODF"1*
'FODF"1* w ঢ়ଶʹมԽ͕͋Ε௨ w Ϣʔβ͕า͖࢝Ίͨ w Ϣʔβ͕ࣗసंͰҠಈ͍ͯ͠Δ w Ϣʔβ͕ͱ͋ΔΤϦΞ͔Βͨ͠ w
FUDʜ
TUBSU8BMLJOH AwarenessFence startWakingFence = DetectedActivityFence .starting(DetectedActivityFence.WALKING);
VQEBUF'FODFT Awareness.FenceApi.updateFences(mGoogleApiClient, new FenceUpdateRequest.Builder() .addFence("startWakingFence", startWakingFence, pendingIntent) .build()) .setResultCallback(new ResultCallback<Status>()
{ @Override public void onResult(@NonNull Status status) { if (!status.isSuccess()) {…} } });
'FODF6QEBUF3FRVFTU Awareness.FenceApi.updateFences(mGoogleApiClient, new FenceUpdateRequest.Builder() .addFence("startWakingFence", startWakingFence, pendingIntent) .build()) .setResultCallback(new ResultCallback<Status>()
{ @Override public void onResult(@NonNull Status status) { if (!status.isSuccess()) {…} } });
#SPBEDBTU3FDFJWFS public class MyFenceReceiver extends BroadcastReceiver { … @Override public
void onReceive(Context context, Intent intent) { if (TextUtils.equals(fenceState.getFenceKey(), "startWakingFence")) { switch(fenceState.getCurrentState()) { case FenceState.TRUE:… case FenceState.FALSE:… case FenceState.UNKNOWN:… … } } …
$PNCJOBUJPO'FODF
$PNCJOBUJPO'FODF AwarenessFence.and( DetectedActivityFence .during(DetectedActivityFence.WALKING), HeadphoneFence .during(HeadphoneState.PLUGGED_IN) ); า͍͓ͯΓɺϔουϗϯΛ͚͍ͭͯΔ
$PNCJOBUJPO'FODF AwarenessFence walkingAndPlugInHeadPhoneFence = AwarenessFence.and( DetectedActivityFence.during(DetectedActivityFence.WALKING) , HeadphoneFence.during(HeadphoneState.PLUGGED_IN), AwarenessFence.not(LocationFence.in(35.010974, 135.7612923,
50, 0L)) ); า͍͓ͯΓɺϔουϗϯΛ͚͍ͭͯΔ͕ɺͱ͋ΔॴͷܘN ʹ͍ͳ͍
$PNCJOBUJPO'FODF AwarenessFence.or(AwarenessFence.and( DetectedActivityFence.during(DetectedActivityFence.WALKING) , HeadphoneFence.during(HeadphoneState.PLUGGED_IN), AwarenessFence.not(LocationFence.in(35.010974, 135.7612923, 50, 0L)) ),
BeaconFence.found(…)); า͍͓ͯΓɺϔουϗϯΛ͚͍ͭͯΔ͕ɺͱ͋ΔॴͷܘN ʹ͍ͳ͍ɻ·ͨɺͱ͋ΔϏʔίϯ͕ͦʹݟ͔ͭͬͨɻ
ॴײ w ʮݡ͍ʯػೳΛ࡞Δͷ͕༰қʹͳͬͨ w ͜Μͳʹ؆୯ͳΒͬͯΈΑ͏͔ͱ͍͏ؾʹͳ Δ w Ͳ͏͏·͘͏͔ߟ͑Δඞཁ͕͋Δ
ৄࡉ w IUUQTEFWFMPQFSTHPPHMFDPNBXBSFOFTT w IUUQTEFWFMPQFSTHPPHMFDPNBOESPJE SFGFSFODFDPNHPPHMFBOESPJEHNT BXBSFOFTTQBDLBHFTVNNBSZ w IUUQTEFWFMPQFSTHPPHMFDPNBOESPJE HVJEFTSFMFBTFTKVOF@@@W
͋Γ͕ͱ͏͍͟͝·ͨ͠