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
410
NearByConnectionsApi
funnelbit
July 21, 2015
Tweet
Share
More Decks by funnelbit
See All by funnelbit
Hatena Engineer Seminar #9
funnelbit
5
7.1k
droidkaigi-2017-renovation
funnelbit
10
10k
Dart
funnelbit
0
250
BottomBarAndSnackBar
funnelbit
0
460
Dagger2 Optional bindings
funnelbit
0
530
WearableRecyclerView
funnelbit
1
760
QucikSettingsTileAPI
funnelbit
0
340
Mobile Vision
funnelbit
0
430
AwarenessAPI
funnelbit
0
130
Other Decks in Technology
See All in Technology
Commitment vs Harrisonism - Keynote for Scrum Niseko 2024
miholovesq
6
1.1k
小規模に始めるデータメッシュとデータガバナンスの実践
kimujun
3
590
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
1
620
pandasはPolarsに性能面で追いつき追い越せるのか
vaaaaanquish
4
4.6k
AWS CDKでデータリストアの運用、どのように設計する?~Aurora・EFSの実践事例を紹介~/aws-cdk-data-restore-aurora-efs
mhrtech
4
650
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
130
【若手エンジニア応援LT会】AWSで繋がり、共に成長! ~コミュニティ活動と新人教育への挑戦~
kazushi_ohata
0
180
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
27
12k
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
24
6.8k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
49k
急成長中のWINTICKETにおける品質と開発スピードと向き合ったQA戦略と今後の展望 / winticket-autify
cyberagentdevelopers
PRO
1
160
【若手エンジニア応援LT会】AWS Security Hubの活用に苦労した話
kazushi_ohata
0
170
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
88
5.7k
Into the Great Unknown - MozCon
thekraken
31
1.5k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
KATA
mclloyd
29
13k
Building an army of robots
kneath
302
42k
A Tale of Four Properties
chriscoyier
156
23k
GraphQLとの向き合い方2022年版
quramy
43
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
How GitHub (no longer) Works
holman
311
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
Teambox: Starting and Learning
jrom
132
8.7k
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
͋Γ͕ͱ͏͍͟͝·ͨ͠