Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NearByConnectionsApi
Search
funnelbit
July 21, 2015
Technology
1
420
NearByConnectionsApi
funnelbit
July 21, 2015
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
470
Dagger2 Optional bindings
funnelbit
0
540
WearableRecyclerView
funnelbit
1
770
QucikSettingsTileAPI
funnelbit
0
350
Mobile Vision
funnelbit
0
440
AwarenessAPI
funnelbit
0
130
Other Decks in Technology
See All in Technology
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
220
2024年にチャレンジしたことを振り返るぞ
mitchan
0
130
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
220
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
120
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
ハイテク休憩
sat
PRO
2
140
MLOps の現場から
asei
6
640
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
170
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
440
Featured
See All Featured
Scaling GitHub
holman
458
140k
Navigating Team Friction
lara
183
15k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
How STYLIGHT went responsive
nonsquared
95
5.2k
The Cost Of JavaScript in 2023
addyosmani
45
7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Done Done
chrislema
181
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Transcript
/FBSCZ$POOFDUJPOT "1* JEGVOOFMCJU ଜɹྋ
͜Μʹͪ w JEGVOOFMCJU w ଜɹྋ w BOESPJE
ۙ͘ͷ ଞσόΠεͱͷ௨৴
ߟ͑ΒΕΔखஈ w CMVFUPPUIͰݕࡧɾ௨৴ w 23ίʔυͰσʔλΛ͢ w "OESPJE#FBNͰ௨৴ w ҐஔใͰ͓ޓ͍Λೝࣝͯ͠Կ͔Ͱ௨৴
໘ w ͱʹ͔͘ίετ͕͔͔Δ w ͋·ΓγʔϜϨεͰͳ͍ w ෳਓ͕૬खͩͬͨΒߋʹ໘ w ৗ࣌ଓ͢Δ߹ʁ
/FBSCZ
/FBSCZ w ۙ͘ʹ͍ΔσόΠεͱଓͯ͠ΓͱΓͰ͖Δ w /FBSCZ.FTTBHFT w /FBSCZ$POOFDUJPOT
w XJp CMVFUPPUI ਓؒʹฉ͑͜ͳ͍ԻͰ௨৴ w (PPHMF1MBZ4FSWJDFT ༧ఆ w J04Ͱ͑Δ
༧ఆ w Ұ෦ͷΞϓϦઌߦ࠾༻ /FBSCZ.FTTBHFT
/FBSCZ$POOFDUJPOT w ϩʔΧϧωοτϫʔΫܦ༝Ͱଓ w ϚϧνϓϨΠήʔϜͳͲʹ͑Δ w ͢Ͱʹར༻Մೳ w ࠓ͢ͷͪ͜ΒͰ͢
/FBSCZ$POOFDUJPOT"1* w (PPHMF1MBZ4FSWJDFT ͔Βར༻Մೳ w (PPHMF"QJ$MJFOUΛར༻ w ඞཁͳQFSNJTTJPO A"$$&44@/&5803,@45"5&AͷΈ
w ϩʔΧϧωοτϫʔΫͷଓඞਢ
Nearby.Connections.startAdvertising Nearby.Connections.startDiscovery Nearby.Connections.sendConnectionRequest Nearby.Connections.acceptConnectionRequest Nearby.Connections.rejectConnectionRequest Nearby.Connections.sendReliableMessage Nearby.Connections.sendUnreliableMessage … /FBSCZ$POOFDUJPOT"1*
w (PPHMF"QJ$MJFOU#VJMEFSʹ͢ఆ mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Nearby.CONNECTIONS_API) .build();
/FBSCZ$POOFDUJPOT@"1*
w ଞͷσόΠε͔ΒݕࡧՄೳͳঢ়ଶʹ͢Δ Nearby.Connections.startAdvertising(mGoogleApiClient, name, appMetadata, TIMEOUT_ADVERTISE, this).setResultCallback(new ResultCallback<Connections.StartAdvertisingResult>() { @Override
public void onResult(Connections.StartAdvertisingResult result) { // ͳʹ͔ } }); TUBSU"EWFSUJTJOH
w ଞͷσόΠεͷ୳ࡧΛ։࢝͢Δ Nearby.Connections.startDiscovery(mGoogleApiClient, serviceId, TIMEOUT_DISCOVER, this) .setResultCallback(new ResultCallback<Status>() { @Override
public void onResult(Status status) { // ͳʹ͔ } }); TUBSU%JTDPWFSZ
w ଞσόΠεʹଓϦΫΤετΛૹΔ Nearby.Connections.sendConnectionRequest(mGoogleApiClient , myName, endpointId, myPayload, new Connections.ConnectionResponseCallback() {
@Override public void onConnectionResponse(String endpointId, Status status, byte[] bytes) { mOtherEndpointId = endpointId; } }, this); TFOE$POOFDUJPO3FRVFTU
w ଓϦΫΤετΛڐՄ͠ɺଓঢ়ଶʹ͢Δ Nearby.Connections.acceptConnectionRequest(mGoogleApiClient , endpointId, payload, MainActivity.this) .setResultCallback(new ResultCallback<Status>() {
@Override public void onResult(Status status) { // ͳʹ͔ } }); BDDFQU$POOFDUJPO3FRVFTU
w ଓϦΫΤετΛڋ൱ Nearby.Connections.rejectConnectionRequest(mGoogleApiClient , endpointId); SFKFDU$POOFDUJPO3FRVFTU
w ϝοηʔδΛૹΔ CZUF w ࣮֬ʹ͍ͨ͠ϝοηʔδ͕͋Δͱ͖ʹ͏ w ҉߸Խ͞Εͳ͍ͷͰҙ Nearby.Connections.sendReliableMessage(mGoogleApiClient, mOtherEndpointId,
msg.getBytes()); TFOE3FMJBCMF.FTTBHF
w ෳͷѼઌʹૹΔ͜ͱͰ͖Δ List<String> mOtherEndpointIds; … Nearby.Connections.sendReliableMessage(mGoogleApiClient, mOtherEndpointIds, msg.getBytes()); TFOE3FMJBCMF.FTTBHF
Nearby.Connections.sendUnreliableMessage(mGoogleApiClient , mOtherEndpointId, msg.getBytes()); w TFOE3FMJBCMF.FTTBHFΑΓߴ w ૹ৴ՄೳαΠζ͕TFOE3FMJBCMF.FTTBHFΑΓ খ͍͞ w
ॏཁͰͳ͍ใΛසൟʹૹΔ߹ʹ༻ TFOE6OSFMJBCMF.FTTBHF
·ͱΊ w ৭ΜͳσόΠεͱίετͰܨ͛Δࣄ͕Մೳ w ໘ന͍ w (PPHMF1MBZ4FSWJDFT͑͞ೖΕΕ͑Δ
ৄࡉ w /FBSCZ$POOFDUJPOT"1* w IUUQTEFWFMPQFSTHPPHMFDPNOFBSCZ DPOOFDUJPOTPWFSWJFX
͋Γ͕ͱ͏͍͟͝·ͨ͠